
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.FtdiDesk\Source\AdcConverter.cs


using System.Diagnostics;

namespace Updk7.Tests.FtdiDesk
{
    internal class AdcConverter
    {
        private const int ROTARY_MAX = 255;
        private const int ROTARY_MIN = 0;

        private double _xMin = 0.0;
        private double _xFactor = 1.0;

        private double _yMin = 0.0;
        private double _yFactor = 1.0;

        private const int ADC_RES = (1 << 12) - 1;
        private const int NOISE_RANGE = 20;
        private const int SR_MAX = (int)(3.0 / 3.3 * ADC_RES);  // 3.0 В - с запасом, напряжение стабилитрона 2.2 В

        private int _srMax = SR_MAX;
        private int _srMin = NOISE_RANGE;

        private AdcConverter()
        {
        }

        private AdcConverter(DeskCalibrationInfo info)
        {
            Debug.Assert(info != null);

            if (info.IsAdcRangeSet)
            {
                _xMin = info.XMin;
                _xFactor = (double)ROTARY_MAX / (info.XMax - info.XMin);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                _yMin = info.YMin;
                _yFactor = (double)ROTARY_MAX / (info.YMax - info.YMin);
            }

            if (info.IsSRRangeSet)
            {
                _srMin = info.SRMin;
                _srMax = info.SRMax;
            }
        }

        public int ConvertX(double value)
        {
            return convertRotary(value, _xMin, _xFactor);
        }

        public int ConvertY(double value)
        {
            return convertRotary(value, _yMin, _yFactor);
        }

        public int ConvertSR(int sr1, int sr2)
        {
            // sr1 - опорное напряжение
            // sr2 - измеренное значение на кольцах
            if (sr1 >= _srMax)
                return int.MaxValue;
            if (sr2 <= _srMin)
                return 0;
            if (sr1 - sr2 <= _srMin)
                return int.MaxValue;

            return (int)(510.0 * 1e+3 * sr2 / (sr1 - sr2));
        }

        public static AdcConverter Create(DeskCalibrationInfo info)
        {
            return info != null ? new AdcConverter(info) : new AdcConverter();
        }

        private static int convertRotary(double value, double min, double factor)
        {
            var result = (int)(factor * (value - min));
            if (result > ROTARY_MAX)
                result = ROTARY_MAX;
            if (result < ROTARY_MIN)
                result = ROTARY_MIN;

            return result;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.FtdiDesk\Source\DeskCalibrationInfo.cs


using System;
using System.Runtime.InteropServices;
using System.Text;

namespace Updk7.Tests.FtdiDesk
{
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    internal struct UCI1
    {
        public const int VERSION_TAG = ('U' << 0) | ('C' << 8) | ('I' << 16) | ('1' << 24);
        public const int SERIAL_NUMBER_LENGTH = 16;

        public int VersionTag;

        public int Options;

        [MarshalAs(UnmanagedType.ByValArray, SizeConst = SERIAL_NUMBER_LENGTH)]
        public byte[] SerialNumber;

        public int XMax;

        public int XMin;

        public int YMax;

        public int YMin;

        public int SRMax;

        public int SRMin;
    }

    public class DeskCalibrationInfo
    {
        public static readonly string DefaultSerialNumber = "SHH-UPDK-P000000";

        public DeskCalibrationInfo()
        {
        }

        public string SerialNumber { get; set; } = DefaultSerialNumber;

        public int XMin { get; set; }

        public int XMax { get; set; }

        public int YMin { get; set; }

        public int YMax { get; set; }

        public int SRMin { get; set; }

        public int SRMax { get; set; }

        public bool IsAdcRangeSet => isCodeSet(XMin) && isCodeSet(XMax) && isCodeSet(YMin) && isCodeSet(YMax);

        public bool IsSRRangeSet => isCodeSet(SRMin) && isCodeSet(SRMax);

        internal static DeskCalibrationInfo Create(ref UCI1 info)
        {
            return new DeskCalibrationInfo()
            {
                SerialNumber = Encoding.ASCII.GetString(info.SerialNumber),
                XMin = info.XMin,
                XMax = info.XMax,
                YMin = info.YMin,
                YMax = info.YMax,
                SRMin = info.SRMin,
                SRMax = info.SRMax
            };
        }

        internal static UCI1 ToStructure(DeskCalibrationInfo info)
        {
            var serial = info.SerialNumber ?? DefaultSerialNumber;
            if (serial.Length > UCI1.SERIAL_NUMBER_LENGTH)
                serial = serial.Substring(0, UCI1.SERIAL_NUMBER_LENGTH);

            return new UCI1()
            {
                VersionTag = UCI1.VERSION_TAG,
                SerialNumber = Encoding.ASCII.GetBytes(serial),
                XMin = info.XMin,
                XMax = info.XMax,
                YMin = info.YMin,
                YMax = info.YMax,
                SRMin = info.SRMin,
                SRMax = info.SRMax
            };
        }

        internal unsafe static byte[] Serialize(DeskCalibrationInfo info)
        {
            var buffer = new byte[Marshal.SizeOf<UCI1>()];
            var uci1 = ToStructure(info);

            fixed (byte* pBuffer = buffer)
                Marshal.StructureToPtr(uci1, (IntPtr)pBuffer, false);

            return buffer;
        }

        internal static int GetBinarySize()
        {
            return Marshal.SizeOf<UCI1>();
        }

        internal static unsafe DeskCalibrationInfo Deserialize(byte[] buffer)
        {
            if (buffer.Length < GetBinarySize())
                return null;

            fixed (byte* pBuffer = buffer)
            {
                var info = Marshal.PtrToStructure<UCI1>((IntPtr)pBuffer);
                if (info.VersionTag != UCI1.VERSION_TAG)
                    return null;

                return Create(ref info);
            }
        }

        private bool isCodeSet(int value)
        {
            return value > 0 && value < int.MaxValue;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.FtdiDesk\Source\DeskEventArgs.cs


using System;
using System.Diagnostics;

namespace Updk7.Tests.FtdiDesk
{
    public enum MessageType
    {
        Buttons = 1,
        Adc = 2,
        Probe = 3,
        SweepComplete = 4,
        Led = 5,
        Sweep = 6,
        Version = 7,
        FlashOpStatus = 8,
        FlashErase = 9,
        FlashWrite = 10,
        FlashRead = 11,
        FlashData = 12,
        GetTime = 13,
        ResetTimer = 14,
        Ping = 15
    }

    public class MessageReceivedEventArgs : EventArgs
    {
        internal MessageReceivedEventArgs(MessageType type)
        {
            Type = type;
        }

        public MessageType Type { get; }
    }

    [Flags]
    public enum ButtonType : int
    {
        None = 0,
        Red = 1 << 0,
        Yellow = 1 << 1,
        Green = 1 << 2,
        White = 1 << 3,
        Black = 1 << 4,
        Blue = 1 << 5
    }

    public class ButtonsReceivedEventArgs : MessageReceivedEventArgs
    {
        internal ButtonsReceivedEventArgs(DeskMessages.Buttons data)
            : base(MessageType.Buttons)
        {
            Ticks = data.Ticks;
            Buttons = (ButtonType)data.NewState;
            ButtonsPrev = (ButtonType)data.OldState;
        }

        public uint Ticks { get; }

        public ButtonType Buttons { get; }

        public ButtonType ButtonsPrev { get; }

        public bool AnyPressed { get => Buttons != 0; }
    }

    public class AdcReceivedEventArgs : MessageReceivedEventArgs
    {
        internal AdcReceivedEventArgs(DeskMessages.Adc data)
            : base(MessageType.Adc)
        {
            XRaw = data.RotaryX;
            YRaw = data.RotaryY;
            SR1 = data.SR1;
            SR2 = data.SR2;
        }

        public int? X { get; internal set; }

        public int XRaw { get; }

        public int? Y { get; internal set; }

        public int YRaw { get; }

        public int SR1 { get; }

        public int SR2 { get; }

        public int? SkinResistance { get; internal set; }
    }

    public class ProbeReceivedEventArgs : MessageReceivedEventArgs
    {
        internal ProbeReceivedEventArgs(DeskMessages.Probe data)
            : base(MessageType.Probe)
        {
            Ticks = data.Ticks;
            Probe = data.NewState != 0;
            ProbePrev = data.OldState != 0;
        }

        public uint Ticks { get; }

        public bool Probe { get; }

        public bool ProbePrev { get; }
    }

    public class SweepCompleteReceivedEventArgs : MessageReceivedEventArgs
    {
        internal SweepCompleteReceivedEventArgs(DeskMessages.SweepComplete data)
            : base(MessageType.SweepComplete)
        {
            FinalFreq = data.FinalFreq;
            SweepTime = data.SweepTime;
        }

        public int FinalFreq { get; }

        public uint SweepTime { get; }
    }

    public class LedReceivedEventArgs : MessageReceivedEventArgs
    {
        internal LedReceivedEventArgs(DeskMessages.Led data)
            : base(MessageType.Led)
        {
            State = data.LedState != 0;
        }

        public bool State { get; }
    }

    public enum SweepDirection
    {
        Off,
        Increase,
        Decrease
    }

    public class SweepReceivedEventArgs : MessageReceivedEventArgs
    {
        internal SweepReceivedEventArgs(DeskMessages.Sweep data)
            : base(MessageType.Sweep)
        {
            if (data.Direction == 0)
                Direction = SweepDirection.Off;
            else if (data.Direction == 1)
                Direction = SweepDirection.Increase;
            else
                Direction = SweepDirection.Decrease;
        }

        public SweepDirection Direction { get; }
    }

    public class VersionReceivedEventArgs : MessageReceivedEventArgs
    {
        internal VersionReceivedEventArgs(DeskMessages.Version data)
            : base(MessageType.Version)
        {
            Version = $"{data.Major}.{data.Minor}";
        }

        public string Version { get; }
    }

    public enum FlashOp
    {
        Unknown,
        Erase,
        Write,
        Read
    }

    public enum FlashOpStatus
    {
        Unknown,
        Ok,
        DataSizeError
    }

    public class FlashOpStatusEventArgs : MessageReceivedEventArgs
    {
        internal FlashOpStatusEventArgs(DeskMessages.FlashOpStatus data)
            : base(MessageType.FlashOpStatus)
        {
            Operation = getOperation(data.Operation);
            Status = getStatus(data.Status);
        }

        public FlashOp Operation { get; }

        public FlashOpStatus Status { get; }

        private static FlashOp getOperation(byte op)
        {
            switch (op)
            {
                case (byte)MessageType.FlashErase: return FlashOp.Erase;
                case (byte)MessageType.FlashWrite: return FlashOp.Write;
                case (byte)MessageType.FlashRead: return FlashOp.Read;
                default: return FlashOp.Unknown;
            }
        }

        private static FlashOpStatus getStatus(byte status)
        {
            switch (status)
            {
                case 1: return FlashOpStatus.Ok;
                case 2: return FlashOpStatus.DataSizeError;
                default: return FlashOpStatus.Unknown;
            }
        }
    }

    public class FlashDataEventArgs : MessageReceivedEventArgs
    {
        internal FlashDataEventArgs(DeskMessages.FlashDataHeader header, byte[] data)
            : base(MessageType.FlashData)
        {
            Offset = header.WordsOffset << 2;
            Data = data;
        }

        public int Offset { get; }

        public byte[] Data { get; }
    }

    public class GetTimeEventArgs : MessageReceivedEventArgs
    {
        internal GetTimeEventArgs(DeskMessages.TimeMessage data)
            : base(MessageType.GetTime)
        {
            Time = data.Time;
        }

        public uint Time { get; }
    }

    public class ResetTimerEventArgs : MessageReceivedEventArgs
    {
        internal ResetTimerEventArgs(DeskMessages.TimeMessage data)
            : base(MessageType.ResetTimer)
        {
            ResetTime = data.Time;
        }

        public uint ResetTime { get; }
    }

    public class PingEventArgs : MessageReceivedEventArgs
    {
        internal PingEventArgs(DeskMessages.PingMessage data)
            : base(MessageType.Ping)
        {
            UserData = data.UserData;
        }

        public byte UserData { get; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.FtdiDesk\Source\DeskFlash.cs


using System;
using System.Diagnostics;

namespace Updk7.Tests.FtdiDesk
{
    internal class DeskFlash
    {
        private const int TIMEOUT_MS = 200;
        private const int MAX_PACKET_DATA = 248;
        private const int MAX_FLASH_OFFSET = 1020;

        private DeskSerial _deskSerial;

        public DeskFlash(DeskSerial deskSerial)
        {
            _deskSerial = deskSerial;
        }

        public void WriteCalibrationInfo(DeskCalibrationInfo info)
        {
            var eraseStatus = erase();
            if (eraseStatus == null)
                throw new TimeoutException("Flash erase timeout");
            if (eraseStatus != FlashOpStatus.Ok)
                throw new InvalidOperationException("Flash erase error");

            var buffer = DeskCalibrationInfo.Serialize(info);
            var writeStatus = write(buffer, 0);
            if (writeStatus == null)
                throw new TimeoutException("Flash write timeout");
            if (writeStatus != FlashOpStatus.Ok)
                throw new InvalidOperationException("Flash write error");
        }

        public DeskCalibrationInfo ReadCalibrationInfo()
        {
            var size = DeskCalibrationInfo.GetBinarySize();
            var data = read(0, size);
            if (data == null)
                throw new TimeoutException("Timeout while reading flash");

            return DeskCalibrationInfo.Deserialize(data);
        }

        private FlashOpStatus? erase()
        {
            var buffer = new byte[] { 0x55, 1, (byte)MessageType.FlashErase };
            var requestResult = _deskSerial.SendSync(buffer, MessageType.FlashOpStatus, TIMEOUT_MS);
            if (requestResult == null)
                throw new TimeoutException("Timeout while flash erase");

            return (requestResult as FlashOpStatusEventArgs).Status;
        }

        private FlashOpStatus? write(byte[] data, int flashOffset)
        {
            Debug.Assert(data != null && data.Length > 0 && data.Length <= MAX_PACKET_DATA && data.Length % 4 == 0);
            Debug.Assert(flashOffset >= 0 && flashOffset % 4 == 0 && flashOffset <= MAX_FLASH_OFFSET);

            // Смещение задаётся в словах, а не байтах!
            var buffer = new byte[4 + data.Length];
            buffer[0] = 0x55;
            buffer[1] = (byte)(buffer.Length - 2);
            buffer[2] = (byte)MessageType.FlashWrite;
            buffer[3] = (byte)(flashOffset >> 2);
            Array.Copy(data, 0, buffer, 4, data.Length);

            var requestResult = _deskSerial.SendSync(buffer, MessageType.FlashOpStatus, TIMEOUT_MS);
            if (requestResult == null)
                throw new TimeoutException("Timeout while writing flash");

            return (requestResult as FlashOpStatusEventArgs).Status;
        }

        private byte[] read(int flashOffset, int dataCount)
        {
            Debug.Assert(dataCount > 0 && dataCount % 4 == 0 && dataCount <= MAX_PACKET_DATA);
            Debug.Assert(flashOffset >= 0 && flashOffset % 4 == 0 && flashOffset <= MAX_FLASH_OFFSET);

            // Смещение и количество данных задаётся в словах, а не байтах!
            var buffer = new byte[]
            {
                0x55,
                3,
                (byte)MessageType.FlashRead,
                (byte)(flashOffset >> 2),
                (byte)(dataCount >> 2)
            };

            var requestResult = _deskSerial.SendSync(buffer, MessageType.FlashData, TIMEOUT_MS);
            if (requestResult == null)
                throw new TimeoutException("Timeout while reading flash");

            return (requestResult as FlashDataEventArgs).Data;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.FtdiDesk\Source\DeskLink.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;

namespace Updk7.Tests.FtdiDesk
{
    public class DeskLink : IDisposable
    {
        private DeskSerial _deskSerial = new DeskSerial();
        private DeskFlash _deskFlash;
        private SynchronizationContext _syncContext;
        private AdcConverter _adcConverter;

        public DeskLink()
        {
            _deskFlash = new DeskFlash(_deskSerial);
            _deskSerial.MessageReceived += onDeskSerialMessageReceived;

            _syncContext = SynchronizationContext.Current;
            Debug.Assert(_syncContext != null);
        }

        public FtdiInfo FtdiInfo => _deskSerial.FtdiInfo;

        public event EventHandler<MessageReceivedEventArgs> MessageReceived;

        private DeskCalibrationInfo _calibrationInfo = null;

        public DeskCalibrationInfo CalibrationInfo
        {
            get { return _calibrationInfo; }
            private set
            {
                if (_calibrationInfo != value)
                {
                    _calibrationInfo = value;
                    _adcConverter = AdcConverter.Create(_calibrationInfo);
                }
            }
        }

        public event EventHandler IsConnectedChanged;

        private bool _isConnected = false;

        public bool IsConnected
        {
            get { return _isConnected; }
            set
            {
                if (_isConnected != value)
                {
                    _isConnected = value;
                    IsConnectedChanged?.Invoke(this, EventArgs.Empty);
                }
            }
        }

        public void Open(FtdiInfo deviceInfo)
        {
            if (deviceInfo == null)
                throw new ArgumentNullException("deviceInfo");

            if (IsConnected)
                return;

            _deskSerial.Open(deviceInfo);
            CalibrationInfo = _deskFlash.ReadCalibrationInfo();
            IsConnected = true;
        }

        public void Close()
        {
            if (!IsConnected)
                return;

            _deskSerial.Close();
            IsConnected = false;
        }

        public void Dispose()
        {
            Close();
        }

        public static IEnumerable<FtdiInfo> GetDevices()
        {
            return Ft232R.GetDevices();
        }

        #region Desk api

        public void SetLed(bool led)
        {
            var buffer = new byte[] { 0x55, 2, (byte)MessageType.Led, (byte)(led ? 1 : 0) };
            _deskSerial.Send(buffer, MessageType.Led);
        }

        public void SetSweep(SweepDirection direction)
        {
            var buffer = new byte[] { 0x55, 2, (byte)MessageType.Sweep, (byte)direction };
            _deskSerial.Send(buffer, MessageType.Sweep);
        }

        public void GetTime()
        {
            var buffer = new byte[] { 0x55, 1, (byte)MessageType.GetTime };
            _deskSerial.Send(buffer, MessageType.GetTime);
        }

        public void ResetTimer()
        {
            var buffer = new byte[] { 0x55, 1, (byte)MessageType.ResetTimer };
            _deskSerial.Send(buffer, MessageType.ResetTimer);
        }

        public void Ping(byte userData)
        {
            var buffer = new byte[] { 0x55, 2, (byte)MessageType.Ping, userData };
            _deskSerial.Send(buffer, MessageType.Ping);
        }

        public void GetFirmwareVersion()
        {
            var buffer = new byte[] { 0x55, 1, (byte)MessageType.Version };
            _deskSerial.Send(buffer, MessageType.Version);
        }

        public void WriteCalibrationInfo(DeskCalibrationInfo info)
        {
            _deskFlash.WriteCalibrationInfo(info);
            CalibrationInfo = info;
        }

        #endregion

        private void onDeskSerialMessageReceived(object sender, MessageReceivedEventArgs e)
        {
            if (IsConnected)
            {
                convertAdcData(e);
                _syncContext.Post(_ => MessageReceived?.Invoke(this, e), null);
            }
        }
        
        private void convertAdcData(MessageReceivedEventArgs args)
        {
            if (args.Type != MessageType.Adc || _adcConverter == null)
                return;

            var adc = args as AdcReceivedEventArgs;
            adc.X = _adcConverter.ConvertX(adc.XRaw);
            adc.Y = _adcConverter.ConvertY(adc.YRaw);
            adc.SkinResistance = _adcConverter.ConvertSR(adc.SR1, adc.SR2);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.FtdiDesk\Source\DeskLinkMonitor.cs


using System;
using System.Diagnostics;
using System.Linq;
using System.Threading;

namespace Updk7.Tests.FtdiDesk
{
    /// <summary>
    /// Монитор подключения пульта 
    /// </summary>
    /// <remarks>
    /// Управляет открытием и азкрытием устройства, руками делать ничего не нужно
    /// </remarks>
    public class DeskLinkMonitor : IDisposable
    {
        private enum MonitorStates
        {
            Seek,
            Connecting,
            Poll,
            Disconnecting,
            Stop
        }

        private const int POLL_PERIOD = 1000;

        private MonitorStates _state = MonitorStates.Seek;
        private SynchronizationContext _syncContext;
        private Timer _timer;
        private object _syncRoot = new object();
        private volatile int _messageCounter = 0;
        private volatile int _prevMessageCounter = -1;

        public DeskLinkMonitor(DeskLink deskLink)
        {
            Debug.Assert(deskLink != null);
            Debug.Assert(!deskLink.IsConnected);

            Desk = deskLink;
            Desk.IsConnectedChanged += onDeskIsConnectedChanged;
            Desk.MessageReceived += onDeskMessageReceived;
            
            _timer = new Timer(onTimerTick, null, Timeout.Infinite, POLL_PERIOD);
            _syncContext = SynchronizationContext.Current;

            Debug.Assert(_syncContext != null);
        }

        public event EventHandler IsConnectedChanged;

        public DeskLink Desk { get; }

        private bool _isConnected;

        public bool IsConnected
        {
            get => _isConnected;
            set
            {
                if (value != _isConnected)
                {
                    _isConnected = value;
                    IsConnectedChanged?.Invoke(this, EventArgs.Empty);
                }
            }
        }

        public void Start()
        {
            Debug.Assert(_timer != null);

            if (!IsConnected)
                switchState(MonitorStates.Seek);
        }

        public void Stop()
        {
            switchState(MonitorStates.Disconnecting);
            Desk.Close();
            switchState(MonitorStates.Stop);
        }

        public void Dispose()
        {
            if (_timer != null)
            {
                lock (_syncRoot)
                {
                    _timer.Change(Timeout.Infinite, Timeout.Infinite);
                    _timer.Dispose();
                    _timer = null;
                    _syncContext = null;
                }
            }
        }

        private void switchState(MonitorStates state)
        {
            lock (_syncRoot)
            {
                _state = state;
            }

            if (_state == MonitorStates.Seek)
            {
                _timer.Change(POLL_PERIOD, POLL_PERIOD);
                if (Desk.IsConnected)
                    switchState(MonitorStates.Poll);
            }
            else if (_state == MonitorStates.Poll)
            {
                _messageCounter = 0;
                _prevMessageCounter = -1;
            }
            else if (_state == MonitorStates.Stop)
            {
                _timer.Change(Timeout.Infinite, Timeout.Infinite);
            }
        }

        private void onDeskIsConnectedChanged(object sender, EventArgs e)
        {
            IsConnected = Desk.IsConnected;
        }

        private void onDeskMessageReceived(object sender, MessageReceivedEventArgs e)
        {
            ++_messageCounter;
        }

        private void onTimerTick(object stateInfo)
        {
            if (_syncContext == null || _timer == null || _state == MonitorStates.Stop)
                return;

            if (_state == MonitorStates.Seek)
            {
                var desk = getFirstDesk();
                if (desk != null)
                {
                    // Появление состояние Connecting (да и вообще вся муть с состояниями)
                    // связано с желанием (не моим) работать и на старом железе, где время
                    // октрытия устройства иногда бывает значительным (т.е. время пока ОС
                    // подтянет драйвера ftdi)
                    switchState(MonitorStates.Connecting);
                    _syncContext.Post(_ => connectDesk(desk), null);
                }
            }
            else if (_state == MonitorStates.Poll)
            {
                // Пульт постоянно отправляет сообщения, так что отсутствие
                // сообщений за время наблюдения - хороший признак отключения устройства.
                // С другой стороны у пульта есть функция ping, возможно при её 
                // использовании реализация монитора была бы проще, но переделывать не буду
                if (_messageCounter == _prevMessageCounter)
                {
                    switchState(MonitorStates.Disconnecting);
                    _syncContext.Post(_ => 
                        {
                            Stop();
                            switchState(MonitorStates.Seek);
                        }, null);
                }

                _prevMessageCounter = _messageCounter;
            }
        }

        private void connectDesk(FtdiInfo info)
        {
            if (info == null)
                return;

            try
            {
                Desk.Open(info);
                switchState(MonitorStates.Poll);
            }
            catch (Exception)
            {
                Desk.Close();
                switchState(MonitorStates.Seek);
            }
        }

        private FtdiInfo getFirstDesk()
        {
            try
            {
                return DeskLink.GetDevices().FirstOrDefault();
            }
            catch (Exception)
            {
                return null;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.FtdiDesk\Source\DeskMessages.cs


using System;
using System.Runtime.InteropServices;

namespace Updk7.Tests.FtdiDesk
{
    internal static class DeskMessages
    {
        public const int MESSAGE_TYPE_SIZE = 1;

        [StructLayout(LayoutKind.Sequential, Pack = 1)]
        public struct Buttons
        {
            public byte Type;
            public uint Ticks;
            public byte OldState;
            public byte NewState;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 1)]
        public struct Adc
        {
            public byte Type;
            public ushort RotaryX;
            public ushort RotaryY;
            public ushort SR1;
            public ushort SR2;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 1)]
        public struct Probe
        {
            public byte Type;
            public uint Ticks;
            public byte OldState;
            public byte NewState;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 1)]
        public struct SweepComplete
        {
            public byte Type;
            public uint SweepTime;
            public byte FinalFreq;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 1)]
        public struct Led
        {
            public byte Type;
            public byte LedState;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 1)]
        public struct Sweep
        {
            public byte Type;
            public byte Direction;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 1)]
        public struct Version
        {
            public byte Type;
            public byte Major;
            public byte Minor;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 1)]
        public struct FlashOpStatus
        {
            public byte Type;
            public byte Operation;
            public byte Status;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 1)]
        public struct FlashDataHeader
        {
            public byte Type;
            public byte DataLength;
            public byte WordsOffset;
            public byte Reserved0;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 1)]
        public struct TimeMessage
        {
            public byte Type;
            public uint Time;
        }

        [StructLayout(LayoutKind.Sequential, Pack = 1)]
        public struct PingMessage
        {
            public byte Type;
            public byte UserData;
        }

        public static bool IsValidMessageType(MessageType message)
        {
            return Enum.IsDefined(typeof(MessageType), message);
        }

        public static unsafe int GetHeaderSize(MessageType message)
        {
            return message == MessageType.FlashData
                ? sizeof(FlashDataHeader)
                : 1;
        }

        public static unsafe int GetMessageSize(byte* pBuffer)
        {
            var message = (MessageType)pBuffer[0];
            switch (message)
            {
                case MessageType.Buttons: return sizeof(Buttons);
                case MessageType.Adc: return sizeof(Adc);
                case MessageType.Probe: return sizeof(Probe);
                case MessageType.SweepComplete: return sizeof(SweepComplete);
                case MessageType.Led: return sizeof(Led);
                case MessageType.Sweep: return sizeof(Sweep);
                case MessageType.Version: return sizeof(Version);
                case MessageType.FlashOpStatus: return sizeof(FlashOpStatus);
                case MessageType.ResetTimer: return sizeof(TimeMessage);
                case MessageType.GetTime: return sizeof(TimeMessage);
                case MessageType.Ping: return sizeof(PingMessage);
                case MessageType.FlashData:
                    var header = *(FlashDataHeader*)pBuffer;
                    return sizeof(FlashDataHeader) + header.DataLength;
                default: return -1;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.FtdiDesk\Source\DeskSerial.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;

namespace Updk7.Tests.FtdiDesk
{
    internal class DeskSerial : IDisposable
    {
        private class TmtMessage
        {
            public TmtMessage(byte[] data, MessageType responseType)
            {
                Data = data;
                ResponseType = responseType;
            }
            public byte[] Data { get; }

            public MessageType ResponseType { get; }
        }

        internal static readonly string MANUFACTURER = "Neurocom";
        internal static readonly string DESCRIPTION = "Neurocom Updk FT-Link";

        private const int MAX_PACKET_SIZE = 255;
        private const int POLL_MS = 15;

        private byte[] _rxBuffer = new byte[MAX_PACKET_SIZE];
        private int _rxLength = 0;
        private int _packetSize = 0;
        private int _headerSize = DeskMessages.MESSAGE_TYPE_SIZE;
        private Ft232R _ft232R = new Ft232R();

        private Queue<TmtMessage> _tmtMessages = new Queue<TmtMessage>();
        private object _syncRoot = new object();
        private CancellationTokenSource _cancellationSource;
        private Task _pollTask;

        public DeskSerial()
        {
        }

        public FtdiInfo FtdiInfo { get; private set; }

        /// <summary>
        /// Получено сообщение пульта. Событие вызывается в контексте потока опроса,
        /// не в контексте GUI
        /// </summary>
        public event EventHandler<MessageReceivedEventArgs> MessageReceived;

        public event EventHandler<EventArgs> IsOpenChanged;

        private bool _isOpen = false;

        public bool IsOpen
        {
            get { return _isOpen; }
            set
            {
                if (value != _isOpen)
                {
                    _isOpen = value;
                    IsOpenChanged?.Invoke(this, EventArgs.Empty);
                }
            }
        }

        /// <summary>
        /// Возвращаеть список подключенных устройств
        /// </summary>
        public static IEnumerable<FtdiInfo> GetDevices()
        {
            return Ft232R.GetDevices().Where(info =>
                info.Manufacturer == MANUFACTURER && info.Description == DESCRIPTION);
        }

        /// <summary>
        /// Закрытие устройства и освобождение ресурсов. Возможно повторное открытие 
        /// устройства методом <see cref="Open(FtdiInfo)"/>
        /// </summary>
        public void Dispose()
        {
            Close();
        }

        /// <summary>
        /// Открытие устройства
        /// </summary>
        /// <remarks>
        /// Дескриптор устройства получаем из <see cref="GetDevices"/>
        /// </remarks>
        public void Open(FtdiInfo deviceInfo)
        {
            if (deviceInfo == null)
                throw new ArgumentNullException("deviceInfo");

            if (_isOpen)
                return;

            resetRcv();
            _tmtMessages.Clear();
            _ft232R.Open(deviceInfo);

            _cancellationSource = new CancellationTokenSource();
            _pollTask = Task.Run(() => dataPoll(_cancellationSource.Token),
                _cancellationSource.Token);

            FtdiInfo = deviceInfo;
            IsOpen = true;
        }

        /// <summary>
        /// Закрытие устройства и освобождение ресурсов. Возможно повторное открытие 
        /// устройства методом <see cref="Open(FtdiInfo)"/>
        /// </summary>
        public void Close()
        {
            if (!_isOpen)
                return;

            _cancellationSource.Cancel();
            _pollTask.Wait(2 * POLL_MS);
            _ft232R.Close();

            FtdiInfo = null;
            IsOpen = false;
        }

        /// <summary>
        /// Асинхронная отправка данных устройству
        /// </summary>
        /// <remarks>
        /// Тип ответного сообщения нужен для выстраивания последовательности
        /// отправки сообщений, чтобы не перегружать микроконтроллер. После обработки 
        /// сообщения микроконтроллером и отправки им ответного сообщения (подтверждения), 
        /// микроконтроллеру отправляется следующее сообщение из очереди. Таким образом
        /// микроконтроллер обрабатывает точно по одному сообщению
        /// </remarks>
        /// <param name="data">Отправляемые данные</param>
        /// <param name="responseType">Тип ответного сообщения</param>
        public void Send(byte[] data, MessageType responseType)
        {
            if (!_isOpen)
                throw new InvalidOperationException("Device closed");

            lock (_syncRoot)
            {
                _tmtMessages.Enqueue(new TmtMessage(data, responseType));

                // Если в очереди только одно сообщение (только что добавленное),
                // инициируем отправку. Если сообщений больше, они будут отправляться
                // по мере поступления ответов от микроконтроллера
                if (_tmtMessages.Count == 1)
                {
                    try
                    {
                        _ft232R.Write(data, 0, (uint)data.Length);
                    }
                    catch (Exception)
                    {
                    }
                }
            }
        }

        /// <summary>
        /// Синхронная отправка данных устройству
        /// </summary>
        /// <returns>Задача ожидания ответа. Рузультат задачи null при таймауте</returns>
        public MessageReceivedEventArgs SendSync(byte[] data, MessageType responseType, 
            int timeout = 50)
        {
            // Не менять порядок вызовов! В WaitMessage подписываемся на событие приема,
            // это нужно сделать до отправки сообщения, чтобы не пропустить ответ
            var waiter = CreateResponseWaiter(responseType, timeout);
            Send(data, responseType);
            return waiter();
        }

        /// <summary>
        /// Возвращает задачу ожидания получения заданного типа сообщения
        /// </summary>
        /// <remarks>
        /// Метод используется для перевода асинхронного взаимодействия в синхронное. 
        /// Предполагаемое использование: создаем задачу ожидания, отправляем сообщение,
        /// блокируемся на задаче ожидания для получения ответа. Задачу необходимо
        /// создать перед отправкой сообщения микроконтроллеру для подписки на событие
        /// гарантированно раньше получения ответа от микроконтроллера
        /// </remarks>
        /// <returns>Задача ожиданияю. Результат задачи null при таймауте</returns>
        public Func<MessageReceivedEventArgs> CreateResponseWaiter(MessageType message, int timeout = 50)
        {
            MessageReceivedEventArgs result = null;
            var waitEvent = new AutoResetEvent(false);

            EventHandler<MessageReceivedEventArgs> handler = (o, e) =>
            {
                if (e.Type == message)
                {
                    result = e;
                    waitEvent.Set();
                }
            };

            MessageReceived += handler;
            return () => 
            {
                waitEvent.WaitOne(timeout);
                waitEvent.Dispose();
                MessageReceived -= handler;
                return result;
            };
        }

        /// <summary>
        /// Прием данных по опросу
        /// </summary>
        /// <remarks>
        /// Это оказалось быстрее использования SerialPort на слабом железе. С 
        /// SerialPort в тесте РДО движущийся маркер проскакивал точку остановки 
        /// после нажатия на кнопку. На нормальных компьютерах такой проблемы нет,
        /// но многие психоолги до сих пор используют старое железо. Поэтому пришлось
        /// возвращаться к опросу, как и при работе со старым пультом
        /// </remarks> 
        private unsafe void dataPoll(CancellationToken ct)
        {
            while (!ct.IsCancellationRequested)
            {
                try
                {
                    // Не очень понятно, но на старых компах эта строчка вызывает проблемы
                    // (Slave не видит пульт на старых компах)...
                    //Task.Delay(POLL_MS, ct).Wait(ct);     

                    // ... а эта нет, хотя смысл у нее тот же самый
                    Thread.Sleep(POLL_MS);                  

                    // Дело, наверное, не в этих строчках, а в каких-то таймаутах внутри Slave,
                    // но до конца с этим разобраться не удалось. Причем, никаких
                    // проблем в Updk7.Monitor с пультом нет и на старых компах

                    while (true)
                    {
                        var availableBytes = _ft232R.GetBytesToRead();
                        if (availableBytes == 0)
                            break;

                        fixed (byte* pBuffer = _rxBuffer)
                        {
                            // Читаем заголовок
                            if (_rxLength < _headerSize)
                                readPacketHeader(pBuffer, availableBytes);

                            // Читаем данные пакета
                            if (_rxLength >= _headerSize)
                            {
                                if (readPacketData(pBuffer, availableBytes))
                                {
                                    // Пакет прочтен полностью
                                    var eventArgs = createMessageReceivedEventArgs(pBuffer);
                                    if (eventArgs != null)
                                    {
                                        MessageReceived?.Invoke(this, eventArgs);
                                        tmtNextMessage(eventArgs);
                                    }
                                    
                                    resetRcv();
                                }
                            }
                        }
                    }
                }
                catch (TaskCanceledException)
                {
                    return;
                }
                catch
                {
                    resetRcv();
                }
            }
        }

        private void resetRcv()
        {
            _packetSize = 0;
            _rxLength = 0;
            _headerSize = DeskMessages.MESSAGE_TYPE_SIZE;
        }

        private int readRemainBytes(int remainBytes, uint bytesAvailable)
        {
            var readCount = Math.Min(remainBytes, bytesAvailable);
            return (int)_ft232R.Read(_rxBuffer, (uint)_rxLength, (uint)readCount);
        }

        private unsafe void readPacketHeader(byte* pBuffer, uint availableBytes)
        {
            _rxLength += readRemainBytes(_headerSize - _rxLength, availableBytes);
            if (_rxLength != _headerSize)
                return;

            var messageType = (MessageType)(*pBuffer);
            if (!DeskMessages.IsValidMessageType(messageType))
                resetRcv();
            else
            {
                _headerSize = DeskMessages.GetHeaderSize(messageType);
                if (_headerSize == _rxLength)
                {
                    _packetSize = DeskMessages.GetMessageSize(pBuffer);
                    if (_packetSize <= 0)
                        resetRcv();
                }
            }
        }

        private unsafe bool readPacketData(byte* pBuffer, uint bytesAvailable)
        {
            _rxLength += readRemainBytes(_packetSize - _rxLength, bytesAvailable);
            return _rxLength == _packetSize;
        }

        private void tmtNextMessage(MessageReceivedEventArgs e)
        {
            if (!_isOpen)
                return;

            lock (_syncRoot)
            {
                if (_tmtMessages.Count == 0)
                    return;

                // Ждем овтет на ранее отправленное сообщение, после чего
                // отправляем следующее в очереди сообщение
                if (_tmtMessages.Peek().ResponseType == e.Type)
                {
                    _tmtMessages.Dequeue();
                    if (_tmtMessages.Count != 0)
                    {
                        var message = _tmtMessages.Peek();
                        try
                        {
                            _ft232R.Write(message.Data, 0, (uint)message.Data.Length);
                        }
                        catch (Exception)
                        {
                            _tmtMessages.Clear();
                        }
                    }
                }
            }
        }

        private unsafe MessageReceivedEventArgs createMessageReceivedEventArgs(byte* pBuffer)
        {
            var messageType = (MessageType)(*pBuffer);
            switch (messageType)
            {
                case MessageType.Buttons:
                    return new ButtonsReceivedEventArgs(*(DeskMessages.Buttons*)pBuffer);
                case MessageType.Adc:
                    return new AdcReceivedEventArgs(*(DeskMessages.Adc*)pBuffer);
                case MessageType.Probe:
                    return new ProbeReceivedEventArgs(*(DeskMessages.Probe*)pBuffer);
                case MessageType.SweepComplete:
                    return new SweepCompleteReceivedEventArgs(*(DeskMessages.SweepComplete*)pBuffer);
                case MessageType.Led:
                    return new LedReceivedEventArgs(*(DeskMessages.Led*)pBuffer);
                case MessageType.Sweep:
                    return new SweepReceivedEventArgs(*(DeskMessages.Sweep*)pBuffer);
                case MessageType.Version:
                    return new VersionReceivedEventArgs(*(DeskMessages.Version*)pBuffer);
                case MessageType.FlashOpStatus:
                    return new FlashOpStatusEventArgs(*(DeskMessages.FlashOpStatus*)pBuffer);
                case MessageType.FlashData:
                    var header = *(DeskMessages.FlashDataHeader*)pBuffer;
                    var data = new byte[header.DataLength];
                    Marshal.Copy((IntPtr)(&pBuffer[sizeof(DeskMessages.FlashDataHeader)]), data, 0, header.DataLength);
                    return new FlashDataEventArgs(header, data);
                case MessageType.Ping:
                    return new PingEventArgs(*(DeskMessages.PingMessage*)pBuffer);
                case MessageType.GetTime:
                    return new GetTimeEventArgs(*(DeskMessages.TimeMessage*)pBuffer);
                case MessageType.ResetTimer:
                    return new ResetTimerEventArgs(*(DeskMessages.TimeMessage*)pBuffer);
                default:
                    Debug.WriteLine($"[ERR] Unknown packet: type {messageType}");
                    return null;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.FtdiDesk\Source\Ft232R.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace Updk7.Tests.FtdiDesk
{
    /// <summary>
    /// Обертка над библиотекой ftd232. Поиск устройств, запись и чтение 
    /// в последовательный порт
    /// </summary>
    public class Ft232R : IDisposable
    {
        #region Native methods

        private const int SERIAL_NUMBER_LENGTH = 16;
        private const int MANUFACTURER_LENGTH = 64;
        private const int DESCRIPTION_LENGTH = 64;

        private const int LATENCY_MIN = 5;

        private static byte[] _bufferManufacturer = new byte[MANUFACTURER_LENGTH];
        private static byte[] _bufferManufacturerId = new byte[MANUFACTURER_LENGTH];
        private static byte[] _bufferSerialNumber = new byte[SERIAL_NUMBER_LENGTH];
        private static byte[] _bufferDescription = new byte[DESCRIPTION_LENGTH];

        private enum FT_STATUS : uint
        {
            FT_OK = 0,
            FT_INVALID_HANDLE,
            FT_DEVICE_NOT_FOUND,
            FT_DEVICE_NOT_OPENED,
            FT_IO_ERROR,
            FT_INSUFFICIENT_RESOURCES,
            FT_INVALID_PARAMETER,
            FT_INVALID_BAUD_RATE,
            FT_DEVICE_NOT_OPENED_FOR_ERASE,
            FT_DEVICE_NOT_OPENED_FOR_WRITE,
            FT_FAILED_TO_WRITE_DEVICE,
            FT_EEPROM_READ_FAILED,
            FT_EEPROM_WRITE_FAILED,
            FT_EEPROM_ERASE_FAILED,
            FT_EEPROM_NOT_PRESENT,
            FT_EEPROM_NOT_PROGRAMMED,
            FT_INVALID_ARGS,
            FT_OTHER_ERROR
        };

        internal enum FT_DEVICE : uint
        {
            FT_232BM = 0,
            FT_232AM = 1,
            FT_100AX = 2,
            FT_UNKNOWN = 3,
            FT_2232C = 4,
            FT_232R = 5,
            FT_2232H = 6,
            FT_4232H = 7,
            FT_232H = 8,
            FT_X_SERIES = 9
        }

        internal enum FT_WORD_LENGTH : byte
        {
            FT_BITS_8 = 8,
            FT_BITS_7 = 7
        }

        internal enum FT_STOP_BITS : byte
        {
            FT_STOP_BITS_1 = 0,
            FT_STOP_BITS_2 = 2
        }

        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
        internal struct FT_DEVICE_LIST_INFO_NODE
        {
            public uint Flags;
            public uint Type;
            public uint ID;
            public uint LocId;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = SERIAL_NUMBER_LENGTH)]
            public string SerialNumber;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = DESCRIPTION_LENGTH)]
            public string Description;
            public ulong ftHandle;

            public bool IsOpen => (Flags & 0x1) != 0;
        }

        // Pack = 4 иначе не работает. Добавляет байт выравнивания после SerNumEnable
        // и в конце структуры, общий размер структуры 16 байт
        [StructLayout(LayoutKind.Sequential, Pack = 4)]
        internal struct FT_EEPROM_HEADER
        {
            public FT_DEVICE deviceType;       // FTxxxx device type to be programmed
            public ushort VendorId;            // 0x0403
            public ushort ProductId;           // 0x6001
            public byte SerNumEnable;          // non-zero if serial number to be used
            public ushort MaxPower;            // 0 < MaxPower <= 500
            public byte SelfPowered;           // 0 = bus powered, 1 = self powered
            public byte RemoteWakeup;          // 0 = not capable, 1 = capable
            public byte PullDownEnable;        // non-zero if pull down in suspend enabled
        }

        [StructLayout(LayoutKind.Sequential, Pack = 4)]
        internal struct FT_EEPROM_232R
        {
            public FT_EEPROM_HEADER common;    // common elements for all device EEPROMs
            public byte IsHighCurrent;         // non-zero if interface is high current
            public byte UseExtOsc;             // Use External Oscillator
            public byte InvertTXD;             // non-zero if invert TXD
            public byte InvertRXD;             // non-zero if invert RXD
            public byte InvertRTS;             // non-zero if invert RTS
            public byte InvertCTS;             // non-zero if invert CTS
            public byte InvertDTR;             // non-zero if invert DTR
            public byte InvertDSR;             // non-zero if invert DSR
            public byte InvertDCD;             // non-zero if invert DCD
            public byte InvertRI;              // non-zero if invert RI
            public byte Cbus0;                 // Cbus Mux control
            public byte Cbus1;                 // Cbus Mux control
            public byte Cbus2;                 // Cbus Mux control
            public byte Cbus3;                 // Cbus Mux control
            public byte Cbus4;                 // Cbus Mux control
            public byte DriverType;
        }

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_CreateDeviceInfoList(ref uint lpdwNumDevs);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_GetDeviceInfoList(void* pDest, ref uint lpdwNumDevs);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_Open(uint deviceIndex, ref void* ftHandle);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_Close(void* ftHandle);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_EEPROM_Read(void* ftHandle, void* eepromData,
            uint eepromDataSize, byte* Manufacturer, byte* ManufacturerId,
            byte* Description, byte* SerialNumber);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_EEPROM_Program(void* ftHandle, void* eepromData,
            uint eepromDataSize, byte* Manufacturer, byte* ManufacturerId,
            byte* Description, byte* SerialNumber);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_GetComPortNumber(void* ftHandle, ref int portNumber);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_SetLatencyTimer(void* ftHandle, byte timer);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_SetBaudRate(void* ftHandle, uint baudRate);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_SetDataCharacteristics(void* ftHandle,
            byte wordLength, byte stopBits, byte parity);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_SetTimeouts(void* ftHandle, uint readTimeout, 
            uint writeTimeout);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_SetDtr(void* ftHandle);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_Read(void* ftHandle, byte* buffer, 
            uint bytesToRead, ref uint bytesReturned);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_Write(void* ftHandle, byte* lpBuffer,
            uint bytesToWrite, ref uint bytesWritten);

        [DllImport("FTD2XX.dll")]
        private static extern unsafe FT_STATUS FT_GetQueueStatus(void* ftHandle, 
            ref uint bytesToRead);

        #endregion

        public enum UartParity
        {
            None = 0,
            Odd = 1,
            Even = 2,
        }

        private unsafe void* _ftHandle = null;

        public Ft232R()
        {
        }

        public uint BaudRate { get; set; } = 115200;

        public uint ReadTimeout { get; set; } = 0;

        public uint WriteTimeout { get; set; } = 50;

        public UartParity Parity { get; set; } = UartParity.None;

        public unsafe bool IsOpen => _ftHandle != null;
        
        /// <summary>
        /// Открытие устройства. При задании нулевых таймаутов чтение и запись 
        /// будут неблокирующими
        /// </summary>
        public unsafe void Open(FtdiInfo info)
        {
            if (info == null)
                throw new ArgumentNullException("deviceInfo");

            if (_ftHandle != null)
                return;

            var status = FT_Open(info.DeviceIndex, ref _ftHandle);
            if (status != FT_STATUS.FT_OK)
                throwInvalidStatus("Open failed", status);

            status = FT_SetLatencyTimer(_ftHandle, LATENCY_MIN);
            if (status != FT_STATUS.FT_OK)
                throwInvalidStatus("Set latency failed", status);

            status = FT_SetBaudRate(_ftHandle, BaudRate);
            if (status != FT_STATUS.FT_OK)
                throwInvalidStatus("Set baud rate failed", status);

            status = FT_SetDataCharacteristics(_ftHandle, (byte)FT_WORD_LENGTH.FT_BITS_8,
                (byte)FT_STOP_BITS.FT_STOP_BITS_1, (byte)Parity);
            if (status != FT_STATUS.FT_OK)
                throwInvalidStatus("Set data characteristics failed", status);

            status = FT_SetTimeouts(_ftHandle, ReadTimeout, WriteTimeout);
            if (status != FT_STATUS.FT_OK)
                throwInvalidStatus("Set timeouts failed", status);

            status = FT_SetDtr(_ftHandle);
            if (status != FT_STATUS.FT_OK)
                throwInvalidStatus("Set DTR failed", status);
        }

        /// <summary>
        /// Закрывает и освобождаем ресурсы устройства. Возможно повторное открытие 
        /// устройства методом <see cref="Open(FtdiInfo, uint)"/>
        /// </summary>
        public void Close()
        {
            Dispose();
        }

        /// <summary>
        /// Возвращает количество байт в буфере для чтения
        /// </summary>
        public unsafe uint GetBytesToRead()
        {
            if (_ftHandle == null)
                throw new InvalidOperationException("Device closed");

            uint bytesToRead = 0;

            var status = FT_GetQueueStatus(_ftHandle, ref bytesToRead);
            if (status != FT_STATUS.FT_OK)
                throwInvalidStatus("Get bytes to read failed", status);

            return bytesToRead;
        }

        /// <summary>
        /// Чтение данных. Вернет 0, если внутренний буфер пуст спустя заданный таймаут
        /// </summary>
        public unsafe uint Read(byte[] buffer, uint offset, uint count)
        {
            if (_ftHandle == null)
                throw new InvalidOperationException("Device closed");
            if (buffer == null)
                throw new ArgumentNullException("buffer is null");
            if (offset + count > buffer.Length)
                throw new ArgumentOutOfRangeException("Wrong buffer size or offset");

            fixed (byte* pBuffer = &buffer[offset])
            {
                uint bytesReturned = 0;
                var status = FT_Read(_ftHandle, pBuffer, count, ref bytesReturned);
                if (status != FT_STATUS.FT_OK)
                    throwInvalidStatus("Data read failed", status);

                return bytesReturned;
            }
        }

        /// <summary>
        /// Запись данных в буфер для отправки
        /// </summary>
        public unsafe void Write(byte[] buffer, uint offset, uint count)
        {
            if (_ftHandle == null)
                throw new InvalidOperationException("Device closed");
            if (buffer == null)
                throw new ArgumentNullException("buffer is null");
            if (offset + count > buffer.Length)
                throw new ArgumentOutOfRangeException("Wrong buffer size or offset");

            uint total = 0;
            while (total != count)
            {
                fixed (byte* pBuffer = &buffer[offset + total])
                {
                    uint bytesWritten = 0;
                    uint bytesToWrite = count - total;

                    var status = FT_Write(_ftHandle, pBuffer, bytesToWrite, ref bytesWritten);
                    if (status != FT_STATUS.FT_OK)
                        throwInvalidStatus("Data write failed", status);

                    total += bytesWritten;
                }
            }
        }

        /// <summary>
        /// Закрывает и освобождаем ресурсы устройства. Возможно повторное открытие 
        /// устройства методом <see cref="Open(FtdiInfo, uint)"/>
        /// </summary>
        public unsafe void Dispose()
        {
            if (_ftHandle != null)
            {
                FT_Close(_ftHandle);
                _ftHandle = null;
            }
        }

        #region Static methods

        /// <summary>
        /// Возвращает перечисление подключенных устройств
        /// </summary>
        public static unsafe IEnumerable<FtdiInfo> GetDevices()
        {
            var devicesCount = 0U;
            var status = FT_CreateDeviceInfoList(ref devicesCount);
            if (status != FT_STATUS.FT_OK)
                throwInvalidStatus("Failed to create device list", status);

            if (devicesCount == 0)
                return Enumerable.Empty<FtdiInfo>();

            var nodeSize = Marshal.SizeOf<FT_DEVICE_LIST_INFO_NODE>();
            var buffer = new byte[nodeSize * devicesCount];

            fixed (byte* pBuffer = buffer)
            {
                status = FT_GetDeviceInfoList(pBuffer, ref devicesCount);
                if (status != FT_STATUS.FT_OK)
                    throwInvalidStatus("Failed to fill device list", status);

                var devicesInfo = new List<FtdiInfo>();
                for (var i = 0U; i < devicesCount; i++)
                {
                    var device = Marshal.PtrToStructure<FT_DEVICE_LIST_INFO_NODE>((IntPtr)(&pBuffer[nodeSize * i]));
                    if (device.IsOpen)
                        continue;

                    devicesInfo.Add(createDeskLinkInfo(i));
                }

                return devicesInfo;
            }
        }

        /// <summary>
        /// Запись маркера УПДК для распознавания устройства
        /// </summary>
        public static void WriteDeskMarker(FtdiInfo info)
        {
            Program(info, manufacturer: DeskSerial.MANUFACTURER, description: DeskSerial.DESCRIPTION);
        }

        /// <summary>
        /// Запись произвольных идентификационных данных во внутреннюю память ft232
        /// </summary>
        public static unsafe void Program(FtdiInfo info,
            string manufacturer = null,
            string manufacturerId = null,
            string serialNumber = null,
            string description = null)
        {
            Debug.Assert(info != null);
            Debug.Assert(manufacturer != null || manufacturerId != null || serialNumber != null || description != null);

            var status = FT_STATUS.FT_OK;
            void* ftHandle = null;

            Action<string, string, byte[]> copyString = (src, srcAlt, dst) =>
            {
                Debug.Assert(!string.IsNullOrEmpty(srcAlt));
                var copyStr = !string.IsNullOrEmpty(src) ? src : srcAlt;
                var copyBytes = Encoding.ASCII.GetBytes(copyStr);
                var copyCount = Math.Min(copyBytes.Length, dst.Length);
                Array.Copy(copyBytes, dst, copyCount);
            };

            try
            {
                status = FT_Open(info.DeviceIndex, ref ftHandle);
                if (status != FT_STATUS.FT_OK)
                    throwInvalidStatus("Failed to open device", status);

                clearBuffers();

                fixed (byte* pManufacturer = _bufferManufacturer)
                fixed (byte* pManufacturerId = _bufferManufacturerId)
                fixed (byte* pSerialNumber = _bufferSerialNumber)
                fixed (byte* pDescription = _bufferDescription)
                {
                    copyString(manufacturer, info.Manufacturer, _bufferManufacturer);
                    copyString(manufacturerId, info.ManufacturerId, _bufferManufacturerId);
                    copyString(serialNumber, info.FtdiSerialNumber, _bufferSerialNumber);
                    copyString(description, info.Description, _bufferDescription);

                    var eeprom232r = info.Eeprom232r;
                    status = FT_EEPROM_Program(ftHandle, &eeprom232r, (uint)sizeof(FT_EEPROM_232R),
                        pManufacturer, pManufacturerId, pDescription, pSerialNumber);

                    if (status != FT_STATUS.FT_OK)
                        throwInvalidStatus("Failed to program device", status);
                }
            }
            finally
            {
                if (ftHandle != null)
                    FT_Close(ftHandle);
            }
        }

        private static unsafe FtdiInfo createDeskLinkInfo(uint deviceIndex)
        {
            var status = FT_STATUS.FT_OK;
            void* ftHandle = null;

            Func<byte[], string> toString = (buffer) => Encoding.ASCII.GetString(buffer).TrimEnd('\0');

            try
            {
                status = FT_Open(deviceIndex, ref ftHandle);
                if (status != FT_STATUS.FT_OK)
                    throwInvalidStatus("Failed to open device", status);

                FT_EEPROM_232R eeprom;
                status = eepromRead(ftHandle, out eeprom);
                if (status != FT_STATUS.FT_OK)
                    throwInvalidStatus("Failed to read eeprom", status);

                var info = new FtdiInfo(deviceIndex, eeprom);
                info.Vid = eeprom.common.VendorId;
                info.Pid = eeprom.common.ProductId;
                info.Manufacturer = toString(_bufferManufacturer);
                info.ManufacturerId = toString(_bufferManufacturerId);
                info.FtdiSerialNumber = toString(_bufferSerialNumber);
                info.Description = toString(_bufferDescription);

                return info;
            }
            finally
            {
                if (ftHandle != null)
                    FT_Close(ftHandle);
            }
        }

        private static unsafe FT_STATUS eepromRead(void* ftHandle, out FT_EEPROM_232R eeprom232R)
        {
            clearBuffers();

            fixed (byte* pManufacturer = _bufferManufacturer)
            fixed (byte* pManufacturerId = _bufferManufacturerId)
            fixed (byte* pSerialNumber = _bufferSerialNumber)
            fixed (byte* pDescription = _bufferDescription)
            {
                var eepromInfo = new FT_EEPROM_232R();
                eepromInfo.common.deviceType = FT_DEVICE.FT_232R;

                var size = (uint)sizeof(FT_EEPROM_232R);
                var status = FT_EEPROM_Read(ftHandle, &eepromInfo, size, pManufacturer,
                    pManufacturerId, pDescription, pSerialNumber);

                eeprom232R = eepromInfo;

                return status;
            }
        }

        private static void clearBuffers()
        {
            Action<byte[]> clearBuffer = (buffer) => Array.Clear(buffer, 0, buffer.Length);

            clearBuffer(_bufferDescription);
            clearBuffer(_bufferSerialNumber);
            clearBuffer(_bufferManufacturer);
            clearBuffer(_bufferManufacturerId);
        }

        private static void throwInvalidStatus(string message, FT_STATUS status)
        {
            message += $". FTDI: {status.ToString()}";
            throw new InvalidOperationException(message);
        }

        #endregion
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.FtdiDesk\Source\FtdiInfo.cs


namespace Updk7.Tests.FtdiDesk
{
    public class FtdiInfo
    {
        internal FtdiInfo(uint deviceIndex, Ft232R.FT_EEPROM_232R eeprom232r)
        {
            DeviceIndex = deviceIndex;
            Eeprom232r = eeprom232r;
        }

        internal uint DeviceIndex { get; }

        internal Ft232R.FT_EEPROM_232R Eeprom232r { get; }

        public string FtdiSerialNumber { get; internal set; }

        public string Description { get; internal set; }

        public string Manufacturer { get; internal set; }

        public string ManufacturerId { get; internal set; }

        public int Vid { get; internal set; }

        public int Pid { get; internal set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.FtdiDesk\Source\Gd32Bootloader.cs


using System;
using System.Diagnostics;

namespace Updk7.Tests.FtdiDesk
{
    /// <summary>
    /// Работа с загрузчиком gd32 (он же stm32)
    /// </summary>
    /// <remarks>
    /// Описание команд в AN3155 - USART protocol used in the STM32 bootloader. 
    /// Контроллер должен быть запущен в режиме загрузчика
    /// </remarks>
    public class Gd32Bootloader : IDisposable
    {
        public const int FLASH_DATA_PAGE = 63;
        private const int BOOTLOADER_ACK = 0x79;

        public const int FLASH_PAGE_SIZE = 0x800;
        public const int FLASH_ORIGIN = 0x08000000;
        public const int FLASH_DATA_ORIGIN = FLASH_ORIGIN + FLASH_DATA_PAGE * FLASH_PAGE_SIZE;
        public const int MAX_PACKET_SIZE = 256;

        private static readonly string ERROR_NACK = "Device send NACK";

        private byte[] _buffer = new byte[256];
        private uint _readCount = 0;
        private Ft232R _ft232R = null;

        private Gd32Bootloader(Ft232R ft232R)
        {
            Debug.Assert(ft232R != null && ft232R.IsOpen);
            _ft232R = ft232R;
        }

        public static Gd32Bootloader Create(FtdiInfo deviceInfo)
        {
            var ft232R = new Ft232R() 
            {
                BaudRate = 57600,
                ReadTimeout = 100,
                WriteTimeout = 100,
                Parity = Ft232R.UartParity.Even
            };

            try
            {
                ft232R.Open(deviceInfo);

                // Приветствие для загрузчика, задаем скорость обмена
                var buffer = new byte[] { 0x7f };
                ft232R.Write(buffer, 0, (uint)buffer.Length);
                var readCount = ft232R.Read(buffer, 0, 1);

                if (readCount == 0)
                    throw new TimeoutException("Bootloader timeout");
                if (buffer[0] != BOOTLOADER_ACK)
                    throw new InvalidOperationException("Bootloader invalid handshake");

                return new Gd32Bootloader(ft232R);
            }
            catch (Exception)
            {
                ft232R.Dispose();
                throw;
            }
        }

        public void Dispose()
        {
            if (_ft232R != null)
            {
                _ft232R.Dispose();
                _ft232R = null;
            }
        }

        public int GetVersion()
        {
            Debug.Assert(_ft232R != null);

            _buffer[0] = 0x01;
            _buffer[1] = 0xfe;
            _ft232R.Write(_buffer, 0, 2);

            _readCount = _ft232R.Read(_buffer, 0, 5);
            checkAckReceived();

            return _buffer[1];
        }

        public void FlashRead(uint origin, byte[] dst, int dataCount)
        {
            Debug.Assert(_ft232R != null);
            Debug.Assert(origin % 4 == 0);
            Debug.Assert(dataCount > 0 && dataCount <= 256 && dataCount % 4 == 0);
            Debug.Assert(dst != null && dst.Length >= dataCount);

            // Command
            _buffer[0] = 0x11;
            _buffer[1] = 0xee;
            _ft232R.Write(_buffer, 0, 2);

            // ACK
            _readCount = _ft232R.Read(_buffer, 0, 1);
            checkAckReceived();

            // Address
            _buffer[0] = (byte)((origin >> 24) & 0xff);
            _buffer[1] = (byte)((origin >> 16) & 0xff);
            _buffer[2] = (byte)((origin >> 8) & 0xff);
            _buffer[3] = (byte)(origin & 0xff);
            _buffer[4] = (byte)(_buffer[0] ^ _buffer[1] ^ _buffer[2] ^ _buffer[3]);
            _ft232R.Write(_buffer, 0, 5);

            // ACK
            _readCount = _ft232R.Read(_buffer, 0, 1);
            checkAckReceived();

            // Data count
            _buffer[0] = (byte)(dataCount - 1);
            _buffer[1] = (byte)(_buffer[0] ^ 0xff);
            _ft232R.Write(_buffer, 0, 2);

            // ACK
            _readCount = _ft232R.Read(_buffer, 0, 1);
            checkAckReceived();

            // Read data
            _readCount = _ft232R.Read(dst, 0, (uint)dataCount);
            if (_readCount == 0)
                throw new TimeoutException();
            if (_readCount != dataCount)
                throw new InvalidOperationException("Data missing");
        }

        public byte[] FlashRead(uint origin, int dataCount)
        {
            var data = new byte[dataCount];
            FlashRead(origin, data, dataCount);
            return data;
        }

        public void FlashWrite(uint origin, byte[] src, int dataCount)
        {
            Debug.Assert(_ft232R != null);
            Debug.Assert(origin % 4 == 0);
            Debug.Assert(dataCount > 0 && dataCount <= 256);
            Debug.Assert(src != null && src.Length >= dataCount);

            // Command
            _buffer[0] = 0x31;
            _buffer[1] = 0xce;
            _ft232R.Write(_buffer, 0, 2);

            // ACK
            _readCount = _ft232R.Read(_buffer, 0, 1);
            checkAckReceived();

            // Address
            _buffer[0] = (byte)((origin >> 24) & 0xff);
            _buffer[1] = (byte)((origin >> 16) & 0xff);
            _buffer[2] = (byte)((origin >> 8) & 0xff);
            _buffer[3] = (byte)(origin & 0xff);
            _buffer[4] = (byte)(_buffer[0] ^ _buffer[1] ^ _buffer[2] ^ _buffer[3]);
            _ft232R.Write(_buffer, 0, 5);

            // ACK
            _readCount = _ft232R.Read(_buffer, 0, 1);
            checkAckReceived();

            // N
            _buffer[0] = (byte)(dataCount - 1);
            _ft232R.Write(_buffer, 0, 1);

            // Checksum
            var checksum = _buffer[0];          // !!!
            for (var i = 0; i < dataCount; i++)
                checksum ^= src[i];

            // Data
            _ft232R.Write(src, 0, (uint)dataCount);
            _buffer[0] = checksum;
            _ft232R.Write(_buffer, 0, 1);

            // ACK
            _readCount = _ft232R.Read(_buffer, 0, 1);
            checkAckReceived();
        }

        public void FlashWrite(uint origin, byte[] src)
        {
            FlashWrite(origin, src, src.Length);
        }

        public void FlashPageErase(int pageNumber)
        {
            Debug.Assert(_ft232R != null);
            
            // Command
            _buffer[0] = 0x44;
            _buffer[1] = 0xbb;
            _ft232R.Write(_buffer, 0, 2);

            // ACK
            _readCount = _ft232R.Read(_buffer, 0, 1);
            checkAckReceived();

            // Page
            _buffer[0] = 0;
            _buffer[1] = 0;
            _buffer[2] = 0;
            _buffer[3] = (byte)pageNumber;
            _buffer[4] = _buffer[3];
            _ft232R.Write(_buffer, 0, 5);

            // ACK
            _readCount = _ft232R.Read(_buffer, 0, 1);
            checkAckReceived();
        }

        private void checkAckReceived()
        {
            if (_readCount == 0)
                throw new TimeoutException();
            if (_buffer[0] != BOOTLOADER_ACK)
                throw new InvalidOperationException(ERROR_NACK);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.FtdiDesk\Source\Gd32Flasher.cs


using System;
using System.Threading.Tasks;

namespace Updk7.Tests.FtdiDesk
{
    /// <summary>
    /// Запись прошивки в пульт. Пульт должен быть запущен в режиме загрузчика
    /// </summary>
    public class Gd32Flasher : IDisposable
    {
        public const int FIRMWARE_ORIGIN = Gd32Bootloader.FLASH_ORIGIN;
        public const int DATA_ORIGIN = Gd32Bootloader.FLASH_DATA_ORIGIN;
        public const int FLASH_PAGE_SIZE = Gd32Bootloader.FLASH_PAGE_SIZE;

        private Gd32Bootloader _bootloader;

        private Gd32Flasher(Gd32Bootloader bootloader)
        {
            _bootloader = bootloader;
        }

        public void Dispose()
        {
            if (_bootloader != null)
            {
                _bootloader.Dispose();
                _bootloader = null;
            }
        }

        public static Gd32Flasher Create(FtdiInfo deviceInfo)
        {
            var bootloader = Gd32Bootloader.Create(deviceInfo);
            return new Gd32Flasher(bootloader);
        }

        public Task EraseAsync(int pagesCount, IProgress<int> progress)
        {
            return EraseAsync(0, pagesCount, progress);
        }

        public Task WriteAsync(byte[] data, IProgress<int> progress)
        {
            return WriteAsync(Gd32Bootloader.FLASH_ORIGIN, data, progress);
        }

        public Task EraseAsync(int startPage, int pagesCount, IProgress<int> progress)
        {
            return Task.Run(() =>
            {
                var progressPercentage = 0;

                for (var i = 0; i < pagesCount; i++)
                {
                    _bootloader.FlashPageErase(startPage + i);

                    var currentProgress = 100 * (i + 1) / pagesCount;
                    if (progress != null && currentProgress > progressPercentage)
                    {
                        progressPercentage = currentProgress;
                        progress.Report(progressPercentage);
                    }
                }
            });
        }

        public Task WriteAsync(uint origin, byte[] data, IProgress<int> progress)
        {
            return Task.Run(() =>
            {
                var flashData = new byte[Gd32Bootloader.MAX_PACKET_SIZE];
                var progressPercentage = 0;
                var writeCount = 0;

                while (writeCount < data.Length)
                {
                    var copyCount = Math.Min(flashData.Length, data.Length - writeCount);
                    Array.Copy(data, writeCount, flashData, 0, copyCount);

                    var address = (uint)(origin + writeCount);
                    _bootloader.FlashWrite(address, flashData, copyCount);
                    writeCount += copyCount;

                    var currentProgress = 100 * writeCount / data.Length;
                    if (progress != null && currentProgress > progressPercentage)
                    {
                        progressPercentage = currentProgress;
                        progress.Report(progressPercentage);
                    }
                }
            });
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\ArrayExtensions.cs


namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Вспомогательные методы для работы с массивами
    /// </summary>
    internal static class ArrayEx
    {
        public static T[] Assign<T>(this T[] array, T value)
        {
            for (int i = 0; i < array.Length; i++)
                array[i] = value;

            return array;
        }

        public static T[] Clear<T>(this T[] array) where T : struct
        {
            return array.Assign(default(T));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\Check.cs


using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Вспомогательные методы проверки аргументов методов
    /// </summary>
    internal static class Check
    {
        public static void OperationRequirements(bool condition, string message)
        {
            if (!condition)
                throw new InvalidOperationException(message);
        }

        public static void ValueRequirements(bool condition, string message)
        {
            if (!condition)
                throw new ArgumentOutOfRangeException(message);
        }

        public static void StringNotEmpty(string str, string message)
        {
            if (string.IsNullOrEmpty(str))
                throw new ArgumentNullException(message);
        }

        public static void NotNull(object obj, string message)
        {
            if (obj == null)
                throw new NullReferenceException(message);
        }

        public static void Disposed(bool disposed, string objectName)
        {
            if (disposed)
                throw new ObjectDisposedException(objectName);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\Clu.cs


using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Класс управления КСУ
    /// </summary>
    /// <remarks>
    /// При работе с устройством допустимо повторное открытие устройства, например после 
    /// отключения и подключения устройства
    /// </remarks>
    public class Clu : UsbDevice
    {
        /// <summary>
        /// Коды команд устройства
        /// </summary>
        private class OpCodes
        {
            public const byte CLU_MODE_IDLE = 0x01;
            public const byte CLU_MODE_TIMER_PULT = 0x06;
            public const byte CLU_MODE_BLINKDOWN = 0x04;
            public const byte CLU_MODE_BLINKUP = 0x05;
            public const byte CLU_MODE_GSR = 0x02;
        }

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        /// <remarks>
        /// Предполагается, что на один транспорт использует один КСУ, поэтому класс 
        /// управляет открытием и закрытием транспорта
        /// </remarks>
        /// <param name="transport">Транспорт сообщений для работы с КСУ</param>
        public Clu(IDataTransport transport) : base(transport)
        {
        }

        /// <summary>
        /// Открытие транспорта, начало работы с КСУ
        /// </summary>
        public void Open()
        {
            Transport.Open();
        }

        /// <summary>
        /// Закрытие транспорта, окончание работы с КСУ
        /// </summary>
        public void Close()
        {
            try
            {
                GoToIdle();
                Transport.Close();
            }
            catch (Exception)
            {
            }
        }

        /// <summary>
        /// Задание режима работы мерцаний с повышающейся частотой
        /// </summary>
        /// <param name="frequency">Конечная частота мерцаний</param>
        public void StartBlinkUp(int frequency)
        {
            Check.ValueRequirements(frequency >= 20 && frequency <= 60, nameof(frequency));

            var period = (frequency - 20) * 1000 + 800;
            WriteCommand(OpCodes.CLU_MODE_BLINKUP, (ushort)period);
        }

        /// <summary>
        /// Задание режима работы мерцаний с понижающейся частотой
        /// </summary>
        /// <param name="frequency">Конечная частота мерцаний</param>
        public void StartBlinkDown(int frequency)
        {
            Check.ValueRequirements(frequency >= 20 && frequency <= 60, nameof(frequency));

            var period = (60 - frequency) * 1000 + 800;
            WriteCommand(OpCodes.CLU_MODE_BLINKDOWN, (ushort)period);
        }

        /// <summary>
        /// Запуск таймера
        /// </summary>
        /// <remarks>
        /// После окончания заданного интервала времени, КСУ имитирует нажатие на кнопку пульта
        /// </remarks>
        /// <param name="period">Время срабатывания таймера</param>
        public void StartPultTimer(int period)
        {
            Check.ValueRequirements(period > 0 && period < ushort.MaxValue, nameof(period));
            WriteCommand(OpCodes.CLU_MODE_TIMER_PULT, (ushort)period);
        }

        public void StartGsr()
        {
            WriteCommand(OpCodes.CLU_MODE_GSR, 0);
        }

        /// <summary>
        /// Остановка всех действий КСУ
        /// </summary>
        public void GoToIdle()
        {
            WriteCommand(OpCodes.CLU_MODE_IDLE, 0);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\ExceptionsMessages.cs


namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Сообщения об ошибках библиотеки
    /// </summary>
    internal static class ExceptionsMessages
    {
        public static readonly string AlreadyOpen = "Device is already open";
        public static readonly string NotConnected = "Device not connected";
        public static readonly string TooManyDevices = "Too many devices connected to one PC";
        public static readonly string FaildToOpenDevice = "Faild to open device";
        public static readonly string FaildToRunDevice = "Failed to run device";
        public static readonly string FaildToGetData = "Faild to get data from device";
        public static readonly string EmtpyString = "Empty string is not valid";
        public static readonly string DataSizeTooLarge = "Data size too large";
        public static readonly string TooManyParameters = "Too many parameters";
        public static readonly string AlreadyRunning = "Excecution is already running";
        public static readonly string TransportClosed = "Data transport closed";
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\FtdiDeskProxy.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;

namespace Updk7.Tests.Pult
{
    public class FtdiDeskProxy : IDataTransport
    {
        private const int READ_PACKET_SIZE = 8;

        private enum Commands : byte
        {
            STOP = 0x00,
            GET_DATA = 0x01,
            KEYS_START = 0x02,
            RESISTORS_START = 0x03,
            TEPPING_START = 0x06,
            LED_SET = 0x07,
            SWEEP_UP = 0x08,
            SWEEP_DOWN = 0x09,
            GSR_START = 0x0a
        }

        private struct ButtonsState
        {
            public FtdiDesk.ButtonType? Buttons;
            public uint ButtonPressTime;
        }

        private class DeskState
        {
            public List<ButtonsState> Buttons = new List<ButtonsState>();
            public byte? RotationX;
            public byte? RotationY;
            public uint? SkinResistanse;
            public FtdiDesk.SweepDirection SweepDirection;
            public byte? SweepFinalFreq;
            public List<byte> ProbeFlags = new List<byte>();

            public void Clear()
            {
                // SweepDirection не трогаем, он нужен для информации
                RotationX = RotationY = null;
                SkinResistanse = null;
                SweepFinalFreq = null;
                ProbeFlags.Clear();
                Buttons.Clear();
            }
        }

        private DeskState _state = new DeskState();
        private FtdiDesk.DeskLink _deskLink;
        private Func<byte[], int, int>[] _readActions;
        private bool _canUpdateData = false;

        public FtdiDeskProxy(FtdiDesk.DeskLink deskLink)
        {
            Debug.Assert(deskLink != null);

            _deskLink = deskLink;
            _deskLink.IsConnectedChanged += onDeskLinkIsConnectedChanged;
            _deskLink.MessageReceived += onDeskLinkMessageReceived;

            _readActions = new Func<byte[], int, int>[]
            {
                readButtons, readProbe, readRotation, readGsr, readSweep
            };
        }

        public bool IsOpen => _deskLink != null && _deskLink.IsConnected;

        public event EventHandler DataReceived;

        public void Open(int instance = 0)
        {
            _state.Clear();
        }

        public void Close()
        {
        }

        public FtdiDesk.DeskLink GetDeskLink()
        {
            return _deskLink;
        }

        public void Dispose()
        {
            if (_deskLink != null)
            {
                _deskLink.IsConnectedChanged -= onDeskLinkIsConnectedChanged;
                _deskLink.MessageReceived -= onDeskLinkMessageReceived;
                _deskLink = null;
            }
        }

        public void Write(byte[] data, int size)
        {
            if (!IsOpen)
                return;

            var command = (Commands)data[1];
            var parameter = (data[2] << 8) | data[3];

            _canUpdateData = command != Commands.STOP;
            switch (command)
            {
                case Commands.STOP:
                    break;
                case Commands.GET_DATA:
                    break;
                case Commands.KEYS_START:
                    _state.Clear();
                    _deskLink.ResetTimer();
                    break;
                case Commands.RESISTORS_START:
                    break;
                case Commands.GSR_START:
                    break;
                case Commands.LED_SET:
                    _deskLink.SetLed(parameter != 0);
                    break;
                case Commands.SWEEP_UP:
                    _state.SweepDirection = FtdiDesk.SweepDirection.Increase;
                    _deskLink.SetSweep(_state.SweepDirection);
                    break;
                case Commands.SWEEP_DOWN:
                    _state.SweepDirection = FtdiDesk.SweepDirection.Decrease;
                    _deskLink.SetSweep(_state.SweepDirection);
                    break;
                case Commands.TEPPING_START:
                    _state.Clear();
                    break;
            }
        }

        public int Read(byte[] data, int size)
        {
            if (!IsOpen)
                return 0;

            Array.Clear(data, 0, size);
            
            var offset = 0;
            foreach (var action in _readActions)
            {
                if (offset >= size)
                    break;

                offset += action(data, offset);
            }

            _state.Clear();

            return offset;
        }

        private void onDeskLinkIsConnectedChanged(object sender, EventArgs e)
        {
        }

        private void onDeskLinkMessageReceived(object sender, FtdiDesk.MessageReceivedEventArgs e)
        {
            if (!_canUpdateData)
                return;

            switch (e.Type)
            {
                case FtdiDesk.MessageType.Buttons:
                    handleButtons(e as FtdiDesk.ButtonsReceivedEventArgs);
                    onDataReceived();
                    break;
                case FtdiDesk.MessageType.Adc:
                    handleAdc(e as FtdiDesk.AdcReceivedEventArgs);
                    break;
                case FtdiDesk.MessageType.SweepComplete:
                    handleSweepComplete(e as FtdiDesk.SweepCompleteReceivedEventArgs);
                    break;
                case FtdiDesk.MessageType.Probe:
                    handleProbe(e as FtdiDesk.ProbeReceivedEventArgs);
                    onDataReceived();
                    break;
            }
        }

        private void onDataReceived()
        {
            DataReceived?.Invoke(this, EventArgs.Empty);
        }

        private void handleButtons(FtdiDesk.ButtonsReceivedEventArgs e)
        {
            Debug.Assert(e != null);

            if (e.AnyPressed)
            {
                _state.Buttons.Add(new ButtonsState()
                {
                    Buttons = e.Buttons,
                    ButtonPressTime = e.Ticks
                });
            }
        }

        private void handleAdc(FtdiDesk.AdcReceivedEventArgs e)
        {
            Debug.Assert(e != null);

            _state.RotationX = (byte?)e.X;
            _state.RotationY = (byte?)e.Y;
            _state.SkinResistanse = (uint?)e.SkinResistance;
        }

        private void handleSweepComplete(FtdiDesk.SweepCompleteReceivedEventArgs e)
        {
            Debug.Assert(e != null);
            _state.SweepFinalFreq = (byte)e.FinalFreq;
        }

        private void handleProbe(FtdiDesk.ProbeReceivedEventArgs e)
        {
            Debug.Assert(e != null);
            _state.ProbeFlags.Add((byte)(e.Probe ? 1 : 0));
        }

        private int readButtons(byte[] buffer, int offset)
        {
            if (_state.Buttons.Count == 0)
                return 0;

            var index = offset;
            foreach (var state in _state.Buttons)
            {
                if (index >= buffer.Length)
                    break;

                // Размерность времени старого пульта 100мкс, нового 1мс, поэтому умножаем время на 10
                buffer[offset + 0] = 0x01;
                buffer[offset + 1] = (byte)Commands.KEYS_START;
                buffer[offset + 2] = mapButtons(state.Buttons);
                copyInt32(buffer, offset + 4, 10 * state.ButtonPressTime);

                index += READ_PACKET_SIZE;
            }

            return index - offset;
        }

        private int readProbe(byte[] buffer, int offset)
        {
            if (_state.ProbeFlags.Count == 0)
                return 0;

            var index = offset;
            foreach (var probe in _state.ProbeFlags)
            {
                if (index >= buffer.Length)
                    break;

                buffer[index + 0] = 0x01;
                buffer[index + 1] = (byte)Commands.TEPPING_START;
                buffer[index + 5] = probe;

                index += READ_PACKET_SIZE;
            }

            return index - offset;
        }

        private int readRotation(byte[] buffer, int offset)
        {
            if (!_state.RotationX.HasValue || !_state.RotationY.HasValue)
                return 0;

            if (offset + READ_PACKET_SIZE > buffer.Length)
                return 0;

            buffer[offset + 0] = 0x01;
            buffer[offset + 1] = (byte)Commands.RESISTORS_START;
            buffer[offset + 2] = _state.RotationX.Value;
            buffer[offset + 3] = _state.RotationY.Value;

            return READ_PACKET_SIZE;
        }

        private int readGsr(byte[] buffer, int offset)
        {
            if (!_state.SkinResistanse.HasValue)
                return 0;

            if (offset + READ_PACKET_SIZE > buffer.Length)
                return 0;

            buffer[offset + 0] = 0x01;
            buffer[offset + 1] = (byte)Commands.GSR_START;
            copyInt32(buffer, offset + 4, _state.SkinResistanse.Value);

            return READ_PACKET_SIZE;
        }

        private int readSweep(byte[] buffer, int offset)
        {
            if (!_state.SweepFinalFreq.HasValue || _state.SweepDirection == FtdiDesk.SweepDirection.Off)
                return 0;

            if (offset + READ_PACKET_SIZE > buffer.Length)
                return 0;

            var direction = _state.SweepDirection == FtdiDesk.SweepDirection.Increase
                ? Commands.SWEEP_UP 
                : Commands.SWEEP_DOWN;

            buffer[offset + 0] = 0x01;
            buffer[offset + 1] = (byte)direction;
            buffer[offset + 2] = _state.SweepFinalFreq.Value;

            return READ_PACKET_SIZE;
        }

        private void copyInt32(byte[] buffer, int offset, uint value)
        {
            buffer[offset + 0] = (byte)((value >> 0) & 0xff);
            buffer[offset + 1] = (byte)((value >> 8) & 0xff);
            buffer[offset + 2] = (byte)((value >> 16) & 0xff);
            buffer[offset + 3] = (byte)((value >> 24) & 0xff);
        }

        private byte mapButtons(FtdiDesk.ButtonType? ftdiButtons)
        {
            if (!ftdiButtons.HasValue)
                return (byte)PultButton.None;

            var result = PultButton.None;
            var srcButton = ftdiButtons.Value;

            if (srcButton.HasFlag(FtdiDesk.ButtonType.Black))
                result |= PultButton.Black;
            if (srcButton.HasFlag(FtdiDesk.ButtonType.Blue))
                result |= PultButton.Blue;
            if (srcButton.HasFlag(FtdiDesk.ButtonType.Green))
                result |= PultButton.Green;
            if (srcButton.HasFlag(FtdiDesk.ButtonType.Red))
                result |= PultButton.Red;
            if (srcButton.HasFlag(FtdiDesk.ButtonType.White))
                result |= PultButton.White;
            if (srcButton.HasFlag(FtdiDesk.ButtonType.Yellow))
                result |= PultButton.Yellow;

            return (byte)result;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\IButtons.cs


using System;

namespace Updk7.Tests.Pult
{
    public enum PultButton
    {
        None = 0x00,
        Green = 0x01,
        Yellow = 0x02,
        Red = 0x04,
        Blue = 0x08,
        White = 0x10,
        Black = 0x20
    }

    public class ButtonPressedEventArgs
    {
        public ButtonPressedEventArgs(PultButton button, int time)
        {
            Button = button;
            Time = time;
        }

        public PultButton Button { get; private set; }

        public int Time { get; private set; }
    }

    public interface IButtons : IPult
    {
        event EventHandler<ButtonPressedEventArgs> ButtonPressed;

        bool ResetTimerOnButtonPress { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\IDataTransport.cs


using System;

namespace Updk7.Tests.Pult
{
    public interface IDataTransport : IDisposable
    {
        bool IsOpen { get; }

        void Open(int instance = 0);

        void Close();

        int Read(byte[] data, int size);

        void Write(byte[] data, int size);
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\IGsr.cs


using System;

namespace Updk7.Tests.Pult
{
    public class GsrValueCgangedEventArgs
    {
        public GsrValueCgangedEventArgs(uint oldValue, uint newValue)
        {
            OldValue = oldValue;
            NewValue = newValue;
        }

        public uint OldValue { get; private set; }

        public uint NewValue { get; private set; }
    }

    public interface IGsr : IPult
    {
        event EventHandler<GsrValueCgangedEventArgs> GsrValueChanged;

        uint GsrValue { get; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\IPult.cs


namespace Updk7.Tests.Pult
{
    public interface IPult : IStartStop
    {
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\IPultMonitor.cs


using System;

namespace Updk7.Tests.Pult
{
    public interface IPultMonitor
    {
        event EventHandler IsConnectedChanged;

        IDataTransport Transport { get; }

        bool IsConnected { get; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\IResistors.cs


using System;

namespace Updk7.Tests.Pult
{
    public class ResistorsValueChangedEventArgs : EventArgs
    {
        public int[] Values { get; private set; }

        public ResistorsValueChangedEventArgs(int[] values)
        {
            Values = values;
        }
    }

    public interface IResistors : IPult
    {
        event EventHandler<ResistorsValueChangedEventArgs> ResistorsValuesChanged;

        int[] ResistorsValues { get; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\IStartStop.cs


namespace Updk7.Tests.Pult
{
    public interface IStartStop
    {
        bool IsRunning { get; }
        void Start();
        void Stop();
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\ITepping.cs


using System;

namespace Updk7.Tests.Pult
{
    public class TeppingChangedEventArgs
    {
        public TeppingChangedEventArgs(bool value)
        {
            Value = value;
        }

        public bool Value { get; private set; }
    }

    public interface ITepping : IPult
    {
        event EventHandler<TeppingChangedEventArgs> TeppingValueChanged;

        bool TeppingValue { get; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\ITremor.cs


using System;

namespace Updk7.Tests.Pult
{
    public class TremorPositionChangedEventArgs : EventArgs
    {
        public TremorPositionChangedEventArgs(Point position)
        {
            Position = position;
        }

        public Point Position { get; protected set; }
    }

    public class InSiloChangedEventArgs : EventArgs
    {
        public InSiloChangedEventArgs(bool value)
        {
            Value = value;
        }

        public bool Value { get; private set; }
    }

    public struct Point
    {
        public double X;
        public double Y;

        public Point(double x, double y)
        {
            X = x;
            Y = y;
        }

        public static bool operator ==(Point p1, Point p2)
        {
            return p1.X.Equals(p2.X) &&
                   p1.Y.Equals(p2.Y);
        }

        public static bool operator !=(Point p1, Point p2)
        {
            return !(p1 == p2);
        }

        public override bool Equals(object obj)
        {
            return obj is Point && this == (Point)obj;
        }

        public override int GetHashCode()
        {
            return X.GetHashCode() ^ Y.GetHashCode();
        }

        public override string ToString()
        {
            return string.Format("(X={0},Y={1})", X, Y);
        }
    }

    public class TremorChangedEventArgs : EventArgs
    {
        /// <summary>
        /// Прежнее отклонение от центра. Принимаемые значения: [-1;+1]
        /// </summary>
        public Point OldPos { get; private set; }

        /// <summary>
        /// Отклонение от центра. Принимаемые значения: [-1;+1]
        /// </summary>
        public Point NewPos { get; private set; }

        /// <summary>
        /// Нобработанные координаты возвращенные пультом.
        /// Использовать только в тестере пульта.
        /// </summary>
        public Point NewPosDirty { get; set; }

        public bool Tepping { get; private set; }

        public bool InSilo { get; private set; }

        /// <summary> Радиус колодца в миллиметрах </summary>
        public double WellRadiusMm
        {
            get { return 5; }
        }

        /// <summary> Удаление от центра [мм] </summary>
        public double RadiusMm
        {
            get { return Math.Sqrt(NewPos.X * NewPos.X + NewPos.Y * NewPos.Y) * WellRadiusMm; }
        }

        public TremorChangedEventArgs(Point oldVal, Point newVal, bool silo, bool tep)
        {
            OldPos = oldVal;
            NewPos = newVal;
            InSilo = silo;
            Tepping = tep;
        }
    }

    public interface ITremor : IPult
    {
        event EventHandler<TremorChangedEventArgs> TremorChanged;

        event EventHandler<TremorPositionChangedEventArgs> TremorPositionChanged;

        event EventHandler<TeppingChangedEventArgs> TeppingChanged;

        event EventHandler<InSiloChangedEventArgs> InSiloChanged;

        Point TremorPosition { get; }

        bool InSilo { get; }

        bool Tepping { get; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\KeyboardPultBase.cs


using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Базовый класс имитатора пульта УПДК с помощью клавиатуры
    /// </summary>
    /// <remarks>
    /// Ставит глобальный хук на клавиатуру. Какая кнопка за что отвечает определяется в наследниках
    /// </remarks>
    public abstract class KeyboardPultBase : IPult, IDisposable
    {
        /// <summary>
        /// Используемые методы WinApi
        /// </summary>
        private static class NativeMethods
        {
            public delegate int HookProc(int code, IntPtr wParam, IntPtr lParam);

            [DllImport("user32.dll", CharSet = CharSet.Auto)]
            public static extern int SetWindowsHookEx(int hookType, HookProc lpfn, IntPtr hMod, uint dwThreadId);

            [DllImport("user32.dll", CharSet = CharSet.Auto)]
            [return: MarshalAs(UnmanagedType.Bool)]
            public static extern bool UnhookWindowsHookEx(int idHook);

            [DllImport("user32.dll", SetLastError = true)]
            public static extern int CallNextHookEx(int idHook, int nCode, IntPtr wParam, IntPtr lParam);

            [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
            private static extern IntPtr GetModuleHandle(string lpModuleName);

            public static int SetKeyboardHook(HookProc hook)
            {
                const int WH_KEYBOARD_LL = 13;

                using (var curProcess = Process.GetCurrentProcess())
                using (var curModule = curProcess.MainModule)
                {
                    return SetWindowsHookEx(WH_KEYBOARD_LL, hook,
                        GetModuleHandle(curModule.ModuleName), 0);
                }
            }
        }
        
        private readonly NativeMethods.HookProc _hookDelegate;
        private bool _disposedValue = false;
        private int _hhook = 0;

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public KeyboardPultBase()
        {
            _hookDelegate = new NativeMethods.HookProc(keyboardHook);
            _hhook = NativeMethods.SetKeyboardHook(_hookDelegate);
        }

        /// <summary>
        /// Финализатор
        /// </summary>
        ~KeyboardPultBase()
        {
            Dispose(false);
        }

        /// <summary>
        /// Флаг работы пульта
        /// </summary>
        public bool IsRunning { get; protected set; } = false;

        /// <summary>
        /// Старт работы пульта
        /// </summary>
        public virtual void Start()
        {
            Check.Disposed(_disposedValue, nameof(KeyboardPultBase));
            IsRunning = true;
        }

        /// <summary>
        /// Остановка работы пульта
        /// </summary>
        public virtual void Stop()
        {
            Check.Disposed(_disposedValue, nameof(KeyboardPultBase));
            IsRunning = false;
        }

        /// <summary>
        /// Освобождение ресурсов
        /// </summary>
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        /// <summary>
        /// Освобождение ресурсов
        /// </summary>
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposedValue)
            {
                if (_hhook != 0)
                    NativeMethods.UnhookWindowsHookEx(_hhook);

                _disposedValue = true;
            }
        }

        /// <summary>
        /// Обработчик нажатия на кнопку
        /// </summary>
        /// <param name="key">Код кнопки</param>
        protected abstract void OnKeyDown(int key);

        /// <summary>
        /// Обработчик отпускания кнопки
        /// </summary>
        /// <param name="key">Код кнопки</param>
        protected abstract void OnKeyUp(int key);

        private int keyboardHook(int code, IntPtr wParam, IntPtr lParam)
        {
            const int WM_KEYUP = 0x0101;
            const int WM_KEYDOWN = 0x0100;

            if (code >= 0 && IsRunning)
            {
                var key = Marshal.ReadInt32(lParam);
                switch (wParam.ToInt32())
                {
                    case WM_KEYUP:
                        OnKeyUp(key);
                        break;
                    case WM_KEYDOWN:
                        OnKeyDown(key);
                        break;
                }
            }

            return NativeMethods.CallNextHookEx(_hhook, code, wParam, lParam);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\KeyboardPultButtons.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// имитатор кнопок пульта УПДК на клавиатуре
    /// </summary>
    public class KeyboardPultButtons : KeyboardPultBase, IButtons
    {
        /// <summary>
        /// Словарь соответствия кодов кнопок клавиатуры кнопкам пульта
        /// </summary>
        private static readonly Dictionary<int, PultButton> _buttonsCodes = new Dictionary<int, PultButton>()
        {
            [81] = PultButton.Green,
            [87] = PultButton.Yellow,
            [69] = PultButton.Red,
            [65] = PultButton.Blue,
            [83] = PultButton.White,
            [90] = PultButton.Black
        };

        private DateTime _startTime;

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public KeyboardPultButtons()
        {
        }

        /// <summary>
        /// Событие нажатия на кнопку
        /// </summary>
        public event EventHandler<ButtonPressedEventArgs> ButtonPressed;

        /// <summary>
        /// Флаг сброса таймера кнопок при нажатии
        /// </summary>
        public bool ResetTimerOnButtonPress { get; set; } = true;

        /// <summary>
        /// Старт работы пульта
        /// </summary>
        public override void Start()
        {
            _startTime = DateTime.Now;
            base.Start();
        }


        /// <summary>
        /// Обработчик нажатия на кнопку
        /// </summary>
        /// <param name="key">Код кнопки</param>
        protected override void OnKeyDown(int key)
        {
            Debug.WriteLine(key);

            if (_buttonsCodes.ContainsKey(key))
            {
                var time = (int)(DateTime.Now - _startTime).TotalMilliseconds * 10;
                if (ResetTimerOnButtonPress)
                    _startTime = DateTime.Now;

                OnButtonPressed((PultButton)key, time);
            }
        }

        /// <summary>
        /// Обработчик отпускания кнопки
        /// </summary>
        /// <param name="key">Код кнопки</param>
        protected override void OnKeyUp(int key)
        {
        }

        /// <summary>
        /// Нажатие на кнопку пульта
        /// </summary>
        protected void OnButtonPressed(PultButton button, int time)
        {
            if (ButtonPressed != null)
                ButtonPressed(this, new ButtonPressedEventArgs(button, time));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\KeyboardPultResistors.cs


using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Имитация резистивных рукояток пульта УПДК на клавиатуре
    /// </summary>
    public class KeyboardPultResistors : KeyboardPultBase, IResistors
    {
        /// <summary>
        /// Коды кнопок для изменения сопротивлений рукояток пульта
        /// </summary>
        private enum Buttons : int
        {
            IncreaseR1 = 81,
            DecreaseR1 = 65,
            IncreaseR2 = 221,
            DecreaseR2 = 222
        }

        private static readonly int[] _resistorsValuesUndefined = new int[] { 0, 0 };
        private const int _resistorsLowTreshold = 5;
        private const int _resistorsHighTreshold = 250;
        private const int _resistorsStep = 5;

        private int[] _resistorsValues = _resistorsValuesUndefined;

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public KeyboardPultResistors()
        {
        }

        /// <summary>
        /// Событие изменения сопротивлений рукояток пульта
        /// </summary>
        public event EventHandler<ResistorsValueChangedEventArgs> ResistorsValuesChanged;

        /// <summary>
        /// Сопротивления рукояток пульта
        /// </summary>
        public int[] ResistorsValues
        {
            get { return _resistorsValues; }
            private set
            {
                Check.NotNull(value, nameof(ResistorsValues));
                Check.OperationRequirements(value.Length == _resistorsValuesUndefined.Length,
                    nameof(ResistorsValues));

                if ((value[0] != _resistorsValues[0]) || (value[1] != _resistorsValues[1]))
                {
                    _resistorsValues = value;
                    OnResistorsValuesChanged(value);
                }
            }
        }

        /// <summary>
        /// Старт работы пульта
        /// </summary>
        public override void Start()
        {
            ResistorsValues = _resistorsValuesUndefined;
            base.Start();
        }

        /// <summary>
        /// Обработчик нажатия на кнопку
        /// </summary>
        /// <param name="key">Код кнопки</param>
        protected override void OnKeyDown(int key)
        {
            var l = _resistorsValues[0];
            var r = _resistorsValues[1];

            switch ((Buttons)key)
            {
                case Buttons.IncreaseR1:
                    if (l < _resistorsHighTreshold)
                        ResistorsValues = new int[] { l + _resistorsStep, r };
                    break;
                case Buttons.DecreaseR1:
                    if (l > _resistorsLowTreshold)
                        ResistorsValues = new int[] { l - _resistorsStep, r };
                    break;
                case Buttons.IncreaseR2:
                    if (r < _resistorsHighTreshold)
                        ResistorsValues = new int[] { l, r + _resistorsStep };
                    break;
                case Buttons.DecreaseR2:
                    if (r > _resistorsLowTreshold)
                        ResistorsValues = new int[] { l, r - _resistorsStep };
                    break;
            }
        }

        /// <summary>
        /// Обработчик отпускания кнопки
        /// </summary>
        /// <param name="key">Код кнопки</param>
        protected override void OnKeyUp(int key)
        {
        }

        /// <summary>
        /// Сопротивления рукояток изменились
        /// </summary>
        protected void OnResistorsValuesChanged(int[] values)
        {
            if (ResistorsValuesChanged != null)
                ResistorsValuesChanged(this, new ResistorsValueChangedEventArgs(values));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\KeyboardPultTepping.cs


using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Имитация теппинга пульта УПДК на клавиатуре
    /// </summary>
    public class KeyboardPultTepping : KeyboardPultBase, ITepping
    {
        private const int _teppingButtonCode = 32;
        private bool _teppingValue;

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public KeyboardPultTepping()
        {
        }

        /// <summary>
        /// Событие изменения теппинга 
        /// </summary>
        public event EventHandler<TeppingChangedEventArgs> TeppingValueChanged;

        /// <summary>
        /// Текущее значения теппинга
        /// </summary>
        public bool TeppingValue
        {
            get { return _teppingValue; }
            set
            {
                if (_teppingValue != value)
                {
                    _teppingValue = value;
                    OnTeppingValudChanged(value);
                }
            }
        }

        /// <summary>
        /// Обработчик нажатия на кнопку
        /// </summary>
        /// <param name="key">Код кнопки</param>
        protected override void OnKeyDown(int key)
        {
            if (key == _teppingButtonCode)
                TeppingValue = true;
        }

        /// <summary>
        /// Обработчик отпускания кнопки
        /// </summary>
        /// <param name="key">Код кнопки</param>
        protected override void OnKeyUp(int key)
        {
            if (key == _teppingButtonCode)
                TeppingValue = false;
        }

        /// <summary>
        /// Теппинг изменился
        /// </summary>
        protected void OnTeppingValudChanged(bool value)
        {
            if (TeppingValueChanged != null)
                TeppingValueChanged(this, new TeppingChangedEventArgs(value));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\NcomUsbPipe.cs


using System;
using System.Linq;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Обертка над методами WinApi для работы с USB устройствами Neurocom
    /// </summary>
    /// <remarks>
    /// Работа с устройствами идет через каналы Windows. Драйвера USB устройств
    /// исходные от вендора микроконтроллеров (Microchip). Фактически, с помощью
    /// методов класса формируется правильный путь к устройству и создается 
    /// дескриптор операционной системы для работы с ним. Чтение и запись
    /// производятся с использованием стантартных потоков <see cref="FileStream"/>
    /// (см. ремарки к <see cref="OpenDevice(Descriptor, AccessType)"/>)
    /// </remarks>
    public partial class NcomUsbPipe
    {
        /// <summary>
        /// Тип доступа к каналу устройства
        /// </summary>
        public enum AccessType : uint
        {
            Write,
            Read
        }

        /// <summary>
        /// Возвращает пути к интерфейсам всех подключенных USB устройств
        /// </summary>
        /// <remarks>
        /// Возвращаются все подключенные в данный момент устройства, т.е. пульты UPDK, eKoz,
        /// КСУ и т.д. Возвращаемая строка интерфейса устройства в дальнейшем используется 
        /// для передачи в методы WinApi
        /// </remarks>
        /// <returns>Перечисление путей подключенных устройств</returns>
        public static IEnumerable<Descriptor> GetConnectedDevices()
        {
            var devices = new List<Descriptor>();
            var guid = NativeMethods.MICROCHIP_GUID;
            var hDevinfo = IntPtr.Zero;

            try
            {
                // Запрашиваем построение множества элементов информации о подключенных устройствах
                // по заданному GUID. Полученное множество будет состоять из всех устройств
                // Microchip, подключенных в данный момент (пульты, КСУ, eKoz...)

                hDevinfo = NativeMethods.SetupDiGetClassDevs(ref guid, IntPtr.Zero, IntPtr.Zero,
                    (uint)(NativeMethods.DiGetClassFlags.DIGCF_PRESENT
                    | NativeMethods.DiGetClassFlags.DIGCF_DEVICEINTERFACE));

                if (hDevinfo == NativeMethods.INVALID_HANDLE_VALUE)
                    return devices;

                NativeMethods.SP_DEVICE_INTERFACE_DATA did = new NativeMethods.SP_DEVICE_INTERFACE_DATA();
                did.cbSize = Marshal.SizeOf(did);

                // Формируем пути для всех подключенных устройств

                var isSuccessful = true;
                var instance = 0U;
                do
                {
                    isSuccessful = NativeMethods.SetupDiEnumDeviceInterfaces(hDevinfo, IntPtr.Zero,
                        ref guid, instance++, ref did);

                    if (isSuccessful)
                    {
                        var path = getDevicePath(hDevinfo, ref did);
                        if (!string.IsNullOrEmpty(path))
                            devices.Add(new Descriptor(path));
                    }
                }
                while (isSuccessful);
            }
            finally
            {
                NativeMethods.SetupDiDestroyDeviceInfoList(hDevinfo);
            }

            return devices;
        }

        /// <summary>
        /// Возвращает подключенные устройства с заданным vid и pid
        /// </summary>
        /// <remarks>
        /// Пример строки <paramref name="vidPid"/>: vid_0471&pid_0736
        /// </remarks>
        /// <param name="vidPid">Vid и Pid искомого устройства</param>
        /// <returns>Перечисление найденных устройств</returns>
        public static IEnumerable<Descriptor> GetConnectedDevices(string vidPid)
        {
            return GetConnectedDevices().Where(descriptor => descriptor.DevicePath.Contains(vidPid));
        }

        /// <summary>
        /// Открытие открытие USB устройства для работы
        /// </summary>
        /// <remarks>
        /// Дескриптор устройства возвращает <see cref="GetConnectedDevices"/> либо
        /// <see cref="GetConnectedDevices(string)"/> для заданного VID и PID. Успешность
        /// выполненной операции оценивается по флагу <see cref="SafeHandle.IsInvalid"/>.
        /// Закрытие устройства осуществляется вызовом <see cref="SafeHandle.Dispose"/>.
        /// Работа с устройством предполагается как с обычным файлом (инкапсуляция
        /// анонимного канала Windows), т.е. создание пары <see cref="FileStream"/> 
        /// для чтения и записи, при этом стоит помнить, что открытый канал
        /// асинхронен, т.е. необходимо использовать правильные конструкторы у
        /// <see cref="FileStream"/>
        /// </remarks>
        /// <param name="descriptor">Дескриптор устройства</param>
        /// <param name="access">Тип доступа к устройству</param>
        /// <returns>Хендл канала для работы с устройством</returns>
        public static SafeFileHandle OpenDevice(Descriptor descriptor, AccessType access)
        {
            return NativeMethods.CreateFile(
                descriptor.DevicePath,
                access == AccessType.Read ? NativeMethods.GENERIC_READ : NativeMethods.GENERIC_WRITE,
                0,
                IntPtr.Zero,
                NativeMethods.OPEN_EXISTING,
                NativeMethods.FILE_ATTRIBUTE_NORMAL | NativeMethods.FILE_FLAG_OVERLAPPED,
                IntPtr.Zero);
        }

        /// <summary>
        /// Возвращает путь к интерфейсу устройства по заданному дескриптору устройства
        /// </summary>
        /// <param name="hDevinfo">Дескриптор множества подключенных устройств</param>
        /// <param name="did">Дескриптор интерфейса устройства</param>
        /// <returns>Путь к интерфейсу устройства</returns>
        private static string getDevicePath(IntPtr hDevinfo, ref NativeMethods.SP_DEVICE_INTERFACE_DATA did)
        {
            const int PATH_OFFSET = 4;
            var pDetailData = IntPtr.Zero;

            try
            {
                // Получаем детали интерфейса - текстовый путь интерфейса устройства.
                // В дальнейшем он передается методам WinApi, в качестве идентификатора 
                // устройства. Получение деталей интерфейса состоит из двух шагов: 
                // 1. запрашиваем размер структуры и аллоцируем память; 2. получаем
                // структуру с текстовым путем интерфейса

                var requiredSize = 0U;
                var isSuccessful = NativeMethods.SetupDiGetDeviceInterfaceDetail(hDevinfo,
                    ref did, IntPtr.Zero, 0, out requiredSize, IntPtr.Zero);

                // Именно так, функция вернет false и требуемый размер буфера, см. примечания в 
                // https://msdn.microsoft.com/en-us/library/windows/hardware/ff551120(v=vs.85).aspx

                if (isSuccessful)
                    return string.Empty;

                // Проблема с WinApi, подробности в тексте обсуждения (коротко - из-за специфики
                // объявления структуры в Setupapi.h параметр упаковки структуры зависит от 
                // рабочей машины)
                // http://stackoverflow.com/questions/10728644/properly-declare-sp-device-interface-detail-data-for-pinvoke
                // Решение взято в примере
                // http://www.pinvoke.net/default.aspx/setupapi.setupdigetdeviceinterfacedetail

                var cbSize = IntPtr.Size == 8 ? 8 : 4 + Marshal.SystemDefaultCharSize;
                pDetailData = Marshal.AllocHGlobal((int)requiredSize);
                Marshal.WriteInt32(pDetailData, cbSize);

                isSuccessful = NativeMethods.SetupDiGetDeviceInterfaceDetail(hDevinfo,
                    ref did, pDetailData, requiredSize, out requiredSize, IntPtr.Zero);

                if (!isSuccessful)
                    return string.Empty;

                return Marshal.PtrToStringUni(pDetailData + PATH_OFFSET);
            }
            finally
            {
                Marshal.FreeHGlobal(pDetailData);
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\NcomUsbPipe.Descriptor.cs


namespace Updk7.Tests.Pult
{
    public partial class NcomUsbPipe
    {
        /// <summary>
        /// Дескриптор подключенного USB устройства
        /// </summary>
        /// <remarks>
        /// Хранит путь до устройства
        /// </remarks>
        public class Descriptor
        {
            private static readonly string Endpoint = @"\MCHP_EP1";

            /// <summary>
            /// Создание экземпляра объекта
            /// </summary>
            /// <param name="device">Полный системный путь до объекта</param>
            public Descriptor(string device)
            {
                DevicePath = device + Endpoint;
            }

            /// <summary>
            /// Путь к устройству
            /// </summary>
            public string DevicePath { get; private set; }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\NcomUsbPipe.NativeMethods.cs


using System;
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;

namespace Updk7.Tests.Pult
{
    public partial class NcomUsbPipe
    {
        /// <summary>
        /// Методы WinApi для организации связи с USB устройствами Microchip
        /// </summary>
        /// <remarks>
        /// Сигнатуры методов и структур данных были взяты с p/Invoke
        /// <see cref="http://www.pinvoke.net/default.aspx/setupapi.setupdigetclassdevs"/>
        /// <see cref="http://www.pinvoke.net/default.aspx/setupapi.setupdienumdeviceinterfaces"/>
        /// <see cref="http://www.pinvoke.net/default.aspx/setupapi.setupdigetdeviceinterfacedetail"/>
        /// <see cref="http://www.pinvoke.net/default.aspx/Structures/SP_DEVICE_INTERFACE_DETAIL_DATA.html"/>
        /// <see cref="http://www.pinvoke.net/default.aspx/kernel32.createfile"/>
        /// </remarks>
        private static class NativeMethods
        {
            public static readonly Guid MICROCHIP_GUID = new Guid("{5354FA28-6D14-4E35-A1F5-75BB54E6030F}");
            public static readonly IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1);

            public const uint FILE_ATTRIBUTE_NORMAL = 0x80;
            public const uint FILE_FLAG_OVERLAPPED = 0x40000000;
            public const uint GENERIC_READ = 0x80000000;
            public const uint GENERIC_WRITE = 0x40000000;
            public const uint OPEN_EXISTING = 3;

            [Flags]
            public enum DiGetClassFlags : uint
            {
                DIGCF_DEFAULT = 0x00000001,
                DIGCF_PRESENT = 0x00000002,
                DIGCF_ALLCLASSES = 0x00000004,
                DIGCF_PROFILE = 0x00000008,
                DIGCF_DEVICEINTERFACE = 0x00000010,
            }

            [StructLayout(LayoutKind.Sequential)]
            public struct SP_DEVICE_INTERFACE_DATA
            {
                public int cbSize;
                public Guid interfaceClassGuid;
                public int flags;
                private UIntPtr reserved;
            }

            [DllImport("setupapi.dll", CharSet = CharSet.Auto)]
            public static extern void SetupDiDestroyDeviceInfoList(IntPtr DeviceInfoSet);

            [DllImport("setupapi.dll", CharSet = CharSet.Auto)]
            public static extern IntPtr SetupDiGetClassDevs(
                ref Guid ClassGuid, 
                IntPtr Enumerator,
                IntPtr hwndParent, 
                uint Flags);

            [DllImport("setupapi.dll", CharSet = CharSet.Auto, SetLastError = true)]
            public static extern bool SetupDiEnumDeviceInterfaces(
                IntPtr hDevInfo, 
                IntPtr devInfo,
                ref Guid interfaceClassGuid, 
                uint memberIndex, 
                ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData);

            [DllImport("setupapi.dll", CharSet = CharSet.Auto, SetLastError = true)]
            public static extern bool SetupDiGetDeviceInterfaceDetail(
                IntPtr hDevInfo,
                ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData,
                IntPtr deviceInterfaceDetailData,
                uint deviceInterfaceDetailDataSize,
                out uint requiredSize,
                IntPtr deviceInfoData);

            [DllImport("kernel32.dll", 
                CharSet = CharSet.Auto, 
                CallingConvention = CallingConvention.StdCall,
                SetLastError = true)]
            public static extern SafeFileHandle CreateFile(
                string lpFileName,
                uint dwDesiredAccess,
                uint dwShareMode,
                IntPtr SecurityAttributes,
                uint dwCreationDisposition,
                uint dwFlagsAndAttributes,
                IntPtr hTemplateFile);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\NcomUsbPipeTransport.cs


using System.Linq;
using System.IO;
using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Транспорт данных для USB устройств
    /// </summary>
    public class NcomUsbPipeTransport : IDataTransport
    {
        private readonly object _syncRoot = new object();
        private readonly string _connectionVidPid;
        private FileStream _readStream;
        private FileStream _writeStream;
        private volatile bool _isOpen = false;

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        /// <param name="connection">Дескриптор USB соединения</param>
        public NcomUsbPipeTransport(UsbConnection connection)
            : this(connection.VidPid)
        {
        }

        public NcomUsbPipeTransport(string vidPid)
        {
            _connectionVidPid = vidPid;
        }

        /// <summary>
        /// Флаг состояния транспорта
        /// </summary>
        public bool IsOpen => _isOpen;

        /// <summary>
        /// Открытие транспорта
        /// </summary>
        /// <remarks>
        /// Индекс открываемого устройства позволяет подключаться к нескольким 
        /// устройствам с одинаковыми vid и pid, например к нескольким пультам УПДК.
        /// После закрытия транспорта методом <see cref="Close"/> допустимо его 
        /// повторное октрытие
        /// </remarks>
        /// <param name="instance">Индекс открываемого устройства</param>
        public void Open(int instance = 0)
        {
            lock (_syncRoot)
            {
                Check.OperationRequirements(!IsOpen, ExceptionsMessages.AlreadyOpen);

                var devices = NcomUsbPipe.GetConnectedDevices(_connectionVidPid).ToList();
                Check.OperationRequirements(instance < devices.Count, ExceptionsMessages.NotConnected);

                _writeStream = createStream(devices[instance], NcomUsbPipe.AccessType.Write);
                _readStream = createStream(devices[instance], NcomUsbPipe.AccessType.Read);

                _isOpen = true;
            }
        }

        /// <summary>
        /// Закрытие транспорта
        /// </summary>
        public void Close()
        {
            lock (_syncRoot)
            {
                if (_readStream != null)
                {
                    _readStream.Dispose();
                    _readStream = null;
                }

                if (_writeStream != null)
                {
                    try
                    {
                        _writeStream.Dispose();
                    }
                    catch (Exception)
                    {
                    }
                    finally
                    {
                        _writeStream = null;
                    }
                }

                _isOpen = false;
            }
        }

        /// <summary>
        /// Чтение данных
        /// </summary>
        /// <param name="data">Буфер для чтения</param>
        /// <param name="size">Количество читаемых байт данных</param>
        /// <returns>Фактическое количество прочитанных данных</returns>
        public int Read(byte[] data, int size)
        {
            lock (_syncRoot)
            {
                Check.NotNull(data, nameof(data));
                Check.ValueRequirements(data.Length >= size, nameof(data));
                Check.OperationRequirements(IsOpen, ExceptionsMessages.TransportClosed);

                return _readStream.Read(data, 0, size);
            }
        }

        /// <summary>
        /// Запись данных
        /// </summary>
        /// <param name="data">Буфер для записи</param>
        /// <param name="size">Размер записываемых данных</param>
        public void Write(byte[] data, int size)
        {
            lock (_syncRoot)
            {
                Check.NotNull(data, nameof(data));
                Check.ValueRequirements(data.Length >= size, nameof(data));
                Check.OperationRequirements(IsOpen, ExceptionsMessages.TransportClosed);

                _writeStream.Write(data, 0, size);
                _writeStream.Flush();
            }
        }

        /// <summary>
        /// Освобождение ресурсов
        /// </summary>
        /// <remarks>
        /// Вызывается метод <see cref="Close"/>, поэтому допустимо повторное открытие транпорта
        /// </remarks>
        public void Dispose()
        {
            Close();
        }

        /// <summary>
        /// Создание потока для работы с устройством
        /// </summary>
        /// <param name="descriptor">Дескриптор устройства, для которого создается поток</param>
        /// <param name="access">Тип доступа к потоку</param>
        /// <returns>Поток</returns>
        private FileStream createStream(NcomUsbPipe.Descriptor descriptor, NcomUsbPipe.AccessType access)
        {
            const int StreamBufferSize = 1024;
            
            var handle = NcomUsbPipe.OpenDevice(descriptor, access);
            Check.OperationRequirements(!handle.IsInvalid, ExceptionsMessages.FaildToOpenDevice);

            return new FileStream(
                handle, 
                access ==  NcomUsbPipe.AccessType.Write ? FileAccess.Write : FileAccess.Read, 
                StreamBufferSize, 
                true);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\NcomUsbTransportMonitor.cs


using System;

namespace Updk7.Tests.Pult
{
    public class NcomUsbTransportMonitor : IDisposable
    {
        private UsbDeviceMonitor _usbMonitor;
        private IDataTransport _transport;

        public NcomUsbTransportMonitor(UsbConnection connection)
            : this(connection.Vid, connection.Pid)
        {
        }

        public NcomUsbTransportMonitor(string vid, string pid)
        {
            _usbMonitor = new UsbDeviceMonitor(vid, pid);
            _usbMonitor.IsConnectedChanged += onUsbMonitorIsConnectedChanged;
        }
        
        public void Dispose()
        {
            if (_usbMonitor != null)
            {
                _usbMonitor.IsConnectedChanged -= onUsbMonitorIsConnectedChanged;
                _usbMonitor.Dispose();
                _usbMonitor = null;
            }

            if (_transport != null)
            {
                _transport.Dispose();
                _transport = null;
            }
        }

        public event EventHandler IsConnectedChanged;

        private bool _isConnected;

        public bool IsConnected
        {
            get => _isConnected;
            set
            {
                if (value != _isConnected)
                {
                    _isConnected = value;
                    IsConnectedChanged?.Invoke(this, EventArgs.Empty);
                }
            }
        }

        public IDataTransport GetTransport() => _transport;

        public void Start()
        {
            _usbMonitor.Start();
        }

        private void onUsbMonitorIsConnectedChanged(object sender, EventArgs e)
        {
            if (_usbMonitor.IsConnected)
                _transport = createTransport(_usbMonitor.Connection);
            else if (_transport != null)
            {
                _transport.Close();
                _transport = null;
            }

            IsConnected = _transport != null;
        }

        private static IDataTransport createTransport(string connectionVidPid)
        {
            IDataTransport transport = null;

            try
            {
                transport = new NcomUsbPipeTransport(connectionVidPid);
                transport.Open(0);
            }
            catch (Exception)
            {
                if (transport != null)
                {
                    transport.Close();
                    transport = null;
                }
            }

            return transport;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultBase.cs

using System;
using System.Windows.Threading;
using Updk7.Tests.Pult;
using Updk7.Wpf;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Базовый класс пултта UPDK
    /// </summary>
    /// <remarks>
    /// Инкапсулирует опрос устройства. Предполагается, что наследники класса 
    /// реализуют какую-то одну часть по работе с пультом, например только кнопки,
    /// а результирующий пульт - композит из нескольких простых пультов. Поэтому
    /// пульты не управляют открытием и закрытием транспортом - один трансопрт 
    /// может использовать несколько простых пультов
    /// Пульт запускается посредством вызова метода Start(),
    /// останавливается методом Stop(),
    /// По окончании использования пульта вызвать Dispose, чтобы отсоединить транспорт
    /// </remarks>
    public abstract class PultBase : UsbDevice, IPult, IDisposable
    {
        public event EventHandler<DisconnectedEventArgs> Disconnected;
        /// <summary>
        /// Коды пульта
        /// </summary>
        private static class OpCodes
        {
            public const byte PULT_STOP = 0x00;
            public const byte PULT_GETDATA = 0x01;
        }

        private bool _disposedValue = false;
        private readonly DispatcherTimer _timer = new DispatcherTimer(DispatcherPriority.Render);
        protected const int DataPacketSize = 8;

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        /// <param name="transport">Транспорт сообщений пульта</param>
        public PultBase(IDataTransport transport) : base(transport)
        {
            Check.NotNull(transport, nameof(transport));
        }

        /// <summary>
        /// Финализатор
        /// </summary>
        ~PultBase()
        {
            Dispose(false);
        }

        /// <summary>
        /// Флаг работы пульта
        /// </summary>
        public bool IsRunning { get; protected set; } = false;

        /// <summary>
        /// Время обновления данных пульта
        /// </summary>
        public TimeSpan UpdateInterval { get; set; } = TimeSpan.FromMilliseconds(100);

        /// <summary>
        /// Запуск работы пульта
        /// </summary>
        public virtual void Start()
        {
            try
            {
                Check.OperationRequirements(!IsRunning, ExceptionsMessages.AlreadyRunning);
                Check.OperationRequirements(Transport.IsOpen, ExceptionsMessages.TransportClosed);

                runDataUpdate();
            }
            catch (Exception)
            {
                Disconnected?.Invoke(this, new DisconnectedEventArgs() { ExceptionCode = ExceptionsCode.DeviceNotWorking, Exception = new PultException("Ошибка пульта") });
            }
        }

        /// <summary>
        /// Остановка пульта
        /// </summary>
        public virtual void Stop()
        {
            try
            {
                if (Transport != null && Transport.IsOpen)
                    WriteCommand(OpCodes.PULT_STOP, 0);

                stopDataUpdate();
            }
            catch (Exception ex)
            {
                Disconnected?.Invoke(this, new DisconnectedEventArgs() { ExceptionCode = ExceptionsCode.DeviceNotWorking, Exception = new PultException("Ошибка пульта") });
            }
        }

        /// <summary>
        /// Освобождение русурсов
        /// </summary>
        public void Dispose()
        {
            Dispose(true);
        }

        /// <summary>
        /// Запуск работы пульта
        /// </summary>
        /// <param name="command">Команда режима пульта</param>
        /// <param name="parameter">Параметр режима</param>
        protected void Start(byte command, ushort parameter)
        {
            Check.OperationRequirements(Transport.IsOpen, ExceptionsMessages.TransportClosed);
            try
            {
                Stop();
                WriteCommand(command, parameter);
                runDataUpdate();
            }
            catch (Exception)
            {
                Disconnected?.Invoke(this, new DisconnectedEventArgs() { ExceptionCode = ExceptionsCode.DeviceNotWorking, Exception = new PultException("Ошибка пульта") });
            }
        }

        /// <summary>
        /// Обработчик пакетов пульта
        /// </summary>
        /// <param name="index">Смещение пакета в буфере данных пульта</param>
        protected abstract void HandlePacket(int index);

        /// <summary>
        /// Освобождение русурсов
        /// </summary>
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposedValue)
            {
                if (disposing && IsRunning)
                {
                    Stop();
                }

                Transport = null;
                _disposedValue = true;
            }
        }

        private void runDataUpdate()
        {
            _timer.Interval = UpdateInterval;
            _timer.IsEnabled = true;
            _timer.Tick += updateTestData;
            _timer.Start();
            IsRunning = true;
        }

        private void stopDataUpdate()
        {
            _timer.IsEnabled = false;
            _timer.Stop();
            _timer.Tick -= updateTestData;
            IsRunning = false;
        }

        private void updateTestData(object sender, EventArgs e)
        {
            if (!Transport.IsOpen || !IsRunning)
                return;

            try
            {
                WriteCommand(OpCodes.PULT_GETDATA, 0);
                var count = Transport.Read(Buffer, Buffer.Length);
                var packetsCount = count / DataPacketSize;

                for (var i = 0; i < count; i += DataPacketSize)
                {
                    if (Buffer[i] == OpCodes.PULT_GETDATA)
                        HandlePacket(i);
                }
            }
            catch (UnauthorizedAccessException ex)
            {
                AppLog.Current.Error(ex.ToString());
                Transport.Close();
                Disconnected?.Invoke(this, new DisconnectedEventArgs() { ExceptionCode = ExceptionsCode.DevideNotConnected, Exception = ex });
            }
            catch (System.IO.IOException ex)
            {
                AppLog.Current.Error(ex.ToString());
                Transport.Close();
                Disconnected?.Invoke(this, new DisconnectedEventArgs() { ExceptionCode = ExceptionsCode.DeviceNotWorking, Exception = ex });
            }
            catch (Exception ex)
            {
                AppLog.Current.Error(ex.ToString());
                Transport.Close();
                Disconnected?.Invoke(this, new DisconnectedEventArgs() { ExceptionCode = ExceptionsCode.None, Exception = ex });
            }
        }
    }

    public class DisconnectedEventArgs : EventArgs
    {
        public ExceptionsCode ExceptionCode { get; set; }
        public Exception Exception { get; set; }
        public DisconnectedEventArgs()
        {
        }
    }

    public enum ExceptionsCode
    {
        None,
        DevideNotConnected,
        DeviceNotWorking
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultBlinkDown.cs


using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Событие нажатия на кнопку при мерцании с понижением частоты
    /// </summary>
    public class BlinkDownButtonPressedEventArgs : EventArgs
    {
        public BlinkDownButtonPressedEventArgs(int stopFrequency)
        {
            StopFrequency = stopFrequency;
        }

        /// <summary>
        /// Частота остановки мерцаний в Гц
        /// </summary>
        public int StopFrequency { get; private set; }
    }

    /// <summary>
    /// Пульт с режимом мерцания светодиода с понижением частоты
    /// </summary>
    public class PultBlinkDown : PultBase
    {
        /// <summary>
        /// Коды пульта
        /// </summary>
        private static class OpCodes
        {
            public const byte PULT_BIGLED_DOWN = 0x09;
        }

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public PultBlinkDown(IDataTransport transport) : base(transport)
        {
        }

        /// <summary>
        /// Событие нажатия на кнопку при мерцаниях
        /// </summary>
        public event EventHandler<BlinkDownButtonPressedEventArgs> ButtonPressed;

        /// <summary>
        /// Запуск мерцания
        /// </summary>
        public override void Start()
        {
            Start(OpCodes.PULT_BIGLED_DOWN, 0);
        }

        /// <summary>
        /// Обработчик пакетов пульта
        /// </summary>
        protected override void HandlePacket(int index)
        {
            if (Buffer[index + 1] != OpCodes.PULT_BIGLED_DOWN)
                return;

            if (ButtonPressed != null)
                ButtonPressed(this, new BlinkDownButtonPressedEventArgs(Buffer[index + 2]));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultBlinkUp.cs


using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Событие нажатия на кнопку при мерцании с повышением частоты
    /// </summary>
    public class BlinkUpButtonPressedEvevntArgs : EventArgs
    {
        public BlinkUpButtonPressedEvevntArgs(int stopFrequency)
        {
            StopFrequency = stopFrequency;
        }

        /// <summary>
        /// Частота остановки мерцаний в Гц
        /// </summary>
        public int StopFrequency { get; private set; }
    }

    /// <summary>
    /// Пульт с режимом мерцания светодиода с повышением частоты
    /// </summary>
    public class PultBlinkUp : PultBase
    {
        /// <summary>
        /// Коды пульта
        /// </summary>
        private static class OpCodes
        {
            public const byte PULT_BIGLED_UP = 0x08;
        }

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public PultBlinkUp(IDataTransport transport) : base(transport)
        {
        }

        /// <summary>
        /// Событие нажатия на кнопку при мерцаниях
        /// </summary>
        public event EventHandler<BlinkUpButtonPressedEvevntArgs> ButtonPressed;

        /// <summary>
        /// Запуск мерцания
        /// </summary>
        public override void Start()
        {
            Start(OpCodes.PULT_BIGLED_UP, 0);
        }

        /// <summary>
        /// Обработчик пакетов пульта
        /// </summary>
        protected override void HandlePacket(int index)
        {
            if (Buffer[index + 1] != OpCodes.PULT_BIGLED_UP)
                return;

            if (ButtonPressed != null)
                ButtonPressed(this, new BlinkUpButtonPressedEvevntArgs(Buffer[index + 2]));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultButtons.cs


using System;
using System.Diagnostics;
using System.Windows.Threading;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Пульт с кнопками
    /// </summary>
    public class PultButtons : PultBase, IButtons
    {
        /// <summary>
        /// Коды пульта
        /// </summary>
        private static class OpCodes
        {
            public const byte PULT_KEYS_START = 0x02;
        }

        private const int _pressTreshold = 200;

        private bool _isPressed;
        /// <summary>
        /// Нажата ли кнопка
        /// </summary>
        public bool IsPressed
        {
            get { return _isPressed; }
            set
            {
                IsPressedOldValue = _isPressed;
                _isPressed = value;
                if (_isPressed)
                {
                    _resetButtonsTimer.Stop();
                    _resetButtonsTimer.Start();
                }
                else
                {
                    _resetButtonsTimer.Stop();
                }
            }
        }

        /// <summary>
        /// Предыдущее значение нажали ли кнопка
        /// </summary>
        public bool IsPressedOldValue { get; set; } = false;

        private DispatcherTimer _resetButtonsTimer = new DispatcherTimer();


        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public PultButtons(IDataTransport transport) : base(transport)
        {
        }

        /// <summary>
        /// Событие нажатия на кнопку
        /// </summary>
        public event EventHandler<ButtonPressedEventArgs> ButtonPressed;

        /// <summary>
        /// Флаг сброса таймера кнопок при нажатии
        /// </summary>
        public bool ResetTimerOnButtonPress { get; set; } = true;

        /// <summary>
        /// Старт работы пульта
        /// </summary>
        public override void Start()
        {
            _resetButtonsTimer.Tick -= ResetTimerTick;
            _resetButtonsTimer.Stop();
            _resetButtonsTimer.Interval = UpdateInterval;
            _resetButtonsTimer.Tick += ResetTimerTick;

            Start(OpCodes.PULT_KEYS_START, Convert.ToUInt16(ResetTimerOnButtonPress));
        }

        public override void Stop()
        {
            base.Stop();
        }

        private void ResetTimerTick(object sender, EventArgs e)
        {
            IsPressed = false;
        }

        /// <summary>
        /// Обработчик пакетов пульта
        /// </summary>
        protected override void HandlePacket(int index)
        {
            if (Buffer[index + 1] != OpCodes.PULT_KEYS_START)
                return;

            var button = (PultButton)Buffer[index + 2];
            if (button == PultButton.None)
                return;

            var time = BitConverter.ToInt32(Buffer, index + 4);
            if (!IsPressed)
                OnButtonPressed(button, time);

            IsPressed = true;
        }

        /// <summary>
        /// Кнопка нажата
        /// </summary>
        protected void OnButtonPressed(PultButton button, int time)
        {
            if (ButtonPressed != null)
            {
                ButtonPressed(this, new ButtonPressedEventArgs(button, time));
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultException.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Pult
{
    public class PultException : Exception
    {
        public PultException(string message) : base(message)
        {
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultGsr.cs


using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Пульт с измерением сопротивления кожи
    /// </summary>
    public class PultGsr : PultBase, IGsr
    {
        /// <summary>
        /// Коды пульта
        /// </summary>
        private static class OpCodes
        {
            public const byte PULT_GSR_START = 0x0a;
        }

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public PultGsr(IDataTransport transport) : base(transport)
        {
            UpdateInterval = TimeSpan.FromMilliseconds(25);
        }

        /// <summary>
        /// Событие изменения измеряемого сопротивления
        /// </summary>
        public event EventHandler<GsrValueCgangedEventArgs> GsrValueChanged;

        private uint _gsrValue;

        /// <summary>
        /// Измереннео сопротивление в Ом'ах
        /// </summary>
        public uint GsrValue
        {
            get { return _gsrValue; }
            protected set
            {
                if (_gsrValue != value)
                {
                    var oldGsr = _gsrValue;
                    _gsrValue = value;
                    OnGsrValueChanged(oldGsr, value);
                }
            }
        }

        /// <summary>
        /// Запуск измерения сопротивлений
        /// </summary>
        public override void Start()
        {
            Start(OpCodes.PULT_GSR_START, 0);
        }

        /// <summary>
        /// Обработчик пакетов пульта
        /// </summary>
        protected override void HandlePacket(int index)
        {
            if (Buffer[index + 1] != OpCodes.PULT_GSR_START)
                return;

            GsrValue = BitConverter.ToUInt32(Buffer, index + 4);
        }

        /// <summary>
        /// Измеряемое сопротивление изменилось
        /// </summary>
        protected void OnGsrValueChanged(uint oldValue, uint newValue)
        {
            if (GsrValueChanged != null)
                GsrValueChanged(this, new GsrValueCgangedEventArgs(oldValue, newValue));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultGsrCalibration.cs


using System;
using System.Runtime.InteropServices;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Калибровочные константы измерителя сопротивления кожи
    /// </summary>
    public struct GsrCalibrationValues
    {
        public static GsrCalibrationValues Zeros = new GsrCalibrationValues();

        public ushort Min;
        public ushort Max;
    }

    /// <summary>
    /// Пульт с калибровкой измерителя сопротивления кожи
    /// </summary>
    public class PultGsrCalibration : PultBase
    {
        /// <summary>
        /// Коды пульта
        /// </summary>
        private static class OpCodes
        {
            public const byte PULT_GSR_CALIBRATE = 0x0c;
            public const byte PULT_GSR_GETCALIBRATE = 0x0d;
        }

        private static readonly int _gsrCalibrationValuesSize = Marshal.SizeOf(typeof(GsrCalibrationValues));

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public PultGsrCalibration(IDataTransport transport) : base(transport)
        {
        }

        /// <summary>
        /// Режим калибровки
        /// </summary>
        public ushort CalibrationMode { get; set; }

        /// <summary>
        /// Запуск калибровки
        /// </summary>
        public override void Start()
        {
            WriteCommand(OpCodes.PULT_GSR_CALIBRATE, CalibrationMode);
            IsRunning = true;
        }

        /// <summary>
        /// Запрос калибровочных значений
        /// </summary>
        /// <remarks>
        /// При запросе калибровочных знаечний процесс калибровки останавливается
        /// </remarks>
        /// <returns>Калибровочные знаечние</returns>
        public GsrCalibrationValues GetGsrCalibrationValues()
        {
            Stop();

            WriteCommand(OpCodes.PULT_GSR_GETCALIBRATE, 0);

            var readCount = Transport.Read(Buffer, _gsrCalibrationValuesSize);
            Check.OperationRequirements(readCount == _gsrCalibrationValuesSize, ExceptionsMessages.FaildToGetData);

            var values = GsrCalibrationValues.Zeros;
            values.Min = BitConverter.ToUInt16(Buffer, 0);
            values.Max = BitConverter.ToUInt16(Buffer, 2);

            return values;
        }

        /// <summary>
        /// Обработчик пакетов пульта
        /// </summary>
        protected override void HandlePacket(int index)
        {
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultLed.cs


using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Пульт со светодиодом
    /// </summary>
    public class PultLed : PultBase
    {
        /// <summary>
        /// Коды пульта
        /// </summary>
        private static class OpCodes
        {
            public const byte PULT_BIGLED_SET = 0x07;
        }

        protected bool _ledState = false;

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public PultLed(IDataTransport transport) : base(transport)
        {
        }

        /// <summary>
        /// Состояние светодиода
        /// </summary>
        public bool LedState
        {
            get { return _ledState; }
            set
            {
                if (_ledState != value)
                {
                    Check.OperationRequirements(Transport.IsOpen, ExceptionsMessages.NotConnected);
                    _ledState = value;
                    setLedState(_ledState);
                }
            }
        }


        /// <summary>
        /// Обработчик пакетов пульта
        /// </summary>
        protected override void HandlePacket(int index)
        {
        }

        private void setLedState(bool state)
        {
            try
            {
                WriteCommand(OpCodes.PULT_BIGLED_SET, Convert.ToUInt16(state));
            }
            catch
            {
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultMonitor.cs


using System;
using System.Windows.Threading;

namespace Updk7.Tests.Pult
{
    [Obsolete]
    public class PultMonitor : IPultMonitor
    {
        private DispatcherTimer _timer = new DispatcherTimer(DispatcherPriority.Background);

        public PultMonitor()
        {
            _timer.Tick += onTimerTick;
        }

        private IDataTransport _transport;

        public IDataTransport Transport 
        {
            get { return _transport; }
            private set
            {
                _transport = value;
                IsConnected = _transport != null && _transport.IsOpen;
            }
        }

        public event EventHandler IsConnectedChanged;

        private bool _isConnected = false;

        public bool IsConnected
        {
            get { return _isConnected; }
            private set
            {
                if (value != _isConnected)
                {
                    _isConnected = value;
                    IsConnectedChanged?.Invoke(this, EventArgs.Empty);
                }
            }
        }

        public bool IsRunning => _timer.IsEnabled;

        public TimeSpan PollPeriod { get; set; } = TimeSpan.FromSeconds(3);

        public void Run()
        {
            _timer.Interval = PollPeriod;
            _timer.Start();
        }

        public void Stop()
        {
            _timer.IsEnabled = false;
        }

        private void onTimerTick(object sender, EventArgs e)
        {
            IDataTransport transport = Transport;

            try
            {
                if (transport == null)
                {
                    var connection = UsbConnection.CreateUpdkConnection();
                    transport = new NcomUsbPipeTransport(connection);
                    transport.Open(0);
                }

                var info = UsbDevice.GetDeviceInfo(transport);
                if (info == null)
                    transport.Close();
            }
            catch (Exception)
            {
                transport.Close();
            }
            finally
            {
                Transport = transport.IsOpen
                    ? transport
                    : null;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultResistors.cs


using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Пульт с рукоятками (потенциометрами)
    /// </summary>
    public class PultResistors : PultBase, IResistors
    {
        /// <summary>
        /// Коды пульта
        /// </summary>
        private static class OpCodes
        {
            public const byte PULT_RESISTORS_START = 0x03;
        }

        private static readonly int[] _resistorsValuesUndefined = new int[] { -1, 1 };
        private const int _resistorsLowTreshold = 4;

        private int[] _resistorsValues = _resistorsValuesUndefined;

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public PultResistors(IDataTransport transport) : base(transport)
        {
            UpdateInterval = TimeSpan.FromMilliseconds(50);
        }

        /// <summary>
        /// Событие изменения сопротивлений рукояток пульта
        /// </summary>
        public event EventHandler<ResistorsValueChangedEventArgs> ResistorsValuesChanged;

        public bool NotifyOnChange { get; set; } = true;

        /// <summary>
        /// Сопротивления рукояток пульта
        /// </summary>
        public int[] ResistorsValues
        {
            get { return _resistorsValues; }
            protected set
            {
                Check.NotNull(value, nameof(ResistorsValues));
                Check.OperationRequirements(value.Length == _resistorsValuesUndefined.Length,
                    nameof(ResistorsValues));
                
                if (!NotifyOnChange)
                    OnResistorsValuesChanged(value);
                else
                {
                    if ((value[0] != _resistorsValues[0]) || (value[1] != _resistorsValues[1]))
                        OnResistorsValuesChanged(value);

                    _resistorsValues = value;
                }
            }
        }

        /// <summary>
        /// Старт работы пульта
        /// </summary>
        public override void Start()
        {
            Start(OpCodes.PULT_RESISTORS_START, 0);
        }

        /// <summary>
        /// Обработчик пакетов пульта
        /// </summary>
        protected override void HandlePacket(int index)
        {
            if (Buffer[index + 1] != OpCodes.PULT_RESISTORS_START)
                return;

            var r1 = Buffer[index + 2];
            if (r1 < _resistorsLowTreshold)
                r1 = 0;

            var r2 = Buffer[index + 3];
            if (r2 < _resistorsLowTreshold)
                r2 = 0;

            ResistorsValues = new int[] { r1, r2 };
        }

        /// <summary>
        /// Сопротивления рукояток изменились
        /// </summary>
        protected void OnResistorsValuesChanged(int[] values)
        {
            if (ResistorsValuesChanged != null)
                ResistorsValuesChanged(this, new ResistorsValueChangedEventArgs(values));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultResistorsCalibration.cs


using System;
using System.Runtime.InteropServices;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Калибровочные коэффициенты рукояток пульта
    /// </summary>
    public struct ResistorsCalibrationValues
    {
        public static readonly ResistorsCalibrationValues Zeros = new ResistorsCalibrationValues();

        public ushort Lmn;
        public ushort Lmx;
        public ushort Rmn;
        public ushort Rmx;

        public bool IsValid
        {
            get
            {
                Func<ushort, bool> isValid = v => (v != 0) && (v != ushort.MaxValue);
                Func<ushort, ushort, bool> isOrdered = (min, max) => min < max;

                return isValid(Lmn) &&
                    isValid(Lmx) &&
                    isValid(Rmn) &&
                    isValid(Rmx) &&
                    isOrdered(Lmn, Lmx) &&
                    isOrdered(Rmn, Rmx);
            }
        }
    }

    /// <summary>
    /// Пульт с калибровкой рукояток 
    /// </summary>
    public class PultResistorsCalibration : PultBase
    {
        /// <summary>
        /// Коды пульта
        /// </summary>
        private static class OpCodes
        {
            public const byte PULT_RESISTORS_CALIBRATE = 0x04;
            public const byte PULT_RESISTORS_GETCALIBRATE = 0x05;
        }

        private static readonly int _resistorsCalibrationValuesSize =
            Marshal.SizeOf(typeof(ResistorsCalibrationValues));

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public PultResistorsCalibration(IDataTransport transport) : base(transport)
        {
        }

        /// <summary>
        /// Запуск калибровки
        /// </summary>
        public override void Start()
        {
            WriteCommand(OpCodes.PULT_RESISTORS_CALIBRATE, 0);
            IsRunning = true;
        }

        /// <summary>
        /// Запрос калибровочных значений
        /// </summary>
        /// <remarks>
        /// При запросе калибровочных знаечний процесс калибровки останавливается
        /// </remarks>
        /// <returns>Калибровочные знаечние</returns>
        public ResistorsCalibrationValues GetResistorsCalibrationValues()
        {
            Stop();
            
            WriteCommand(OpCodes.PULT_RESISTORS_GETCALIBRATE, 0);

            var readCount = Transport.Read(Buffer, _resistorsCalibrationValuesSize);
            Check.OperationRequirements(readCount == _resistorsCalibrationValuesSize,
                ExceptionsMessages.FaildToGetData);

            var values = ResistorsCalibrationValues.Zeros;
            values.Lmn = BitConverter.ToUInt16(Buffer, 0);
            values.Lmx = BitConverter.ToUInt16(Buffer, 2);
            values.Rmn = BitConverter.ToUInt16(Buffer, 4);
            values.Rmx = BitConverter.ToUInt16(Buffer, 6);

            return values;
        }

        /// <summary>
        /// Обработчик пакетов пульта
        /// </summary>
        protected override void HandlePacket(int index)
        {
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultTepping.cs


using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Пульт с теппингом
    /// </summary>
    public class PultTepping : PultBase, ITepping
    {
        /// <summary>
        /// Коды пульта
        /// </summary>
        private static class OpCodes
        {
            public const byte PULT_TEPPING_START = 0x06;
        }

        private bool _teppingValue = false;

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public PultTepping(IDataTransport transport) : base(transport)
        {
            UpdateInterval = TimeSpan.FromMilliseconds(20);
        }

        /// <summary>
        /// Событие изменения теппинга 
        /// </summary>
        public event EventHandler<TeppingChangedEventArgs> TeppingValueChanged;

        /// <summary>
        /// Текущее значения теппинга
        /// </summary>
        public bool TeppingValue
        {
            get { return _teppingValue; }
            protected set
            {
                if (value != _teppingValue)
                {
                    _teppingValue = value;
                    OnTeppingValudChanged(value);
                }
            }
        }

        /// <summary>
        /// Запуск проверки теппинга
        /// </summary>
        public override void Start()
        {
            Start(OpCodes.PULT_TEPPING_START, 0);
        }

        /// <summary>
        /// Обработчик пакетов пульта
        /// </summary>
        protected override void HandlePacket(int index)
        {
            if (Buffer[index + 1] != OpCodes.PULT_TEPPING_START)
                return;

            TeppingValue = Buffer[index + 5] > 0;
        }

        /// <summary>
        /// Теппинг изменился
        /// </summary>
        protected void OnTeppingValudChanged(bool value)
        {
            if (TeppingValueChanged != null)
                TeppingValueChanged(this, new TeppingChangedEventArgs(value));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultTremor.cs


using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Пульт с тремором
    /// </summary>
    public class PultTremor : PultBase, ITremor
    {
        /// <summary>
        /// Коды пульта
        /// </summary>
        private static class OpCodes
        {
            public const byte PULT_TREMOR_START = 0x06;
        }

        private Point _tremorPosition;
        private bool _inSilo;
        private bool _tepping;


        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public PultTremor(IDataTransport transport) : base(transport)
        {
            UpdateInterval = TimeSpan.FromMilliseconds(50);
        }

        /// <summary>
        /// Событие изменения тремора
        /// </summary>
        public event EventHandler<TremorChangedEventArgs> TremorChanged;

        /// <summary>
        /// Событие изменения позиции тремора
        /// </summary>
        public event EventHandler<TremorPositionChangedEventArgs> TremorPositionChanged;

        /// <summary>
        /// Событие изменения теппинга
        /// </summary>
        public event EventHandler<TeppingChangedEventArgs> TeppingChanged;

        /// <summary>
        /// Событие касания стенки шахты
        /// </summary>
        public event EventHandler<InSiloChangedEventArgs> InSiloChanged;

        /// <summary>
        /// Текущая позиция тремора
        /// </summary>
        public Point TremorPosition
        {
            get { return _tremorPosition; }
            protected set
            {
                if (_tremorPosition != value)
                {
                    _tremorPosition = value;
                    OnTremorPositionChanged(value);
                }
            }
        }

        /// <summary>
        /// Флаг "щуп коснулся шахты"
        /// </summary>
        public bool InSilo
        {
            get { return _inSilo; }
            protected set
            {
                if (_inSilo != value)
                {
                    _inSilo = value;
                    OnInSiloChnaged(value);
                }
            }
        }

        /// <summary>
        /// Знаечние теппинга
        /// </summary>
        public bool Tepping
        {
            get { return _tepping; }
            protected set
            {
                if (_tepping != value)
                {
                    _tepping = value;
                    OnTeppingChanged(value);
                }
            }
        }

        /// <summary>
        /// Запуск обработки тремора
        /// </summary>
        public override void Start()
        {
            Start(OpCodes.PULT_TREMOR_START, 0);
        }

        /// <summary>
        /// Обработчик пакетов пульта
        /// </summary>
        protected override void HandlePacket(int index)
        {
            if (Buffer[index + 1] != OpCodes.PULT_TREMOR_START)
                return;

            var point = TremorPosition;

            var x = (double)Buffer[index + 2];
            if (x >= 2 && x <= 12)
            {
                // в начале стоит знак минус чтобы отображение из зеркального превратить в нормальное
                // это может быть удобно для тестирования
                point.X = -(x - 7.5) / 5.5d;
            }

            var y = (double)Buffer[index + 3];
            if (y >= 2 && y <= 12)
                point.Y = (y - 7.5) / 5.5d;

            InSilo = Buffer[index + 4] > 0;
            Tepping = Buffer[index + 5] > 0;
            TremorPosition = point;

            var rawCoords = new Point(x, y);
            OnTremorChanged(TremorPosition, point, rawCoords, InSilo, Tepping);
        }

        /// <summary>
        /// Изменился тремор
        /// </summary>
        protected void OnTremorChanged(Point oldPoint, Point newPoint, Point rawCoords, bool silo, bool tep)
        {
            if (TremorChanged != null)
            {
                var args = new TremorChangedEventArgs(oldPoint, newPoint, silo, tep);
                args.NewPosDirty = rawCoords;
                TremorChanged(this, args);
            }
        }

        /// <summary>
        /// Изменилась позиция тремора
        /// </summary>
        protected void OnTremorPositionChanged(Point position)
        {
            if (TremorPositionChanged != null)
                TremorPositionChanged(this, new TremorPositionChangedEventArgs(position));
        }

        /// <summary>
        /// Изменился теппинг
        /// </summary>
        protected void OnTeppingChanged(bool tepping)
        {
            if (TeppingChanged != null)
                TeppingChanged(this, new TeppingChangedEventArgs(tepping));
        }

        /// <summary>
        /// Изменился флаг "щуп коснулся шахты"
        /// </summary>
        protected void OnInSiloChnaged(bool value)
        {
            if (InSiloChanged != null)
                InSiloChanged(this, new InSiloChangedEventArgs(value));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\PultTremorCalibration.cs


using System;
using System.Runtime.InteropServices;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Калибровочные коэффициенты тремора
    /// </summary>
    public struct TremorCalibrationValues
    {
        public static readonly TremorCalibrationValues Zeros = new TremorCalibrationValues();

        public ushort X1Mx;
        public ushort X1Mn;
        public ushort X2Mx;
        public ushort X2Mn;
        public ushort Y1Mx;
        public ushort Y1Mn;
        public ushort Y2Mx;
        public ushort Y2Mn;
    }

    /// <summary>
    /// Пульт с калибровкой тремора
    /// </summary>
    public class PultTremorCalibration : PultBase
    {
        /// <summary>
        /// Коды пульта
        /// </summary>
        public static class OpCodes
        {
            public const byte PULT_TREMOR_CALIBRATE = 0x0e;
            public const byte PULT_TREMOR_GETCALIBRATE = 0x0f;
        }

        private static readonly int _tremorCalibrationValuesSize = 
            Marshal.SizeOf(typeof(TremorCalibrationValues));

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        public PultTremorCalibration(IDataTransport transport) : base(transport)
        {
        }

        /// <summary>
        /// Режим калибровки
        /// </summary>
        public ushort CalibrationMode { get; set; }

        /// <summary>
        /// Запуск калибровки
        /// </summary>
        public override void Start()
        {
            WriteCommand(OpCodes.PULT_TREMOR_CALIBRATE, CalibrationMode);
            IsRunning = true;
        }

        /// <summary>
        /// Запрос калибровочных значений
        /// </summary>
        /// <remarks>
        /// При запросе калибровочных знаечний процесс калибровки останавливается
        /// </remarks>
        /// <returns>Калибровочные знаечние</returns>
        public TremorCalibrationValues GetTremorCalibrationValues()
        {
            Stop();

            WriteCommand(OpCodes.PULT_TREMOR_GETCALIBRATE, 0);

            var readCount = Transport.Read(Buffer, _tremorCalibrationValuesSize);
            Check.OperationRequirements(readCount == _tremorCalibrationValuesSize, 
                ExceptionsMessages.FaildToGetData);

            var values = TremorCalibrationValues.Zeros;
            values.X1Mx = BitConverter.ToUInt16(Buffer, 0);
            values.X1Mn = BitConverter.ToUInt16(Buffer, 2);
            values.X2Mx = BitConverter.ToUInt16(Buffer, 4);
            values.X2Mn = BitConverter.ToUInt16(Buffer, 6);
            values.Y1Mx = BitConverter.ToUInt16(Buffer, 8);
            values.Y1Mn = BitConverter.ToUInt16(Buffer, 10);
            values.Y2Mx = BitConverter.ToUInt16(Buffer, 12);
            values.Y2Mn = BitConverter.ToUInt16(Buffer, 14);

            return values;
        }

        /// <summary>
        /// Обработчик пакетов пульта
        /// </summary>
        protected override void HandlePacket(int index)
        {
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\UpdkDeskMonitor.cs


using System;

namespace Updk7.Tests.Pult
{
    public enum UpdkDeskType
    {
        None,
        NcomUsb,
        FtdiUsb
    }

    public class UpdkDeskMonitor : IDisposable
    {
        private FtdiDesk.DeskLink _ftdiLink;
        private FtdiDesk.DeskLinkMonitor _ftdiMonitor;
        private FtdiDeskProxy _ftdiProxy;

        private NcomUsbTransportMonitor _usbMonitor;

        private bool _disposed;

        public UpdkDeskMonitor()
        {
            _ftdiLink = new FtdiDesk.DeskLink();
            _ftdiProxy = new FtdiDeskProxy(_ftdiLink);
            _ftdiMonitor = new FtdiDesk.DeskLinkMonitor(_ftdiLink);
            _ftdiMonitor.IsConnectedChanged += onIsConnectedChanged;

            _usbMonitor = new NcomUsbTransportMonitor(UsbConnection.CreateUpdkConnection());
            _usbMonitor.IsConnectedChanged += onIsConnectedChanged;
        }

        public event EventHandler IsConnectedChanged;

        public UpdkDeskType DeskType { get; private set; } = UpdkDeskType.None;

        private bool _isConnected;

        public bool IsConnected
        {
            get => _isConnected;
            set
            {
                if (value != _isConnected)
                {
                    _isConnected = value;
                    IsConnectedChanged?.Invoke(this, EventArgs.Empty);
                }
            }
        }

        public void Dispose()
        {
            if (!_disposed)
            {
                _ftdiMonitor.IsConnectedChanged -= onIsConnectedChanged;
                _usbMonitor.IsConnectedChanged -= onIsConnectedChanged;

                _ftdiProxy.Dispose();
                _ftdiMonitor.Dispose();
                _ftdiLink.Dispose();
                _usbMonitor.Dispose();

                _disposed = true;
            }
        }

        public void Start()
        {
            _ftdiMonitor.Start();
            _usbMonitor.Start();
        }

        public IDataTransport GetTransport()
        {
            if (_ftdiLink.IsConnected)
                return _ftdiProxy;
            else if (_usbMonitor.IsConnected)
                return _usbMonitor.GetTransport();

            return null;
        }

        public FtdiDesk.DeskLink GetFtdiUsbDevice()
        {
            return _ftdiLink.IsConnected ? _ftdiLink : null;
        }

        public IDataTransport GetNcomUsbDevice()
        {
            return _usbMonitor.IsConnected ? _usbMonitor.GetTransport() : null;
        }

        private void onIsConnectedChanged(object sender, EventArgs e)
        {
            if (_ftdiLink.IsConnected)
                DeskType = UpdkDeskType.FtdiUsb;
            else if (_usbMonitor.IsConnected)
                DeskType = UpdkDeskType.NcomUsb;
            else
                DeskType = UpdkDeskType.None;

            IsConnected = _ftdiLink.IsConnected || _usbMonitor.IsConnected;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\UsbConnection.cs


namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Дескриптор USB-подключения
    /// </summary>
    public class UsbConnection
    {
        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        /// <param name="vid">VID-устройства</param>
        /// <param name="pid">PID-устройства</param>
        public UsbConnection(string vid, string pid)
        {
            Check.StringNotEmpty(vid, ExceptionsMessages.EmtpyString);
            Check.StringNotEmpty(pid, ExceptionsMessages.EmtpyString);

            Vid = vid;
            Pid = pid;
            VidPid = $"{vid}&{pid}";
        }

        /// <summary>
        /// VID-устройства
        /// </summary>
        public string Vid { get; private set; }

        /// <summary>
        /// PID-устройства
        /// </summary>
        public string Pid { get; private set; }

        /// <summary>
        /// Совместная строка VID & PID
        /// </summary>
        public string VidPid { get; private set; }

        /// <summary>
        /// Создание дескриптора подключения к пульту УПДК
        /// </summary>
        public static UsbConnection CreateUpdkConnection()
        {
            return new UsbConnection("vid_0471", "pid_7036");
        }

        /// <summary>
        /// Создание дескриптора подключения к КСУ
        /// </summary>
        public static UsbConnection CreateCluConnection()
        {
            return new UsbConnection("vid_0471", "pid_7039");
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\UsbDevice.cs


using System;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Класс USB устройств Neurocom
    /// </summary>
    /// <remarks>
    /// Инкапсулирует командный интерфейс устройств
    /// </remarks>
    public abstract class UsbDevice
    {
        private const int MaxDataSize = 64;
        protected const int CommandSize = 5;

        /// <summary>
        /// Транспорт данных устройства
        /// </summary>
        public IDataTransport Transport { get; set; }

        /// <summary>
        /// Буфер данных устройсвта
        /// </summary>
        protected readonly byte[] Buffer = new byte[MaxDataSize];

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        /// <param name="transport">Транспорт данных устрйоства</param>
        public UsbDevice(IDataTransport transport)
        {
            Check.NotNull(transport, nameof(transport));
            Transport = transport;
        }

        public UsbDeviceInfo GetDeviceInfo()
        {
            return Transport != null ? GetDeviceInfo(Transport) : null;
        }

        /// <summary>
        /// Запрос информации об устройстве
        /// </summary>
        public static UsbDeviceInfo GetDeviceInfo(IDataTransport transport)
        {
            var isOpen = transport.IsOpen;
            UsbDeviceInfo info = null;

            try
            {
                if (!transport.IsOpen)
                    transport.Open();

                info = UsbDeviceInfo.Create(transport);
            }
            catch (Exception)
            {
            }
            finally
            {
                if (!isOpen)
                    transport.Close();
            }

            return info;
        }

        /// <summary>
        /// Отправка команды в устройство
        /// </summary>
        /// <param name="command">Код команды</param>
        /// <param name="parameter">параметр команды</param>
        protected void WriteCommand(byte command, ushort parameter)
        {
            const byte CommandDelimiter = 0x02;

            Buffer[0] = CommandDelimiter;
            Buffer[1] = command;
            Buffer[2] = (byte)((parameter >> 8) & 0xff);
            Buffer[3] = (byte)(parameter & 0xff);
            Buffer[4] = 0;

            Transport.Write(Buffer, CommandSize);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\UsbDeviceInfo.cs


using System.Text;

namespace Updk7.Tests.Pult
{
    /// <summary>
    /// Информация о USB-устройстве Neurocom
    /// </summary>
    public class UsbDeviceInfo
    {
        /// <summary>
        /// Коды команд
        /// </summary>
        private static class OpCodes
        {
            public const byte DeviceNameRequest = 0;
            public const byte FirmwareVersionRequest = 1;
            public const byte SerialNumberRequest = 3;
        }

        /// <summary>
        /// Создание экземпляра объекта
        /// </summary>
        private UsbDeviceInfo()
        {
        }

        /// <summary>
        /// Версия ПО устройства
        /// </summary>
        public int FirmwareVersion { get; private set; }

        /// <summary>
        /// Наименование устройства
        /// </summary>
        public string DeviceName { get; private set; }

        /// <summary>
        /// Серийный номер устройства
        /// </summary>
        public string SerialNumber { get; private set; }

        /// <summary>
        /// Преобразование в текстовое представление
        /// </summary>
        public override string ToString()
        {
            return 
                $"Device name: {DeviceName}\n" +
                $"Serial number: {SerialNumber}\n" +
                $"Firmware version: {FirmwareVersion}";
        }

        /// <summary>
        /// Создание информации об устройстве
        /// </summary>
        /// <param name="transport">Подключенный транспорт</param>
        /// <returns>Информация об устройстве</returns>
        public static UsbDeviceInfo Create(IDataTransport transport)
        {
            const int maxDataSize = 64;
            var buffer = new byte[maxDataSize];

            var result = new UsbDeviceInfo();
            result.FirmwareVersion = getFirmwareVersion(buffer, transport);
            result.SerialNumber = getSerialNumber(buffer, transport);
            result.DeviceName = getDeviceName(buffer, transport);

            return result;
        }

        private static string getDeviceName(byte[] buffer, IDataTransport transport)
        {
            sendInformationRequest(OpCodes.DeviceNameRequest, buffer, transport);
            return readString(buffer, transport);
        }

        private static string getSerialNumber(byte[] buffer, IDataTransport transport)
        {
            sendInformationRequest(OpCodes.SerialNumberRequest, buffer, transport);
            return readString(buffer, transport);
        }

        private static int getFirmwareVersion(byte[] buffer, IDataTransport transport)
        {
            const int versionSize = 2;

            sendInformationRequest(OpCodes.FirmwareVersionRequest, buffer, transport);
            return transport.Read(buffer, versionSize) == versionSize
                ? (buffer[0] << 8) | buffer[1]
                : 0;
        }

        private static void sendInformationRequest(byte request, byte[] buffer, IDataTransport transport)
        {
            buffer.Clear();
            buffer[0] = request;
            transport.Write(buffer, 1);
        }

        private static string readString(byte[] buffer, IDataTransport transport)
        {
            var count = transport.Read(buffer, buffer.Length);
            return count != 0
                ? new ASCIIEncoding().GetString(buffer).TrimEnd('\0')
                : string.Empty;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Pult\Source\UsbDeviceMonitor.cs


using System;
using System.Management;
using System.Diagnostics;
using System.Threading;

namespace Updk7.Tests.Pult
{
    public class UsbDeviceMonitor : IDisposable
    {
        private const int POLL_PERIOD = 500;

        private object _syncRoot = new object();
        private SynchronizationContext _syncContext;
        private Timer _timer;
        private string _vid;
        private string _pid;

        public UsbDeviceMonitor(UsbConnection usbConnection)
            : this(usbConnection.Vid, usbConnection.Pid)
        {
        }

        public UsbDeviceMonitor(string vid, string pid)
        {
            _syncContext = SynchronizationContext.Current;
            _timer = new Timer(onTimerTick, null, Timeout.Infinite, POLL_PERIOD);
            _vid = vid;
            _pid = pid;

            Connection = $"{vid}&{pid}";
        }

        public string Connection { get; }

        public event EventHandler IsConnectedChanged;

        private bool _isConnected;

        public bool IsConnected
        {
            get => _isConnected;
            set
            {
                if (value != _isConnected)
                {
                    _isConnected = value;
                    IsConnectedChanged?.Invoke(this, EventArgs.Empty);
                }
            }
        }

        public void Dispose()
        {
            if (_timer != null)
            {
                lock (_syncRoot)
                {
                    _timer.Dispose();
                    _timer = null;
                    _syncContext = null;
                }
            }
        }

        public void Start(int initialDelay = 1000)
        {
            Debug.Assert(_syncContext != null);
            Debug.Assert(_timer != null);
            _timer.Change(initialDelay, POLL_PERIOD);
        }

        private void onTimerTick(object stateInfo)
        {
            lock (_syncRoot)
            {
                var isConnected = IsDeviceConnected(_vid, _pid);
                _syncContext.Post(_ => IsConnected = isConnected, null);
            }
        }

        public static bool IsDeviceConnected(string vid, string pid)
        {
            try
            {
                using (var searcher = new ManagementObjectSearcher(@"Select * From Win32_PnPEntity"))
                using (var collection = searcher.Get())
                {
                    foreach (var device in collection)
                    {
                        var id = device["deviceid"].ToString().ToLower();
                        if (id.Contains(vid) && id.Contains(pid))
                            return true;
                    }
                }
            }
            catch (Exception)
            {
            }

            return false;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Q_Сортировка.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Вашему вниманию предлагается 60 утверждений, касающихся поведения человека в группе.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Прочитайте последовательно каждое из них и, используя левую кнопку мыши,
            выберите ответ «да», если оно соответствует Вашему представлению о себе, или «нет», если не соответствует ему.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если ответить однозначно представляется для Вас затруднительным, отвечайте «Сомневаюсь»».
        </Paragraph>
        
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Сомневаюсь</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:Q_Сортировка x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Q Сортировка"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question Text="Я критичен к товарищам."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question Text=" У меня возникает тревога, когда в группе начинается конфликт."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text=" Я склонен следовать советам лидера."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text=" Я не склонен создавать слишком близкие отношения с товарищами."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text=" Мне нравится дружественность в группе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text=" Я склонен противоречить лидеру."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text=" Испытываю симпатию к одному-двум определённым товарищам."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text=" Избегаю встреч и собраний в группе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text=" Мне нравится похвала лидера."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text=" Я независим в суждениях и манере поведения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text=" Я готов встать на чью-либо сторону в споре."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text=" Я склонен руководить товарищами."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text=" Радуюсь общению с одним-двумя друзьями."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text=" При появлении враждебности со стороны членов группы я внешне спокоен."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text=" Я склонен поддерживать настроение всей группы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text=" Не придаю значения личным качествам членов группы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text=" Я склонен отвлекать группу от её целей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text=" Испытываю удовлетворение, противопоставляя себя лидеру."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text=" Хотел бы сблизиться с некоторыми членами группы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text=" Предпочитаю оставаться нейтральным в споре."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question Text=" Мне нравится, когда лидер активен и хорошо руководит."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question Text=" Предпочитаю хладнокровно обсуждать разногласия."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question Text=" Я недостаточно сдержан в выражении чувств."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question Text=" Стремлюсь сплотить вокруг себя единомышленников."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question Text=" Недоволен слишком формальным (деловым) отношением."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question Text=" Когда меня обвиняют, я теряюсь и молчу."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question Text=" Предпочитаю соглашаться с основными направлениями в группе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question Text=" Я привязан к группе в целом больше, чем к определенным товарищам."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question Text=" Я склонен затягивать и обострять спор."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question Text=" Стремлюсь быть в центре внимания."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question Text=" Я хотел бы быть членом более узкой группы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question Text=" Я склонен к компромиссам."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question Text=" Испытываю внутреннее беспокойство, когда лидер поступает вопреки моим ожиданиям."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question Text=" Болезненно отношусь к замечаниям друзей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question Text=" Могу быть коварным и вкрадчивым."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question Text=" Я склонен принять на себя руководство в группе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question Text=" Я откровенен в группе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question Text=" У меня возникает нервное беспокойство во время группового разногласия."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question Text=" Предпочитаю, чтобы лидер брал на себя ответственность при планировании работ."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question Text=" Я не склонен отвечать на проявления дружелюбия."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question Text=" Я склонен сердиться на товарищей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question Text=" Я пытаюсь вести других против лидера."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question Text=" Легко нахожу знакомства за пределами группы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question Text=" Стараюсь избегать быть втянутым в спор."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question Text=" Легко соглашаюсь с предложениями других членов группы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question Text=" Оказываю сопротивление образованию группировок к группе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question Text=" Когда раздражён, я насмешлив и ироничен."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question Text=" У меня возникает неприязнь к тем, кто пытается выделиться."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question Text=" Предпочитаю меньшую, но более интимную группу."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question Text=" Пытаюсь не показывать свои истинные чувства."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question Text=" Становлюсь на сторону лидера в групповых разногласиях."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question Text=" Я инициативен в установлении контактов в общении."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question Text=" Избегаю критиковать товарищей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question Text=" Предпочитаю обращаться к лидеру чаще, чем к другим."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question Text=" Мне не нравится, что отношения в группе слишком фамильярны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question Text=" Люблю затевать споры."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question Text=" Стремлюсь удержать своё высокое положение в группе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question Text=" Я склонен вмешиваться в контакты знакомых и нарушать их."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question Text=" Я склонен к перепалкам, задиристый."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question Text=" Я склонен выражать недовольство лидером."
Answers="{ StaticResource Answers}">
        </q:Question>

    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Адаптивность.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Вам предлагается тест, содержащий 165 утверждений.
            Внимательно прочитайте каждое утверждение и решите: верно («ДА»)
            или неверно («НЕТ») оно по отношению к Вам.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после
            наведения курсора на соответствующий ответ. При необходимости Вы
            можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих», отвечайте искренне.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту».
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:Адаптивность x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Адаптивность"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question 
            Text="Бывает, что я сержусь."
            Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
            Text="Обычно по утрам я просыпаюсь свежим и отдохнувшим."
            Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text="Сейчас я примерно так же работоспособен, как и всегда."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text="Судьба определенно несправедлива ко мне."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text="Запоры у меня бывают очень редко."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text="Временами мне очень хотелось покинуть свой дом."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text="Временами у меня бывают приступы смеха или плача, с которыми я никак не могу справиться."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text="Мне кажется, что меня никто не понимает."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text="Считаю, что если кто-то причинил мне зло, то я должен ответить ему тем же."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text="Иногда мне в голову приходят такие нехорошие мысли, что лучше о них никому не рассказывать."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text="Мне бывает трудно сосредоточиться на какой-либо задаче или работе."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text="У меня бывают часто странные и необычные переживания."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text="У меня отсутствовали неприятности из-за моего поведения."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text="В детстве я одно время совершал мелкие кражи."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text="Бывает, что у меня появляется желание ломать или крушить все вокруг."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text="Бывало, что я целыми днями или даже неделями ничего не мог делать, потому что никак не мог заставить себя взяться за работу."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text="Сон у меня прерывистый и беспокойный."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text="Моя семья относится с неодобрением к той работе, которую я выбрал."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text="Бывали случаи, что я не сдерживал обещаний."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text="Голова у меня болит часто."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question Text="Раз в неделю или чаще я без всякой видимой причины внезапно ощущаю жар во всем теле."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question Text="Было бы хорошо, если бы почти все законы отменили."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question Text="Состояние моего здоровья почти такое же, как у большинства моих знакомых (не хуже)."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question Text="Встречая на улице своих знакомых или школьных друзей, с которыми я давно не виделся, я предпочитаю проходить мимо, если они со мной не заговаривают первыми."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question Text="Большинству людей, которые меня знают, я нравлюсь."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question Text="Я человек общительный."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question Text="Иногда я так настаиваю на своем, что люди теряют терпение."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question Text="Большую часть времени настроение у меня подавленное."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question Text="Теперь мне трудно надеяться на то, что я чего-нибудь добьюсь в жизни."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question Text="У меня мало уверенности в себе."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question Text="Иногда я говорю неправду."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question Text="Обычно я считаю, что жизнь – стоящая штука."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question Text="Я считаю, что большинство людей способны солгать, чтобы продвинуться по службе."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question Text="Я охотно принимаю участие в собраниях и других общественных мероприятиях."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question Text="Я ссорюсь с членами моей семьи очень редко."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question Text="Иногда я испытываю сильное желание нарушить правила приличия или кому-нибудь навредить."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question Text="Самая трудная борьба для меня – это борьба с самим собой."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question Text="Мышечные судороги или подергивания у меня бывают крайне редко (или почти не бывают)."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question Text="Я довольно безразличен к тому, что со мной будет."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question Text="Иногда, когда я себя неважно чувствую, я бываю раздражительным."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question Text="Часто у меня такое чувство, что я сделал что-то не то или даже что-то плохое."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question Text="Некоторые люди до того любят командовать, что меня так и тянет делать все наперекор, даже если я знаю, что они правы."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question Text="Я часто считаю себя обязанным отстаивать то, что нахожу справедливым."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question Text="Моя речь сейчас такая же, как всегда (ни быстрее, ни медленнее, нет ни хрипоты, ни невнятности)."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question Text="Я считаю, что моя семейная жизнь такая же хорошая, как у большинства моих знакомых."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question Text="Меня ужасно задевает, когда меня критикуют или ругают."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question Text="Иногда у меня бывает чувство, что я просто должен нанести повреждение себе или кому-нибудь другому."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question Text="Мое поведение в значительной мере определяется обычаями тех, кто меня окружает."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question Text="В детстве у меня была компания, где все старались стоять друг за друга."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question Text="Иногда меня так и подмывает с кем-нибудь затеять драку."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question Text="Бывало, что я говорил о вещах, в которых не разбираюсь."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question Text="Обычно я засыпаю спокойно и меня не тревожат никакие мысли."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question Text="Последние несколько лет я чувствую себя хорошо."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question Text="У меня никогда не было ни припадков, ни судорог."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question Text="Сейчас мой вес постоянен (я не худею и не полнею)."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question Text="Я считаю, что меня часто наказывали незаслуженно."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question Text="Я легко плачу."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question Text="Я мало устаю."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question Text="Я был бы довольно спокоен, если бы у кого-нибудь из моей семьи были неприятности из-за нарушения закона."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question Text="С моим рассудком творится что-то неладное."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question Text="Чтобы скрыть свою застенчивость, мне приходится затрачивать большие усилия."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question Text="Приступы головокружения у меня бывают очень редко (или почти не бывают)."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question Text="Меня беспокоят сексуальные вопросы."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question Text="Мне трудно поддерживать разговор с людьми, с которыми я только что познакомился."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question Text="Когда я пытаюсь что-то сделать, часто замечаю, что у меня дрожат руки."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question Text="Руки у меня такие же ловкие и проворные, как и прежде."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question Text="Большую часть времени я испытываю общую слабость."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question Text="Иногда, когда я смущен, я сильно потею, и меня это очень раздражает."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question Text="Бывает, что я откладываю на завтра то, что должен сделать сегодня."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question Text="Думаю, что я человек обреченный."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question Text="Бывали случаи, что мне было трудно удержаться, чтобы что-нибудь не  стащить у кого-нибудь или где-нибудь, например, в магазине."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 72-->
        <q:Question Text="Я злоупотреблял спиртными напитками."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 73-->
        <q:Question Text="Я часто о чем-нибудь тревожусь."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 74-->
        <q:Question Text="Мне бы хотелось быть членом нескольких кружков или обществ."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 75-->
        <q:Question Text="Я редко задыхаюсь и у меня не бывает сильных сердцебиений."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 76-->
        <q:Question Text="Всю свою жизнь я строго следую принципам, основанным на чувстве долга."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 77-->
        <q:Question Text="Случалось, что я препятствовал или поступал наперекор людям просто из принципа, а не потому, что дело было действительно важным."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 78-->
        <q:Question Text="Если мне не грозит штраф и машин поблизости нет, я могу перейти улицу там, где мне хочется, а не там, где положено."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 79-->
        <q:Question Text="Я всегда был независимым и свободным от контроля со стороны семьи."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 80-->
        <q:Question Text="У меня бывали периоды такого сильного беспокойства, что я даже не мог усидеть на месте."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 81-->
        <q:Question Text="Зачастую мои поступки неправильно истолковывались."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 82-->
        <q:Question Text="Мои родители и (или) другие члены моей семьи придираются ко мне больше, чем надо."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 83-->
        <q:Question Text="Кто-то управляет моими мыслями."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 84-->
        <q:Question Text="Люди равнодушны и безразличны к тому, что с тобой случится."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 85-->
        <q:Question Text="Мне нравится быть в компании, где все подшучивают друг над другом."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 86-->
        <q:Question Text="В школе я усваивал материал медленнее, чем другие."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 87-->
        <q:Question Text="Я вполне уверен в себе."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 88-->
        <q:Question Text="Никому не доверять – самое безопасное."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 89-->
        <q:Question Text="Раз в неделю или чаще я бываю очень возбужденным и взволнованным."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 90-->
        <q:Question Text="Когда я нахожусь в компании, мне трудно найти подходящую тему для разговора."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 91-->
        <q:Question Text="Мне легко заставить других людей бояться себя, и иногда я это делаю ради забавы."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 92-->
        <q:Question Text="В игре я предпочитаю выигрывать."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 93-->
        <q:Question Text="Глупо осуждать человека, обманувшего того, кто сам позволяет себя обманывать."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 94-->
        <q:Question Text="Кто-то пытается воздействовать на мои мысли."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 95-->
        <q:Question Text="Я ежедневно выпиваю много воды."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 96-->
        <q:Question Text="Счастливее всего я бываю, когда один."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 97-->
        <q:Question Text="Я возмущаюсь каждый раз, когда узнаю, что преступник по какой-либо причине остался безнаказанным."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 98-->
        <q:Question Text="В моей жизни был один или несколько случаев, когда я чувствовал, что кто-то посредством гипноза заставляет меня совершать те или иные поступки."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 99-->
        <q:Question Text="Я редко заговариваю с людьми первым."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 100-->
        <q:Question Text="У меня никогда не было столкновений с законом."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 101-->
        <q:Question Text="Мне приятно иметь среди своих знакомых значительных людей – это как бы придает мне вес в собственных глазах."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 102-->
        <q:Question Text="Иногда без всякой причины у меня вдруг наступают периоды необычайной веселости."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 103-->
        <q:Question Text="Жизнь для меня почти всегда связана с напряжением."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 104-->
        <q:Question Text="В школе мне было очень трудно говорить перед классом."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 105-->
        <q:Question Text="Люди проявляют по отношению ко мне столько сочувствия и симпатии, сколько я заслуживаю."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 106-->
        <q:Question Text="Я отказываюсь играть в некоторые игры, потому что у меня это плохо получается."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 107-->
        <q:Question Text="Мне кажется, что я завожу друзей с такой же легкостью, как и другие."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 108-->
        <q:Question Text="Мне неприятно, когда вокруг меня люди."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 109-->
        <q:Question Text="Мне, как правило, везет."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 110-->
        <q:Question Text="Меня легко привести в замешательство."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 111-->
        <q:Question Text="Некоторые из членов моей семьи совершали поступки, которые меня пугали."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 112-->
        <q:Question Text="Иногда у меня бывают приступы смеха или плача, с которыми я никак не могу правиться."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 113-->
        <q:Question Text="Мне бывает трудно приступить к выполнению нового задания или начать новое дело."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 114-->
        <q:Question Text="Если бы люди не были настроены против меня, я в жизни достиг бы гораздо большего."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 115-->
        <q:Question Text="Мне кажется, что меня никто не понимает."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 116-->
        <q:Question Text="Среди моих знакомых есть люди, которые мне не нравятся."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 117-->
        <q:Question Text="Я легко теряю терпение с людьми."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 118-->
        <q:Question Text="Часто в новой обстановке я испытываю тревогу."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 119-->
        <q:Question Text="Часто мне хочется умереть."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 120-->
        <q:Question Text="Иногда я бываю так возбужден, что мне бывает трудно заснуть."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 121-->
        <q:Question Text="Часто я перехожу на другую сторону улицы, чтобы избежать встречи с тем, кого я увидел."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 122-->
        <q:Question Text="Бывало, что я бросал начатое дело, так как боялся, что я не справлюсь с ним."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 123-->
        <q:Question Text="Почти каждый день случается что-нибудь, что пугает меня."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 124-->
        <q:Question Text="Даже среди людей я чувствую себя одиноким."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 125-->
        <q:Question Text="Я убежден, что существует лишь одно-единственное правильное понимание смысла жизни."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 126-->
        <q:Question Text="В гостях я чаще сижу в стороне и разговариваю с кем-нибудь одним, чем принимаю участие в общих развлечениях."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 127-->
        <q:Question Text="Мне часто говорят, что я вспыльчив."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 128-->
        <q:Question Text="Бывает, что я с кем-нибудь посплетничаю."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 129-->
        <q:Question Text="Часто мне бывает неприятно, когда я пытаюсь предостеречь кого-либо от ошибок, а меня понимают неправильно."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 130-->
        <q:Question Text="Я часто обращаюсь к людям за советом."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 131-->
        <q:Question Text="Часто, даже тогда, когда для меня не складывается все хорошо, я чувствую, что мне все безразлично."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 132-->
        <q:Question Text="Меня довольно трудно вывести из себя."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 133-->
        <q:Question Text="Когда я пытаюсь указать людям на их ошибки или помочь, они часто понимают меня неправильно."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 134-->
        <q:Question Text="Обычно я спокоен и меня нелегко вывести из душевного равновесия."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 135-->
        <q:Question Text="Я заслуживаю сурового наказания за свои проступки."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 136-->
        <q:Question Text="Мне свойственно так сильно переживать свои разочарования, что я не могу заставить себя не думать о них."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 137-->
        <q:Question Text="Временами мне кажется, что я ни на что не пригоден."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 138-->
        <q:Question Text="Бывало, что при обсуждении некоторых вопросов я, особо не задумываясь, соглашался с мнением других."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 139-->
        <q:Question Text="Меня весьма беспокоят всевозможные несчастья."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 140-->
        <q:Question Text="Мои убеждения и взгляды непоколебимы."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 141-->
        <q:Question Text="Я думаю, что можно, не нарушая закона, попытаться найти в нем лазейку."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 142-->
        <q:Question Text="Есть люди, которые мне настолько неприятны, что в глубине души я радуюсь, когда они получают нагоняй за что-нибудь."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 143-->
        <q:Question Text="У меня бывали периоды, когда я из-за волнения терял сон."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 144-->
        <q:Question Text="Я посещаю всевозможные общественные мероприятия, потому что это позволяет побывать среди людей."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 145-->
        <q:Question Text="Можно простить людям нарушение правил, которые они считают неразумными."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 146-->
        <q:Question Text="У меня есть дурные привычки, которые настолько сильны, что бороться с ними просто бесполезно."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 147-->
        <q:Question Text="Я охотно знакомлюсь с новыми людьми."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 148-->
        <q:Question Text="Бывает, что неприличная и даже непристойная шутка у меня вызывает смех."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 149-->
        <q:Question Text="Если дело у меня идет плохо, мне сразу хочется все бросить."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 150-->
        <q:Question Text="Я предпочитаю действовать согласно собственным планам, а не следовать указаниям других."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 151-->
        <q:Question Text="Люблю, чтобы окружающие знали мою точку зрения."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 152-->
        <q:Question Text="Если я плохого мнения о человеке или даже презираю его, почти не стараюсь скрыть это от него."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 153-->
        <q:Question Text="Я человек нервный и легко возбудимый."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 154-->
        <q:Question Text="Все у меня получается плохо, не так, как надо."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 155-->
        <q:Question Text="Будущее кажется мне безнадежным."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 156-->
        <q:Question Text="Люди довольно легко могут изменить мое мнение, даже если до этого оно казалось мне окончательным."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 157-->
        <q:Question Text="Несколько раз в неделю у меня бывает чувство, что должно случиться что-то страшное."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 158-->
        <q:Question Text="Чаще всего я чувствую себя усталым."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 159-->
        <q:Question Text="Я люблю бывать на вечерах и просто в компаниях."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 160-->
        <q:Question Text="Я стараюсь уклониться от конфликтов и затруднительных положений."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 161-->
        <q:Question Text="Меня часто раздражает, что я забываю, куда кладу вещи."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 162-->
        <q:Question Text="Приключенческие рассказы мне нравятся больше, чем рассказы о любви."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 163-->
        <q:Question Text="Если я захочу сделать что-то, но окружающие считают, что этого делать не стоит, я легко могу отказаться от своих намерений."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 164-->
        <q:Question Text="Глупо осуждать людей, которые стремятся взять от жизни все, что могут."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 165-->
        <q:Question Text="Мне безразлично, что обо мне думают другие."
                    Answers="{ StaticResource Answers}">
        </q:Question>

    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Аддикция_и_аддиктивное_поведение.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument x:Key="Instruction"
                  x:Shared="False"
                  FontSize="18">
        
        <Paragraph TextAlignment="Center" 
                   FontSize="24" 
                   FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph TextIndent="20">
            «1. Перед Вами список личных пристрастий (в тесте будет обозначены как ЛП)
            к которым обычно прибегают люди, когда попадают в ситуации стресса,
            внутреннего дискомфорта или в трудные жизненные обстоятельства:
        </Paragraph>
        <BlockUIContainer>
            <Grid Width="Auto" HorizontalAlignment="Center">
                <FlowDocumentScrollViewer Width="Auto" HorizontalAlignment="Center">
                    <FlowDocument>
                        <FlowDocument.Resources>
                            <Style TargetType="TableCell">
                                <Setter Property="BorderThickness" Value="1"/>
                                <Setter Property="BorderBrush" Value="Black"/>
                            </Style>
                        </FlowDocument.Resources>
                        <Table>
                            <Table.Columns>
                                <TableColumn Width="200"/>
                                <TableColumn Width="200"/>
                                <TableColumn Width="200"/>
                            </Table.Columns>
                            <TableRowGroup>
                                <!--Row0-->
                                <TableRow>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            шопинг
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            завести очередной роман
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            «засесть» перед экраном ТВ
                                        </Paragraph>
                                    </TableCell>
                                </TableRow>
                                <!--Row1-->
                                <TableRow>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            вылить на кого-нибудь свой гнев
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            выйти в социальную сеть
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            экстрим:  прыжок с парашютом, прыжок с моста, паркур…
                                        </Paragraph>
                                    </TableCell>
                                </TableRow>
                                <!--Row2-->
                                <TableRow>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            «окунуться с головой» в работу
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            «отречься от всего суетного» в пользу религиозных изысканий
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            смаковать мысль о «никчёмности жизни»
                                        </Paragraph>
                                    </TableCell>
                                </TableRow>
                                <!--Row3-->
                                <TableRow>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            интернет-общение
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            употребить алкоголь
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            игровые автоматы
                                        </Paragraph>
                                    </TableCell>
                                </TableRow>
                                <!--Row4-->
                                <TableRow>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            «запойное» чтение
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            употребить наркотик
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            посмотреть порно
                                        </Paragraph>
                                    </TableCell>
                                </TableRow>
                                <!--Row5-->
                                <TableRow>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            «поизучать» функции мобильника
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            выпить «успокаивающее» лекарство
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            «выжать все силы» на тренажёрах
                                        </Paragraph>
                                    </TableCell>
                                </TableRow>
                                <!--Row6-->
                                <TableRow>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            игровые клубы
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            закурить сигарету
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            выпить кофе покрепче
                                        </Paragraph>
                                    </TableCell>
                                </TableRow>
                                <!--Row7-->
                                <TableRow>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            стремление перекусить
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            поиграть в компьютерную игру
                                        </Paragraph>
                                    </TableCell>
                                    <TableCell TextAlignment="Center">
                                        <Paragraph>
                                            что-то другое…
                                        </Paragraph>
                                    </TableCell>
                                </TableRow>
                            </TableRowGroup>
                        </Table>
                    </FlowDocument>
                </FlowDocumentScrollViewer>
            </Grid>
        </BlockUIContainer>
        <Paragraph TextIndent="20">
            2. Внимательно ознакомьтесь с содержанием таблицы, отметьте для себя,
            к какому поведению из приведённых в таблице Вы наиболее склонны прибегать в трудных жизненных обстоятельствах?
        </Paragraph>
        <Paragraph TextIndent="20">
            3. В тесте, отвечая на предлагаемые утверждения,
            оцените проявление выбранного Вами ЛП нажатием на соответствующие кнопки, 
            показывающие Ваше отношение к предложенным утверждениям:
            «ДА», «ИНОГДА», «КРАЙНЕ РЕДКО», «НЕТ».»
        </Paragraph>
    </FlowDocument>

    <k:Аддикция_и_аддиктивное_поведение x:Key="Keys" x:Shared="False"/>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Иногда</q:Answer>
        <q:Answer>Крайне редко</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <q:Questionnaire
     x:Key="Test"
     Title="Адаптивность"
     Instruction="{StaticResource Instruction}"
     Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question Text="ЛП портит мою репутацию"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question Text="Я чувствую себя несчастным из-за ЛП"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text="Я трачу время, предназначенное для работы (учебы, семейных обязанностей), на ЛП"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text="Я прибегаю к ЛП, чтобы повысить настроение"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text="Когда я начинаю ЛП, то времени на это у меня уходит больше, нежели я изначально планировал"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text="Для того, чтобы отвлечься от неприятностей, я прибегаю к ЛП"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text="ЛП выбивает меня из режима сна"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text="Я решаю «взять себя в руки и сегодня отдаться ЛП в последний раз»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text="Из-за ЛП у меня возникают проблемы с близкими людьми"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text="Я испытываю сильное побуждение повторить ЛП"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text="В случаях, когда ЛП не оправдывает себя (не даёт чувства удовлетворённости), я стремлюсь повторить его."
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text="Я меняю свои ранее определённые планы ради удовлетворения возникшего желания прибегнуть к ЛП"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text="Мне трудно понять людей, которые равнодушны ко всему, связанному с этим ЛП"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text="Я считаю, что имею полное право употребить на моё ЛП освободившиеся деньги/силы/время"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text="Я считаю, что многие люди, когда им плохо, прибегают к такому же ЛП, следовательно, ЛП скорее норма, чем проблема."
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text="Когда ЛП овладевает мною, меня не могут остановить ни мысли о причинении вреда себе, ни нарушение благополучия моих близких людей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text="Я говорю, что в любой момент могу перестать пользоваться ЛП в ситуациях, когда мне плохо"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text="Из-за ЛП у меня возникают проблемы со здоровьем"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text="Я делаю попытки отвлечься на занятия чем-либо другим, чтобы ЛП меня не затягивало"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text="Я испытываю потребность прекратить практиковать своё ЛП"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question Text="Я понимаю, что моё ЛП уже деструктивно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question Text="Мне не интересно с теми, кто не практикует такое же ЛП"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question Text="Мне становится скучно, если меня лишают ЛП"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question Text="Я совершаю импульсивные действия, не задумываясь о том, как они повлияют на окружающих"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question Text="Я сконцентрирован на будущем более, нежели на настоящем"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question Text="Я имею склонность создавать для себя и других экстремальные ситуации или попадать в таковые"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question Text="Моя жизнь без моего ЛП теряет в моих глазах насыщенность и краски"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question Text="Без доступа к моему ЛП я испытываю уныние и раздражение"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question Text="Когда ЛП «тянет» меня, я не в состоянии противостоять"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question Text="Люди с подобным ЛП столь значимы для меня, что ради состыковки совместных планов я готов отказаться от ранее намеченных собственных планов"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question Text="Если ЛП нет в зоне достижимости, мне трудно контролировать свои эмоции"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question Text="Я завидую тем, кто равнодушен к такому ЛП"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Аналогии.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам будет предложено выполнить тест, содержащий 30 заданий. В каждом задании Вам будет
            показано три слова: между первым и вторым существует определённая логическая связь, а
            после третьего (ВЫДЕЛЕННОГО) слова стоит знак вопроса.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Ваша задача: из пяти прилагаемых к заданию вариантов выбрать такое слово-ответ, которое 
            логически связано с ВЫДЕЛЕННЫМ СЛОВОМ таким же образом, как первое слово связано со вторым. 
            Примеры выполнения заданий представлены ниже в таблице (правильный ответ – подчеркнутые слова).
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            На выполнение теста Вам будет предоставлено только 5 минут!
        </Paragraph>
        <Table
            CellSpacing="0">
            <Table.Resources>
                <Style x:Key="headerFooterRowStyle" TargetType="{x:Type TableRowGroup}">
                    <Setter Property="FontWeight" Value="Bold"/>
                    <Setter Property="FontSize" Value="16"/>
                </Style>
                <Style TargetType="TableCell">
                    <Setter Property="BorderBrush" Value="Black" />
                    <Setter Property="BorderThickness" Value="1" />
                    <Setter Property="Padding" Value="0" />
                </Style>
                <Style TargetType="Paragraph">
                    <Setter Property="TextAlignment" Value="Center" />
                </Style>
            </Table.Resources>
            <Table.Columns>
                <TableColumn />
                <TableColumn />
                <TableColumn />
                <TableColumn />
                <TableColumn />
                <TableColumn />
            </Table.Columns>
            
            <TableRowGroup Style="{StaticResource headerFooterRowStyle}">
                <TableRow>
                    <TableCell>
                        <Paragraph>Задания</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>А</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>Б</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>В</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>Г</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>Д</Paragraph>
                    </TableCell>
                </TableRow>
            </TableRowGroup>

            <TableRowGroup>
                <TableRow>
                    <TableCell>
                        <Paragraph>Лошадь – жеребёнок,</Paragraph>
                        <Paragraph FontWeight="Bold">корова – ?</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>пастбище</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>рога</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>молоко</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph TextDecorations="Underline" FontWeight="Bold">телёнок</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>бык</Paragraph>
                    </TableCell>
                </TableRow>
                <TableRow>
                    <TableCell>
                        <Paragraph>Яйцо – скорлупа,</Paragraph>
                        <Paragraph FontWeight="Bold">картофель – ?</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>курица</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>огород</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>капуста</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>суп</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph TextDecorations="Underline" FontWeight="Bold">шелуха</Paragraph>
                    </TableCell>
                </TableRow>
                <TableRow>
                    <TableCell>
                        <Paragraph>Дождь – зонтик,</Paragraph>
                        <Paragraph FontWeight="Bold">мороз – ?</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>палка</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>холод</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph TextDecorations="Underline" FontWeight="Bold">шуба</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>зима</Paragraph>
                    </TableCell>
                    <TableCell>
                        <Paragraph>сани</Paragraph>
                    </TableCell>
                </TableRow>
            </TableRowGroup>
        </Table>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующее 
            слово-ответ. При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы испытываете затруднения с выполнением отдельного задания, то переходите дальше. Помните, 
            что на выполнение теста Вам будет предоставлено только 5 минут!
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <k:Аналогии x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Тест «Аналогии»"
        TestDuration="00:05:00"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question
            Text="Бежать - стоять; кричать - ?">
            <q:Answer>Молчать</q:Answer>
            <q:Answer>Шептать</q:Answer>
            <q:Answer>Шуметь</q:Answer>
            <q:Answer>Звать</q:Answer>
            <q:Answer>Плакать</q:Answer>
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
			Text="Паровоз - вагоны; конь - ?">
            <q:Answer>Конюх</q:Answer>
            <q:Answer>Лошадь</q:Answer>
            <q:Answer>Ехать</q:Answer>
            <q:Answer>Телега</q:Answer>
            <q:Answer>Конюшня</q:Answer>
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
			Text="Театр - зритель; библиотека - ?">
            <q:Answer>Полки</q:Answer>
            <q:Answer>Книги</q:Answer>
            <q:Answer>Читатель</q:Answer>
            <q:Answer>Букинист</q:Answer>
            <q:Answer>Читать</q:Answer>
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
			Text="Железо - кузнец; дерево - ?">
            <q:Answer>Столяр</q:Answer>
            <q:Answer>Пила</q:Answer>
            <q:Answer>Лесник</q:Answer>
            <q:Answer>Строгать</q:Answer>
            <q:Answer>Доски</q:Answer>
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
			Text="Пароход - пристань; поезд - ?">
            <q:Answer>Депо</q:Answer>
            <q:Answer>Вокзал</q:Answer>
            <q:Answer>Рельсы</q:Answer>
            <q:Answer>Шпалы</q:Answer>
            <q:Answer>Купе</q:Answer>
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
			Text="Машина - мотор; яхта - ?">
            <q:Answer>Мачта</q:Answer>
            <q:Answer>Киль</q:Answer>
            <q:Answer>Корма</q:Answer>
            <q:Answer>Плыть</q:Answer>
            <q:Answer>Парус</q:Answer>
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
			Text="Нога  -  костыль; глаза - ?">
            <q:Answer>Зрение</q:Answer>
            <q:Answer>Очки</q:Answer>
            <q:Answer>Слёзы</q:Answer>
            <q:Answer>Голова</q:Answer>
            <q:Answer>Веки</q:Answer>
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
			Text="Игла - острие; бритва - ?">
            <q:Answer>Сталь</q:Answer>
            <q:Answer>Металл</q:Answer>
            <q:Answer>Лезвие</q:Answer>
            <q:Answer>Царапина</q:Answer>
            <q:Answer>Резать</q:Answer>
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
			Text="Музыка - оркестр; пение - ?">
            <q:Answer>Хор</q:Answer>
            <q:Answer>Театр</q:Answer>
            <q:Answer>Солист</q:Answer>
            <q:Answer>Сцена</q:Answer>
            <q:Answer>Певец</q:Answer>
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
			Text="Коровы - стадо; волки - ?">
            <q:Answer>Звери</q:Answer>
            <q:Answer>Лес</q:Answer>
            <q:Answer>Охота</q:Answer>
            <q:Answer>Стая</q:Answer>
            <q:Answer>Хищники</q:Answer>
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
			Text="Фильм - экран; опера - ?">
            <q:Answer>Театр</q:Answer>
            <q:Answer>Артист</q:Answer>
            <q:Answer>Сцена</q:Answer>
            <q:Answer>Трагедия</q:Answer>
            <q:Answer>Пение</q:Answer>
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
			Text="Рожь - поле; яблоня - ?">
            <q:Answer>Сажать</q:Answer>
            <q:Answer>Яблоки</q:Answer>
            <q:Answer>Растить</q:Answer>
            <q:Answer>Урожаи</q:Answer>
            <q:Answer>Сад</q:Answer>
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
			Text="Гора - пещера; дерево - ?">
            <q:Answer>Корень</q:Answer>
            <q:Answer>Дупло</q:Answer>
            <q:Answer>Крона</q:Answer>
            <q:Answer>Лес</q:Answer>
            <q:Answer>Ствол</q:Answer>
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
			Text="Дом - этажи; лестница  -  ?">
            <q:Answer>Перила</q:Answer>
            <q:Answer>Лифт</q:Answer>
            <q:Answer>Подъём</q:Answer>
            <q:Answer>Ступени</q:Answer>
            <q:Answer>Ходить</q:Answer>
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
			Text="Число - цифры; слово - ?">
            <q:Answer>Фраза</q:Answer>
            <q:Answer>Буквы</q:Answer>
            <q:Answer>Читать</q:Answer>
            <q:Answer>Рассказ</q:Answer>
            <q:Answer>Книга</q:Answer>
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
			Text="Болезнь - лечение; поломка - ?">
            <q:Answer>Мастер</q:Answer>
            <q:Answer>Делать</q:Answer>
            <q:Answer>Ремонт</q:Answer>
            <q:Answer>Деталь</q:Answer>
            <q:Answer>Смазка</q:Answer>
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
			Text="Прохлада - мороз; голубой - ?">
            <q:Answer>Вечер</q:Answer>
            <q:Answer>Небо</q:Answer>
            <q:Answer>Тёплый</q:Answer>
            <q:Answer>Синий</q:Answer>
            <q:Answer>Лунный</q:Answer>
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
			Text="Враг - недруг; рынок-  ?">
            <q:Answer>Базар</q:Answer>
            <q:Answer>Площадь</q:Answer>
            <q:Answer>Торговец</q:Answer>
            <q:Answer>Купить</q:Answer>
            <q:Answer>Магазин</q:Answer>
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
			Text="Малина - ягода; физика - ?">
            <q:Answer>Ученик</q:Answer>
            <q:Answer>Вакуум</q:Answer>
            <q:Answer>Учёный</q:Answer>
            <q:Answer>Лекция</q:Answer>
            <q:Answer>Наука</q:Answer>
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
			Text="Растение - семя; утка - ?">
            <q:Answer>Летать</q:Answer>
            <q:Answer>Мясо</q:Answer>
            <q:Answer>Перо</q:Answer>
            <q:Answer>Плавать</q:Answer>
            <q:Answer>Яйцо</q:Answer>
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
			Text="Ель - дуб; стол - ?">
            <q:Answer>Мебель</q:Answer>
            <q:Answer>Шкаф</q:Answer>
            <q:Answer>Гарнитур</q:Answer>
            <q:Answer>Ваза</q:Answer>
            <q:Answer>Скатерть</q:Answer>
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
			Text="Год - весна; жизнь - ?">
            <q:Answer>Радость</q:Answer>
            <q:Answer>Учёба</q:Answer>
            <q:Answer>Юность</q:Answer>
            <q:Answer>Любовь</q:Answer>
            <q:Answer>Свет</q:Answer>
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
			Text="Вагон - поезд; квартира - ?">
            <q:Answer>Кухня</q:Answer>
            <q:Answer>Комната</q:Answer>
            <q:Answer>Дверь</q:Answer>
            <q:Answer>Дом</q:Answer>
            <q:Answer>Балкон</q:Answer>
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
			Text="Голод - тощий; труд - ?">
            <q:Answer>Усталый</q:Answer>
            <q:Answer>Пища</q:Answer>
            <q:Answer>Усилие</q:Answer>
            <q:Answer>Добрый</q:Answer>
            <q:Answer>Плата</q:Answer>
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
			Text="Понедельник - среда; воскресенье - ?">
            <q:Answer>Четверг</q:Answer>
            <q:Answer>Суббота</q:Answer>
            <q:Answer>Вторник</q:Answer>
            <q:Answer>Среда</q:Answer>
            <q:Answer>Пятница</q:Answer>
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
			Text="Утро - ночь; зима - ?">
            <q:Answer>Мороз</q:Answer>
            <q:Answer>Январь</q:Answer>
            <q:Answer>Снег</q:Answer>
            <q:Answer>Осень</q:Answer>
            <q:Answer>Месяц</q:Answer>
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
			Text="Шар - круг; куб - ?">
            <q:Answer>Тело</q:Answer>
            <q:Answer>Фигура</q:Answer>
            <q:Answer>Конус</q:Answer>
            <q:Answer>Призма</q:Answer>
            <q:Answer>Квадрат</q:Answer>
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
			Text="Пожар - поджог; арест - ?">
            <q:Answer>Камера</q:Answer>
            <q:Answer>Милиция</q:Answer>
            <q:Answer>Суд</q:Answer>
            <q:Answer>Кража</q:Answer>
            <q:Answer>Юрист</q:Answer>
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
			Text="Коза - животное; хлеб - ?">
            <q:Answer>Обед</q:Answer>
            <q:Answer>Пища</q:Answer>
            <q:Answer>Батон</q:Answer>
            <q:Answer>Есть</q:Answer>
            <q:Answer>Тарелка</q:Answer>
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
			Text="Звук - громкость; свет - ?">
            <q:Answer>Блеск</q:Answer>
            <q:Answer>Луч</q:Answer>
            <q:Answer>Освещённость</q:Answer>
            <q:Answer>Вспышка</q:Answer>
            <q:Answer>Яркость</q:Answer>
        </q:Question>
    </q:Questionnaire>

</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Антиципационная_состоятельность.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам будет предъявлен ряд утверждений. Укажите, в какой степени Вы согласны или не согласны с ними.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам предлагается на выбор 5 вариантов ответа:
        </Paragraph>
        <List MarkerStyle="Circle" Margin="0">
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    совершенно не согласен (совсем не так);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    скорее не согласен (скорее не так);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    ни то, ни другое (и так, и так);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    скорее согласен (скорее так);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    совершенно согласен (именно так).
                </Paragraph>
            </ListItem>
        </List>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующий ответ. 
            Помните, что нет ответов «хороших» или «плохих»: важно объективно оценивать свои индивидуальные
            особенности. При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>совершенно не согласен (совсем не так)</q:Answer>
        <q:Answer>скорее не согласен (скорее не так)</q:Answer>
        <q:Answer>ни то, ни другое (и так, и так)</q:Answer>
        <q:Answer>скорее согласен (скорее так)</q:Answer>
        <q:Answer>совершенно согласен (именно так)</q:Answer>
    </q:AnswersCollection>

    <k:Антиципационная_состоятельность x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Антиципационная состоятельность (прогностическая компетентность)"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question
			Text="Я склонен разочаровываться в людях"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
			Text="Мне нравится (или нравилось) участвовать в играх, требующих ловкости движений"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
			Text="Часто бывает, что я обижаюсь на близких и знакомых мне людей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
			Text="Нередко я опаздываю на работу (учёбу), деловые или личные встречи из-за непредвиденных случайностей в пути"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
			Text="Для меня типично появление чувства удивления по отношению к происходящим событиям в жизни"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
			Text="Я легко жонглирую (жонглировал ранее) различными предметами, подбрасывая и ловя их"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
			Text="В своей жизни я часто сталкиваюсь (сталкивался) с невообразимым стечением неблагоприятных обстоятельств"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
			Text="Я легко могу предугадать, как поступит мой знакомый в той или иной ситуации"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
			Text="Я люблю планировать своё время до мелочей и с точностью до минут"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
			Text="Я склонен обращаться к врачам только тогда, когда уже невмоготу"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
			Text="Часто сам от себя не ожидаю какого-либо поступка или реакции на ситуацию"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
			Text="Я, как правило, ставлю будильник так, чтобы не только всё успеть сделать до ухода из дома, но и иметь несколько минут в запасе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
			Text="С детства для меня было типично оступаться и спотыкаться при ходьбе или беге"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
			Text="Я веду запись своих дел на день (неделю, месяц), планируя, сколько времени займёт то или иное дело"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
			Text="Прежде чем что-либо предпринять, я стараюсь предусмотреть все опасности, которые ожидают меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
			Text="Со мной нередко происходят «несчастные случаи» и случаются всяческие происшествия"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
			Text="Я живу и поступаю в соответствии с поговоркой: «Надейся на лучшее, но готовься к худшему»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
			Text="Измену супруга (супруги) предвидеть невозможно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
			Text="Как правило, я прихожу на вокзал задолго до отправления поезда"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
			Text="Неизвестность для меня очень тягостна"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
			Text="Для меня типично ударяться и ушибаться о расположенные на моём пути предметы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
			Text="Мне не нравится, когда кто-то опаздывает на встречу со мной"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
			Text="Нередко бывает, что мои успехи не оцениваются по заслугам"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
			Text="Я всегда могу точно определить, перепрыгну ли я лужу (ручей, яму) или нет."
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
			Text="Меня нередко обманывают"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
			Text="Я хорошо ориентируюсь во времени и могу с точностью до минут определить, «который сейчас час»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
			Text="Я склонен анализировать своё прошлое, искать причины случившихся несчастий и многократно проигрывать в воображении, как следовало бы поступать ранее, чтобы их избежать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
			Text="Бывало, что я не мог точно рассчитать расстояние до окружающих предметов и либо не дотягивался до них, либо промахивался, ставя предметы мимо"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
			Text="Мне не составляет труда распланировать свой путь и успеть прийти в назначенное место вовремя"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
			Text="Считаю, что пословица: «знал бы, где упасть – соломку бы постелил» правильна"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question
			Text="В поездку я беру с собой лекарства с избытком на случай, если они понадобятся кому-нибудь из моих попутчиков"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question
			Text="Если кто-либо бросает мне ключи (или иной мелкий предмет), я с лёгкостью их ловлю"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question
			Text="Я люблю помечтать о том, на что я потрачу возможный будущий выигрыш в лотерее, как поступлю с обещанным подарком"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question
			Text="Я умело и точно могу (мог ранее) издалека забрасывать мяч в корзину или бумажки в урну"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question
			Text="Я обычно склонен думать только о хорошем, а не о плохом исходе предстоящих событий для того, чтобы всё в действительности сложилось удачно и благоприятно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question
			Text="Мне достаточно один раз пройти по маршруту (в городе, лесу, здании), чтобы хорошо ориентироваться в этом месте в дальнейшем"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question
			Text="Я склонен жить, стараясь не отягощать себя раздумьями о том, что может произойти со мной в будущем"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question
			Text="Я согласен с выражением: «Не думай ни о чём, что может кончиться плохо»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question
			Text="Окружающие люди нередко бывают по отношению ко мне несправедливыми "
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question
			Text="Я легко ориентируюсь по карте в чужом, незнакомом городе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question
			Text="Я выполняю чьи-либо поручения не сразу, а лишь через некоторое время, потому что характер поручения могут внезапно изменить"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question
			Text="Я часто ношу в сумке «на всякий пожарный случай» множество вещей, которые могут мне и не пригодиться"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question
			Text="Я легко могу «подбить» муху мухобойкой или газетой"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question
			Text="Меня трудно застать врасплох"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question
			Text="Я часто бываю неуклюжим и неловким"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question
			Text="Меня считают наивным человеком, поскольку мне часто случается попадать впросак"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question
			Text="Даже если люди мне что-либо обещают, я не верю им до конца"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question
			Text="Я легко умею распределять равномерно полученную зарплату на весь месяц, чтобы не брать потом взаймы "
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question
			Text="Меня отличает от многих пунктуальность"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question
			Text="Для меня характерно путать название правой и левой стороны тела, рук или ног"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question
			Text="Я часто не могу точно рассчитать, успею ли я перейти дорогу перед движущейся в мою сторону машиной или нет"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question
			Text="Меня часто озадачивает поведение и поступки людей, которых я давно знаю"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question
			Text="Была бы моя воля, я бы обязал окружающих застраховаться от нанесения ущерба здоровью или имуществу соседям, знакомым, попутчикам и пр., поскольку многие люди безалаберны и неосторожны"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question
			Text="Близкие нередко преподносят мне сюрпризы своим поведением и высказываниями"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question
			Text="Бывает, что мне не нужны наручные часы, поскольку я могу довольно точно определить, сколько времени я занят делом и когда я должен его завершить"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question
			Text="Я склонен лучше помнить реально происшедшие со мной неприятные события, чем собственные прогнозы по поводу возможности их появления"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question
			Text="Я часто волнуюсь по поводу того, что может произойти что-то трагическое со мной или моими близкими"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question
			Text="Представляя, что с моим припозднившимся родственником случилось несчастье, я рисую в воображении множество трагических или кровавых картин"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question
			Text="При прогнозировании будущего я чаще склонен ожидать худшего, чем лучшего исхода"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question
			Text="Мне трудно распределять по дням имеющуюся у меня пищу, и я часто к концу недели (или месяца) вынужден обходиться минимумом оставшейся еды"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question
			Text="Я всегда точно могу сказать, сколько денег я потратил, и сколько у меня осталось"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question
			Text="Мне часто казалось, что у меня ещё «уйма времени», чтобы успеть прийти вовремя на работу (учёбу, встречу), но я, несмотря на свои прогнозы, опаздывал"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question
			Text="Своему супругу (супруге) или другу я доверяю полностью и убеждён, что он (она) меня никогда не обманет и не предаст"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question
			Text="Я нередко думаю о том, что буду делать, если меня вдруг уволят с работы (отчислят из института или мой бизнес рухнет)"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question
			Text="Если уж страховать своё имущество (квартиру, дачу, дом), то страховать от всего (включая стихийные бедствия – ураган, землетрясение, молнию), а не только от пожара или затопления"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question
			Text="Я не люблю, когда люди «делят шкуру неубитого медведя»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question
			Text="Я редко продумываю заранее «отходные варианты», редко готовлю «запасной аэродром», поскольку рассчитываю на успех"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question
			Text="Я бы предпочёл сделать необходимую хирургическую операцию заранее, до того, как болезнь обострится"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question
			Text="Уезжая из дома, я всегда беру с собой в дорогу набор лекарств на случай непредвиденных обстоятельств"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question
			Text="Моё имущество, как правило, застраховано и я слежу, чтобы страховка не была просрочена"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question
			Text="У меня, как правило, имеется дома запас продуктов на случай, если они вдруг окажутся в дефиците или неожиданно «нагрянут гости»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 72-->
        <q:Question
			Text="Я нередко просыпаюсь утром за несколько секунд или минут до звонка будильника"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 73-->
        <q:Question
			Text="Знакомые считают меня прозорливым человеком"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 74-->
        <q:Question
			Text="Считаю, что страховать себя от внезапной смерти или болезни – пустая трата денег"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 75-->
        <q:Question
			Text="Анекдоты для меня редко бывают смешными по причине того, что я заранее предполагаю развязку"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 76-->
        <q:Question
			Text="Нередко я оказываюсь в выигрышном положении по сравнению с другими, потому что раньше их догадываюсь, что может произойти и упреждаю события"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 77-->
        <q:Question
			Text="Я понимаю правильность поговорки: «скупой платит дважды», но, как правило, не могу сразу расстаться с большой суммой денег"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 78-->
        <q:Question
			Text="Я умею быть предупредительным, оказывать близким знаки внимания и выполнять их желания до того, как они успевают их высказать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 79-->
        <q:Question
			Text="Я вполне доверяю предсказаниям гороскопов и следую содержащимся в них рекомендациям"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 80-->
        <q:Question
			Text="У меня так много дел, что я часто не успеваю все их сделать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 81-->
        <q:Question
			Text="Прогнозировать будущее – бесполезное дело"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>

</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Голланд.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Из предложенных пар профессий выберите одну, которая Вам больше подходит (исходя из Ваших способностей и возможностей).
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения указателя курсора на соответствующий ответ».
        </Paragraph>
    </FlowDocument>
    
    <k:Голланд x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Адаптивность"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>инженер-техник</q:Answer>
                <q:Answer>инженер-контролёр</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 2-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>вязальщик</q:Answer>
                <q:Answer>санитарный врач</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 3-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>повар</q:Answer>
                <q:Answer>наборщик</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 4-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>фотограф</q:Answer>
                <q:Answer>заведующий магазином</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 5-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>чертёжник</q:Answer>
                <q:Answer>дизайнер</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 6-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>философ</q:Answer>
                <q:Answer>психиатр</q:Answer>
            </q:AnswersCollection>
        </q:Question>
       
        <!--Вопрос 7-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>ученый-химик</q:Answer>
                <q:Answer>бухгалтер</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 8-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>редактор научного журнала</q:Answer>
                <q:Answer>адвокат</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 9-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>лингвист</q:Answer>
                <q:Answer>переводчик художественной литературы</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 10-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>педиатр</q:Answer>
                <q:Answer>статистик</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 11-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>организатор воспитательной работы</q:Answer>
                <q:Answer>председатель профсоюза</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 12-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>спортивный врач</q:Answer>
                <q:Answer>фельетонист</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 13-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>нотариус</q:Answer>
                <q:Answer>снабженец</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 14-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>фасовщик</q:Answer>
                <q:Answer>карикатурист</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 15-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>политический деятель</q:Answer>
                <q:Answer>писатель</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 16-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>садовник</q:Answer>
                <q:Answer>метеоролог</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 17-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>водитель</q:Answer>
                <q:Answer>медсестра</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 18-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>инженер-электрик</q:Answer>
                <q:Answer>секретарь-машинистка</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 19-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>маляр</q:Answer>
                <q:Answer>художник по металлу</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 20-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>биолог</q:Answer>
                <q:Answer>главный врач</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 21-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>телеоператор</q:Answer>
                <q:Answer>режиссёр</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 22-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>гидролог</q:Answer>
                <q:Answer>ревизор</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 23-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>зоолог</q:Answer>
                <q:Answer>зоотехник</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 24-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>математик</q:Answer>
                <q:Answer>архитектор</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 25-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>работник МВД</q:Answer>
                <q:Answer>учётчик</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 26-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>учитель</q:Answer>
                <q:Answer>общественный деятель</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 27-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>воспитатель</q:Answer>
                <q:Answer>художник по керамике</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 28-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>экономист</q:Answer>
                <q:Answer>заведующий отделом</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 29-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>корректор</q:Answer>
                <q:Answer>критик</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 30-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>завхоз</q:Answer>
                <q:Answer>директор</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 31-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>радиоинженер</q:Answer>
                <q:Answer>специалист по ядерной физике</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 32-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>наладчик</q:Answer>
                <q:Answer>механик</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 33-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>агроном</q:Answer>
                <q:Answer>председатель кооператива</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 34-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>закройщик-модельер</q:Answer>
                <q:Answer>декоратор</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 35-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>археолог</q:Answer>
                <q:Answer>эксперт</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 36-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>работник музея</q:Answer>
                <q:Answer>консультант</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 37-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>ученый</q:Answer>
                <q:Answer>актёр</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 38-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>логопед</q:Answer>
                <q:Answer>стенографист</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 39-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>врач</q:Answer>
                <q:Answer>дипломат</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 40-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>главный бухгалтер</q:Answer>
                <q:Answer>директор</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 41-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>поэт</q:Answer>
                <q:Answer>психолог</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 42-->
        <q:Question>
            <q:AnswersCollection>
                <q:Answer>архивариус</q:Answer>
                <q:Answer>скульптор</q:Answer>
            </q:AnswersCollection>
        </q:Question>

    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Дигностика_уровня_агрессии_Басс_Дарки.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам предлагается ответить на ряд утверждений, которые необходимо соотнести с собственными 
            взглядами и поведением. Вам предлагается сделать выбор из двух вариантов ответа: ДА, НЕТ.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на 
            соответствующий ответ. Помните, что нет ответов «хороших» или «плохих».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:Дигностика_уровня_агрессии_Басс_Дарки x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Диагностика уровня агрессии (Басс-Дарки)"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}"
        x:Shared="False">
        <!--Вопрос 1-->
        <q:Question
            Text="Временами я не могу справиться с желанием причинить вред другим"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
            Text="Иногда сплетничаю о людях, которых не люблю"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
            Text="Я легко раздражаюсь, но быстро успокаиваюсь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
            Text="Если меня не попросят по-хорошему, я не выполню"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
            Text="Я не всегда получаю то, что мне положено"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
            Text="Я не знаю, что люди говорят обо мне за моей спиной"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
            Text="Если я не одобряю поведение друзей, я даю им это почувствовать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
            Text="Когда мне случалось обмануть кого-нибудь, я испытывал мучительные угрызения совести"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
            Text="Мне кажется, что я не способен ударить человека"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
            Text="Я никогда не раздражаюсь настолько, чтобы кидаться предметами"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
            Text="Я всегда снисходителен к чужим недостаткам"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
            Text="Если мне не нравится установленное правило, мне хочется нарушить его"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
            Text="Другие умеют почти всегда пользоваться благоприятными обстоятельствами"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
            Text="Я держусь настороженно с людьми, которые относятся ко мне несколько более дружественно, чем я ожидал"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
            Text="Я часто бываю не согласен с людьми"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
            Text="Иногда мне на ум приходят мысли, которых я стыжусь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
            Text="Если кто-нибудь первым ударит меня, я не отвечу ему"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
            Text="Когда я раздражаюсь, я хлопаю дверями"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
            Text="Я гораздо более раздражителен, чем кажется"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
            Text="Если кто-то воображает себя начальником, я всегда поступаю ему наперекор"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
            Text="Меня немного огорчает моя судьба"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
            Text="Я думаю, что многие люди не любят меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
            Text="Я не могу удержаться от спора, если люди не согласны со мной"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
            Text="Люди, увиливающие от работы, должны испытывать чувство вины"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
            Text="Тот, кто оскорбляет меня и мою семью, напрашивается на драку"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
            Text="Я не способен на грубые шутки"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
            Text="Меня охватывает ярость, когда надо мной насмехаются"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
            Text="Когда люди строят из себя начальников, я делаю все, чтобы они не зазнавались"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
            Text="Почти каждую неделю я вижу кого-нибудь, кто мне не нравится"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
            Text="Довольно многие люди завидуют мне"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question
            Text="Я требую, чтобы люди уважали меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question
            Text="Меня угнетает то, что я мало делаю для своих родителей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question
            Text="Люди, которые постоянно изводят вас, стоят того, чтобы их «щёлкнули по носу»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question
            Text="Я никогда не бываю мрачен от злости"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question
            Text="Если ко мне относятся хуже, чем я того заслуживаю, я не расстраиваюсь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question
            Text="Если кто-то выводит меня из себя, я не обращаю внимания"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question
            Text="Хотя я и не показываю этого, меня иногда гложет зависть"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question
            Text="Иногда мне кажется, что надо мной смеются"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question
            Text="Даже если я злюсь, я не прибегаю к «сильным» выражениям"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question
            Text="Мне хочется, чтобы мои грехи были прощены"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question
            Text="Я редко даю сдачи, даже если кто-нибудь ударит меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question
            Text="Когда получается не по-моему, я иногда обижаюсь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question
            Text="Иногда люди раздражают меня одним своим присутствием"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question
            Text="Нет людей, которых бы я по-настоящему ненавидел"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question
            Text="Мой принцип: «Никогда не доверять «чужакам»»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question
            Text="Если кто-нибудь раздражает меня, я готов сказать, что я о нем думаю"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question
            Text="Я делаю много такого, о чём впоследствии жалею"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question
            Text="Если я разозлюсь, я могу ударить кого-нибудь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question
            Text="С детства я никогда не проявлял вспышек гнева"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question
            Text="Я часто чувствую себя как пороховая бочка, готовая взорваться"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question
            Text="Если бы все знали, что я чувствую, меня бы считали человеком, с которым нелегко работать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question
            Text="Я всегда думаю о том, какие тайные причины заставляют людей делать что-нибудь приятное для меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question
            Text="Когда на меня кричат, я начинаю кричать в ответ"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question
            Text="Неудачи огорчают меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question
            Text="Я дерусь не реже и не чаще чем другие"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question
            Text="Я могу вспомнить случаи, когда я был настолько зол, что хватал попавшуюся мне под руку вещь и ломал её"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question
            Text="Иногда я чувствую, что готов первым начать драку"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question
            Text="Иногда я чувствую, что жизнь поступает со мной несправедливо"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question
            Text="Раньше я думал, что большинство людей говорит правду, но теперь я в это не верю"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question
            Text="Я ругаюсь только со злости"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question
            Text="Когда я поступаю неправильно, меня мучает совесть"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question
            Text="Если для защиты своих прав мне нужно применить физическую силу, я применяю её"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question
            Text="Иногда я выражаю свой гнев тем, что стучу кулаком по столу"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question
            Text="Я бываю грубоват по отношению к людям, которые мне не нравятся"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question
            Text="У меня нет врагов, которые бы хотели мне навредить"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question
            Text="Я не умею поставить человека на место, даже если он того заслуживает"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question
            Text="Я часто думаю, что жил неправильно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question
            Text="Я знаю людей, которые способны довести меня до драки"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question
            Text="Я не огорчаюсь из-за мелочей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question
            Text="Мне редко приходит в голову, что люди пытаются разозлить или оскорбить меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question
            Text="Я часто только угрожаю людям, хотя и не собираюсь приводить угрозы в исполнение"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 72-->
        <q:Question
            Text="В последнее время я стал занудой"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 73-->
        <q:Question
            Text="В споре я часто повышаю голос"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 74-->
        <q:Question
            Text="Я стараюсь обычно скрывать своё плохое отношение к людям"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 75-->
        <q:Question
            Text="Я лучше соглашусь с чем-либо, чем стану спорить"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>
    
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\ДОРС.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам предлагается ряд высказываний, характеризующих чувства и ощущения, которые могут возникнуть 
            у Вас в процессе работы. Прочитайте, пожалуйста, внимательно каждое из них и оцените, насколько 
            оно соответствует Вашим обычным переживаниям во время рабочей смены.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам предлагается на выбор 4 варианта ответа:
        </Paragraph>
        <List MarkerStyle="Circle" Margin="0">
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    почти никогда,
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    иногда,
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    часто,
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    почти всегда
                </Paragraph>
            </ListItem>
        </List>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующий 
            ответ. При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих»: важно объективно оценивать свои ощущения. Если 
            Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>почти никогда</q:Answer>
        <q:Answer>иногда</q:Answer>
        <q:Answer>часто</q:Answer>
        <q:Answer>почти всегда</q:Answer>
    </q:AnswersCollection>

    <k:ДОРС x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Дифференцированная оценка состояния сниженной работоспособности"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question
			Text="Работа доставляет мне удовольствие"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
			Text="Я с лёгкостью могу полностью сконцентрироваться на работе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
			Text="Работа не кажется мне «тупой» или слишком однообразной"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
			Text="Я работаю почти с отвращением"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
			Text="Я чувствую себя неповоротливым и сонным"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
			Text="Хотелось бы, чтобы в моей работе было побольше разнообразных заданий"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
			Text="У меня возникает чувство неуверенности при выполнении работы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
			Text="На возникающие помехи и неполадки в работе я реагирую спокойно и  собранно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
			Text="Чтобы справляться с выполнением рабочих заданий, мне приходится затрачивать гораздо больше усилий, чем обычно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
			Text="Моя работа идёт без особого напряжения"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
			Text="Я теряю общий контроль над рабочей ситуацией"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
			Text="Я чувствую себя утомлённым"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
			Text="Я продолжаю работать и дальше, хотя не испытываю особого интереса"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
			Text="Всё, что происходит на моём рабочем месте, я могу контролировать без всякого напряжения"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
			Text="Я работаю с неохотой"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
			Text="Я пытаюсь изменить деятельность или отвлечься, чтобы преодолеть чувство усталости"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
			Text="Я нахожу свою работу достаточно приятной и интересной"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
			Text="Бывает, что в некоторых рабочих ситуациях я испытываю страх"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
			Text="На работе я вялый и безрадостный"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
			Text="Работа не очень тяготит меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
			Text="Мне приходится заставлять себя работать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
			Text="Возникают ситуации, когда приходится мгновенно собраться и принимать решения, чтобы предотвратить возможные сбои и неполадки в работе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
			Text="Во время работы мне хочется встать, немного размяться и подвигаться"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
			Text="Я на грани того, чтобы заснуть прямо за работой"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
			Text="Моя работа полна разнообразных заданий"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
			Text="Я с удовольствием выполняю свою работу"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
			Text="Мне кажется, что я легко могу справиться с любой поставленной передо мной рабочей задачей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
			Text="Я собран и полностью включён в выполнение любого порученного мне задания"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
			Text="Я могу без труда принять все необходимые меры для преодоления сложных ситуаций"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
			Text="Время за работой пролетает незаметно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question
			Text="Я привык к тому, что в моей работе постоянно может случаться что-то непредвиденное"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question
			Text="Я реагирую на происходящее недостаточно быстро"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question
			Text="Я ловлю себя на ощущении, что время как бы остановилось"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question
			Text="Мне становится не по себе при любом, даже незначительном сбое или помехе в работе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question
			Text="Моя работа слишком однообразна и я был бы рад любому изменению в течение рабочего процесса"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question
			Text="Я сыт по горло этой работой"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question
			Text="Я чувствую себя измученным и совершенно разбитым"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question
			Text="Мне нетрудно самостоятельно принимать любые решения, касающиеся выполнения моей работы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question
			Text="В последнее время работа не приносит мне и половины обычного удовольствия"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question
			Text="Я чувствую нервозность и повышенную раздражительность"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>

</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Зунг.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Прочитайте внимательно каждое из показанных Вам утверждений и выберите свой вариант ответа в зависимости от того,
            как вы себя чувствуете в последнее время.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Варианты ответа:
        </Paragraph>
        <List MarkerStyle="Box">
            <ListItem>
                <Paragraph>«никогда или изредка»</Paragraph>
            </ListItem>
            <ListItem>
                <Paragraph>«иногда»</Paragraph>
            </ListItem>
            <ListItem>
                <Paragraph>«часто»</Paragraph>
            </ListItem>
            <ListItem>
                <Paragraph>«почти всегда или постоянно»</Paragraph>
            </ListItem>
        </List>
        <Paragraph 
            TextIndent="20">
            Выбор производится нажатием на соответствующее вариант ответа с помощью «мыши».
            После сделанного выбора Вам будут показано очередное утверждение.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Будьте искренними. Над ответами долго не задумывайтесь, поскольку правильных или неправильных ответов нет».
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>никогда или изредка</q:Answer>
        <q:Answer>иногда</q:Answer>
        <q:Answer>часто</q:Answer>
        <q:Answer>почти всегда или постоянно</q:Answer>
    </q:AnswersCollection>

    <k:Зунг x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Тест Зунга"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question Text="Я чувствую подавленность, тоску."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question Text=" Утром я чувствую себя лучше всего."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text=" У меня бывают периоды плача или близости к слезам."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text=" У меня плохой ночной сон."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text=" Аппетит у меня не хуже обычного."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text=" Мне приятно смотреть на привлекательных женщин, разговаривать с ними, находиться рядом."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text=" Я замечаю, что теряю вес."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text=" Меня беспокоят запоры."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text=" Сердце бьется быстрее, чем обычно."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text=" Я устаю без всяких причин."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text=" Я мыслю так же ясно, как всегда."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text=" Мне легко делать то, что я умею."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text=" Чувствую беспокойство и не могу усидеть на месте."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text=" У меня есть, надежды на будущее."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text=" Я более раздражителен, чем обычно."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text=" Мне легко принимать решения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text=" Я чувствую, что полезен и необходим."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text=" Я живу достаточно полной жизнью."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text=" Я чувствую, что другим людям станет лучше, если я умру."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text=" Меня до сих пор радует то, что радовало всегда."
Answers="{ StaticResource Answers}">
        </q:Question>

    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Индекс_жизненного_стиля.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам предлагается тест, содержащий 97 утверждений. Внимательно прочитайте каждое утверждение 
            и решите: верно или неверно оно по отношению к Вам.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на 
            соответствующий ответ (ДА или НЕТ). При необходимости Вы можете вернуться к предыдущему вопросу, 
            нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:Индекс_жизненного_стиля x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Механизмы психологической защиты (Индекс жизненного стиля)"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question
            Text="Я очень лёгкий человек и со мной легко ужиться"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
            Text="Когда я хочу чего-нибудь, я никак не могу дождаться, когда это получу"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
            Text="Всегда существовал человек, на которого я хотел бы походить"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
            Text="Люди не считают меня эмоциональным человеком"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
            Text="Я выхожу из себя, когда смотрю фильмы непристойного содержания"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
            Text="Я редко помню свои сны"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
            Text="Меня бесят люди, которые всеми вокруг командуют"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
            Text="Иногда у меня появляется сильное желание пробить стену кулаком"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
            Text="Меня раздражает тот факт, что люди слишком много задаются"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
            Text="В мечтах я всегда в центре внимания"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
            Text="Я человек, который никогда не плачет"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
            Text="Необходимость пользоваться общественным туалетом заставляет меня совершать над собой усилие"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
            Text="Я всегда готов выслушать обе стороны во время спора"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
            Text="Меня легко вывести из себя"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
            Text="Когда кто-нибудь толкает меня в толпе, я чувствую, что готов толкнуть его в ответ"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
            Text="Многое во мне людей восхищает"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
            Text="Я полагаю, что лучше хорошенько обдумать что-нибудь до конца, чем приходить в ярость"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
            Text="Я много болею"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
            Text="У меня плохая память"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
            Text="Когда меня отвергают, у меня появляются мысли о самоубийстве"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
            Text="Когда я слышу сальности (непристойные грубые шутки), я очень смущаюсь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
            Text="Я всегда вижу светлую сторону вещей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
            Text="Я ненавижу злобных людей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
            Text="Мне трудно избавиться от чего-либо, что принадлежит мне"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
            Text="Я с трудом запоминаю имена"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
            Text="У меня склонность к излишней импульсивности"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
            Text="Люди, которые добиваются своего криком и воплями, вызывают у меня отвращение"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
            Text="Я свободен от предрассудков"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
            Text="Мне крайне необходимо, чтобы люди говорили мне о моей сексуальной привлекательности"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
            Text="Когда я собираюсь в поездку, я планирую каждую деталь заранее"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question
            Text="Иногда мне хочется, чтобы атомная бомба разрушила весь мир"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question
            Text="Порнография отвратительна"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question
            Text="Когда я чем-нибудь расстроен, я много ем"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question
            Text="Люди мне никогда не надоедают"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question
            Text="Многое из своего детства я не могу вспомнить"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question
            Text="Когда я собираюсь в отпуск, я обычно беру с собой работу"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question
            Text="В своих фантазиях я совершаю великие поступки"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question
            Text="В большинстве своём люди раздражают меня, так как они слишком эгоистичны"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question
            Text="Прикосновение к чему-нибудь осклизлому, скользкому вызывает у меня отвращение"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question
            Text="Если кто-нибудь надоедает мне, я не говорю это ему, а стремлюсь выразить свое недовольство кому-нибудь другому"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question
            Text="Я полагаю, что люди обведут вас вокруг пальца, если вы не будете осторожны"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question
            Text="Мне требуется много времени, чтобы разглядеть плохие качества в других людях"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question
            Text="Я никогда не волнуюсь, когда читаю или слышу о какой-либо трагедии"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question
            Text="В споре я обычно более логичен, чем другой человек"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question
            Text="Мне совершенно необходимо слышать комплименты"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question
            Text="Беспорядочность отвратительна"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question
            Text="Когда я веду машину, у меня иногда появляется сильное желание толкнуть другую машину"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question
            Text="Иногда, когда у меня что-нибудь не получается, я злюсь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question
            Text="Когда я вижу кого-нибудь в крови, это меня почти не беспокоит"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question
            Text="У меня портится настроение, я раздражаюсь, когда на меня не обращают внимание"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question
            Text="Люди говорят мне, что я всему верю"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question
            Text="Я ношу одежду, которая скрывает мои недостатки"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question
            Text="Мне очень трудно пользоваться неприличными словами"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question
            Text="Мне кажется, я много спорю с людьми"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question
            Text="Меня отталкивает от людей то, что они неискренни"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question
            Text="Люди говорят мне, что я слишком беспристрастен во всем"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question
            Text="Я знаю, что мои моральные стандарты выше, чем у большинства других людей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question
            Text="Когда я не могу справиться с чем-либо, я готов заплакать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question
            Text="Мне кажется, что я не могу выражать свои эмоции"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question
            Text="Когда кто-нибудь толкает меня, я прихожу в ярость"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question
            Text="То, что мне не нравится, я выбрасываю из головы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question
            Text="Я очень редко испытываю чувства привязанности"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question
            Text="Я терпеть не могу людей, которые всегда стараются быть в центре внимания"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question
            Text="Я многое коллекционирую"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question
            Text="Я работаю более упорно, чем большинство людей, для того, чтобы добиться результатов в области, которая меня интересует"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question
            Text="Звуки детского плача не беспокоят меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question
            Text="Я бываю так сердит, что мне хочется крушить все вокруг"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question
            Text="Я всегда оптимистичен"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question
            Text="Я многу лгу"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question
            Text="Я больше привязан к самому процессу работы, чем к отношениям, которые складываются вокруг неё"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question
            Text="В основном люди несносны"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 72-->
        <q:Question
            Text="Я бы ни за что не пошел на фильм, в котором слишком много сексуальных сцен"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 73-->
        <q:Question
            Text="Меня раздражает то, что людям нельзя доверять"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 74-->
        <q:Question
            Text="Я буду делать всё, чтобы произвести хорошее впечатление"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 75-->
        <q:Question
            Text="Я не понимаю некоторых своих поступков"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 76-->
        <q:Question
            Text="Я через силу смотрю кинокартины, в которых много насилия"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 77-->
        <q:Question
            Text="Я думаю, что ситуация в мире намного лучше, чем большинство людей думают"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 78-->
        <q:Question
            Text="Когда у меня неудача, я не могу сдержать плохого настроения"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 79-->
        <q:Question
            Text="То, как люди одеваются сейчас на пляже – неприлично"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 80-->
        <q:Question
            Text="Я не позволяю своим эмоциям захватывать меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 81-->
        <q:Question
            Text="Я всегда планирую наихудшее с тем, чтобы не быть застигнутым врасплох"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 82-->
        <q:Question
            Text="Я живу так хорошо, что многие люди хотели бы оказаться в моём положении"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 83-->
        <q:Question
            Text="Как-то я был так сердит, что сильно саданул по чему-то и случайно поранил себя"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 84-->
        <q:Question
            Text="Я испытываю отвращение, когда сталкиваюсь с людьми низкого морального уровня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 85-->
        <q:Question
            Text="Я почти ничего не помню о своих первых годах в школе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 86-->
        <q:Question
            Text="Когда я расстроен, я невольно поступаю как ребёнок"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 87-->
        <q:Question
            Text="Я предпочитаю больше говорить о своих мыслях, чем о чувствах"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 88-->
        <q:Question
            Text="Мне кажется, что я не могу закончить ничего из того, что начал"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 89-->
        <q:Question
            Text="Когда я слышу о жестокостях, это не трогает меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 90-->
        <q:Question
            Text="В моей семье почти никогда не противоречат друг другу"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 91-->
        <q:Question
            Text="Я много кричу на людей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 92-->
        <q:Question
            Text="Ненавижу людей, которые топчут других, чтобы продвинуться вперед"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 93-->
        <q:Question
            Text="Когда я расстроен, я часто напиваюсь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 94-->
        <q:Question
            Text="Я счастлив, что у меня меньше проблем, чем у большинства людей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 95-->
        <q:Question
            Text="Когда что-нибудь расстраивает меня, я сплю более чем обычно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 96-->
        <q:Question
            Text="Я нахожу отвратительным, что большинство людей лгут для того, чтобы добиться успеха"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 97-->
        <q:Question
            Text="Я говорю много неприличных слов"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>
    
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Исследование_волевой_саморегуляции.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам предлагается тест, содержащий 30 утверждений. Внимательно прочитайте каждое утверждение и 
            решите: верно («ДА») или неверно («НЕТ») оно по отношению к Вам.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующий
            ответ. При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:Исследование_волевой_саморегуляции x:Key="Keys" x:Shared="False" />
    
    <q:Questionnaire
        x:Key="Test"
        Title="Исследование волевой саморегуляции"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question
            Text="Если что-то не клеится, у меня появляется желание бросить это дело"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
            Text="Я не отказываюсь от своих планов и дел, даже если приходится выбирать между ними и приятной компанией"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
            Text="При необходимости мне нетрудно сдержать вспышку гнева"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
            Text="Обычно я сохраняю спокойствие в ожидании опаздывающего к назначенному времени приятеля"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
            Text="Меня трудно отвлечь от начатой работы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
            Text="Меня сильно выбивает из колеи физическая боль"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
            Text="Я всегда стараюсь выслушать собеседника, не перебивая, даже если не терпится ему возразить"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
            Text="Я всегда «гну» свою линию"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
            Text="Если надо, я могу не спать ночь напролёт (например, работа, дежурство) и весь следующий день быть в «хорошей форме»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
            Text="Мои планы слишком часто перечёркиваются внешними обстоятельствами"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
            Text="Я считаю себя терпеливым человеком"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
            Text="Не так-то просто мне заставить себя хладнокровно наблюдать волнующее зрелище"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
            Text="Мне редко удаётся заставить себя продолжать работу после серии обидных неудач"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
            Text="Если я отношусь к кому-то плохо, мне трудно скрывать свою неприязнь к нему"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
            Text="При необходимости я могу заниматься своим делом в неудобной и неподходящей обстановке"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
            Text="Мне сильно осложняет работу сознание того, что ее необходимо во что бы то ни стало сделать к определённому сроку"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
            Text="Считаю себя решительным человеком"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
            Text="С физической усталостью я справляюсь легче, чем другие"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
            Text="Лучше подождать только что ушедший лифт, чем подниматься по лестнице"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
            Text="Испортить мне настроение не так-то просто"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
            Text="Иногда какой-то пустяк овладевает моими мыслями, не даёт покоя, и я никак не могу от него отделаться"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
            Text="Мне труднее сосредоточиться на задании или работе, чем другим"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
            Text="Переспорить меня трудно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
            Text="Я всегда стремлюсь довести начатое дело до конца"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
            Text="Меня легко отвлечь от дел"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
            Text="Я замечаю иногда, что пытаюсь добиться своего наперекор объективным обстоятельствам"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
            Text="Люди порой завидуют моему терпению и дотошности"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
            Text="Мне трудно сохранить спокойствие в стрессовой ситуации"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
            Text="Я замечаю, что во время монотонной работы невольно начинаю изменять способ действия, даже если это порой приводит к ухудшению результатов"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
            Text="Меня обычно сильно раздражает, когда «перед носом» захлопываются двери уходящего транспорта или лифта"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>
    
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\КОПС.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам будут предложены утверждения, описывающие различные стороны состояния и поведения человека.
        </Paragraph>
        <Paragraph
            TextIndent="20">
            Внимательно прочитайте каждое утверждение и оцените, насколько описанные в нём признаки свойственны 
            Вам, имея в виду не сегодняшний день, а более длительный отрезок времени (например, последний год).
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Для выражения степени Вашего согласия или несогласия с каждым из утверждений 
            воспользуйтесь 6-уровневой шкалой:
        </Paragraph>
        <List MarkerStyle="Circle" Margin="0">
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    А – совершенно верно;
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    Б – верно;
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    В – пожалуй, верно;
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    Г – пожалуй, неверно;
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    Д – неверно;
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    Е – совершенно неверно.
                </Paragraph>
            </ListItem>
        </List>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующий
            ответ. Не тратьте много времени на обдумывание ответов: давайте тот ответ, который первым приходит 
            в голову. Не стремитесь «улучшить» или «ухудшить» Answers - методика улавливает искажения и 
            неискренность ответов. Вместе с тем, Вы можете быть уверены, что Ваши Answers не будут разглашены 
            или использованы Вам во вред. В случае затруднения старайтесь представить наиболее типичную ситуацию, 
            соответствующую смыслу утверждения, и, исходя из неё, выбирайте ответ.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>А – совершенно верно</q:Answer>
        <q:Answer>Б – верно</q:Answer>
        <q:Answer>В – пожалуй, верно</q:Answer>
        <q:Answer>Г – пожалуй, неверно</q:Answer>
        <q:Answer>Д – неверно</q:Answer>
        <q:Answer>Е – совершенно неверно</q:Answer>
    </q:AnswersCollection>

    <k:КОПС x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Комплексная оценка психологического состояния"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question
			Text="Я готов ответить на все вопросы как можно более искренно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
			Text="Масса мелких неприятностей выводит меня из себя"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
			Text="Я предпочитаю ставить перед собой труднодостижимые цели и добиваться их"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
			Text="Бывает, что я откладываю назавтра то, что должен сделать сегодня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
			Text="Мне часто кажется, что во мне слишком мало хорошего"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
			Text="Я полагаю, что людям доверять нельзя"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
			Text="Непредвиденные трудности порой сильно утомляют меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
			Text="Часто я чувствую себя бесполезным"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
			Text="Трудные задачи меня бодрят и даже поднимают настроение"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
			Text="В последнее время мне всё труднее сдерживать свою досаду или гнев"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
			Text="Люди в большинстве своем добры и готовы прийти на помощь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
			Text="У меня возникает чувство неуверенности при выполнении своей работы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
			Text="Бывает, что я с кем-то посплетничаю"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
			Text="У меня часто возникает предчувствие, что меня ожидает какое-то наказание, даже если я не совершил ничего предосудительного"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
			Text="Я чувствую, как с каждым годом растут мои профессиональные знания и навыки"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
			Text="У меня есть основания быть о себе невысокого мнения"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
			Text="Я полон энергии"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
			Text="Мои манеры за столом дома обычно не так хороши, как в гостях"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
			Text="Очень часто какой-нибудь пустяк овладевает моими мыслями и беспокоит меня несколько дней"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
			Text="Я постоянно занят, и мне это нравится"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
			Text="Очень часто я чувствую себя усталым, вялым"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
			Text="В целом, люди достойны доверия"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
			Text="Есть очень много вещей, которые меня легко раздражают"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
			Text="Можно сказать, что я себе нравлюсь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
			Text="Я тревожусь чаще других"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
			Text="Мне нравится решать вновь возникающие проблемы и преодолевать трудности - это придаёт мне больше уверенности в своих силах"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
			Text="Мне кажется, что я близок к нервному срыву"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
			Text="Я стараюсь быть в курсе всего происходящего"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
			Text="Иногда я перехожу улицу там, где мне удобно, а не там, где положено"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
			Text="Я часто испытываю общую слабость"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question
			Text="Если я за что-то берусь, то, как правило, добиваюсь успеха"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question
			Text="Люди часто разочаровывают меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question
			Text="Я испытываю неопределенное беспокойство, боязнь, сам не знаю отчего"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question
			Text="Я в состоянии принять все необходимые меры для преодоления сложных ситуаций"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question
			Text="Часто на меня наваливается хандра (тоскливое настроение)"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question
			Text="Иногда бывает, что я немного хвастаюсь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question
			Text="Мне часто говорят, что я вспыльчив"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question
			Text="Я люблю знакомиться с новыми людьми"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question
			Text="Я часто не уверен в правильности собственных решений"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question
			Text="Я всегда контролирую ситуацию настолько, насколько это необходимо"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question
			Text="Среди моих знакомых есть люди, которые мне не нравятся"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question
			Text="Иногда мне кажется, что никому нет до меня дела"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question
			Text="Испытав поражение, я буду пытаться достичь намеченной цели снова и снова"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question
			Text="Я часто чувствую себя «выжатым, как лимон»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question
			Text="Меня вполне можно назвать интересным и привлекательным человеком"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question
			Text="Мои мысли постоянно возвращаются к возможным неудачам, и мне трудно направить их в другое русло"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question
			Text="Порой всё, что я делаю, кажется мне бесполезным"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question
			Text="Я легко схожусь с людьми"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question
			Text="Мне становится не по себе при любом незначительном сбое или помехе в работе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question
			Text="Мне кажется, что я не так удачлив, как большинство людей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question
			Text="Когда я неважно себя чувствую, я бываю раздражительным"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question
			Text="У меня часто болит голова"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question
			Text="Как правило, я работаю с удовольствием"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question
			Text="При возникновении некоторых рабочих ситуаций я испытываю страх"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question
			Text="Я довольно вынослив по отношению к длительным нервно-психическим нагрузкам"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question
			Text="Когда что-то не по мне, я очень легко теряю терпение"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question
			Text="Если человек живёт и поступает по совести, то судьба, как правило, к нему благосклонна"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question
			Text="Я стал часто ссориться со своими друзьями и знакомыми"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question
			Text="Мои достоинства вполне перевешивают мои недостатки"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question
			Text="Вряд ли я могу полностью довериться кому-либо"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question
			Text="Иногда меня пугают мысли о будущем"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question
			Text="Друзья уважают меня за упорство в делах"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question
			Text="Утром, после пробуждения, я ещё долго чувствую себя усталым и разбитым"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question
			Text="Бывает, что я говорю о вещах, в которых совсем не разбираюсь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question
			Text="Порой мне кажется, что все мои усилия тщетны"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question
			Text="В общем-то, я ценю себя достаточно высоко"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question
			Text="Мне кажется, что жизнь проходит мимо меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question
			Text="Порой я так устаю, что уже ничто не может заинтересовать меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question
			Text="Как правило, окружающие слушают меня внимательно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question
			Text="Чаще всего у меня беспокойный сон"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question
			Text="В большинстве случаев я легко преодолеваю разочарования"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 72-->
        <q:Question
			Text="Я часто испытываю чувство напряжения и беспокойства, думая о происшедшем в течение дня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 73-->
        <q:Question
			Text="Часто неприличная или даже непристойная шутка меня смешит"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 74-->
        <q:Question
			Text="Я всегда уверен, что смогу воплотить в жизнь задуманное"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 75-->
        <q:Question
			Text="Иногда я чувствую себя лишним даже в кругу друзей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 76-->
        <q:Question
			Text="Мне кажется, что если я буду откровенен с людьми, они используют это против меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 77-->
        <q:Question
			Text="Возникающие проблемы часто кажутся мне неразрешимыми"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 78-->
        <q:Question
			Text="Можно сказать, что я в целом удовлетворён своей работой"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 79-->
        <q:Question
			Text="Я часто плохо засыпаю"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 80-->
        <q:Question
			Text="Мне всё быстро надоедает"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 81-->
        <q:Question
			Text="На возникающие помехи и неполадки в работе я реагирую спокойно и собранно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 82-->
        <q:Question
			Text="Я чувствую нервозность и повышенную раздражительность"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 83-->
        <q:Question
			Text="Мне приходится заставлять себя работать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 84-->
        <q:Question
			Text="В выходные дни я предпочитаю активный отдых"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 85-->
        <q:Question
			Text="Бывает, жизнь кажется мне скучной и бесцветной"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 86-->
        <q:Question
			Text="В последнее время меня стали раздражать вещи, к которым раньше я относился спокойно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 87-->
        <q:Question
			Text="Люди, с которыми я работаю, уважают меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 88-->
        <q:Question
			Text="Бывает, на меня наваливается столько проблем, что просто руки опускаются"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 89-->
        <q:Question
			Text="Я опасаюсь, что человек, которому я доверюсь, может предать меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 90-->
        <q:Question
			Text="Я смотрю в будущее с полной уверенностью"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>

</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Личностный_профиль.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам предлагается ответить на ряд вопросов, касающихся некоторых сторон Вашего характера и самочувствия.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Прочитав каждый вопрос, постарайтесь представить типичную ситуацию и дайте тот ответ, 
            который наиболее точно отражает Ваш обычный стиль поведения в последние годы. Вам предлагается 
            на выбор 4 варианта ответа:
        </Paragraph>
        <List MarkerStyle="Circle" Margin="0">
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    А - да, это так (совершенно верно);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    Б - пожалуй, это так (скорее верно);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    В - едва ли это так (скорее неверно);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    Г - нет, это не так (совершенно неверно).
                </Paragraph>
            </ListItem>
        </List>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующий ответ. 
            При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих»: люди различны и каждый имеет право на свою 
            собственную точку зрения.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>А - да, это так (совершенно верно)</q:Answer>
        <q:Answer>Б - пожалуй, это так (скорее верно)</q:Answer>
        <q:Answer>В - едва ли это так (скорее неверно)</q:Answer>
        <q:Answer>Г - нет, это не так (совершенно неверно)</q:Answer>
    </q:AnswersCollection>

    <k:Личностный_профиль x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Личностный профиль"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question
			Text="Вам нравится работа, требующая быстрых действий?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
			Text="Свойственно ли Вам беспокоиться из-за пустяков?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
			Text="Вы стремитесь ограничивать круг своего общения небольшим числом самых близких друзей?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
			Text="Вы обычно долго «раскачиваетесь», прежде чем начать какое-либо дело?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
			Text="Вы легко смущаетесь, оказываясь в незнакомом обществе?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
			Text="Вы часто чувствуете себя одиноким, даже находясь среди людей?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
			Text="Вы часто действуете под влиянием момента (например, только что пришедшей в голову мысли)?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
			Text="Вы откладываете иногда на завтра то, что должны сделать сегодня?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
			Text="Когда шансов на успех очень мало, Вы, тем не менее, обычно думаете, что стоит рискнуть?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
			Text="Вы обычно спокойны, и Вас нелегко расстроить?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
			Text="Просыпаясь утром, Вы обычно бодры и готовы к предстоящему дню?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
			Text="Вам трудно делать что-либо таким образом, чтобы завоевать внимание и одобрение окружающих?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
			Text="Вам нравится веселить и развлекать людей?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
			Text="Вы - человек не слишком аккуратный и обычно не беспокоитесь о том, чтобы каждая вещь лежала на своём месте?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
			Text="Вы когда-нибудь говорили что-либо плохое или неприятное о другом человеке?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
			Text="У Вас часто возникает ощущение, что Вы не получаете от жизни должного?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
			Text="Вам нравится одеваться необычно?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
			Text="Вам быстрее, чем большинству, надоедает выполнять одну и ту же работу?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
			Text="Вы предпочитаете действовать и говорить, не тратя времени на обдумывание?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
			Text="Вы испытываете максимум удовольствия, если принимаете участие в работе, требующей быстрых действий?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
			Text="Вы долго переживаете нанесённые Вам обиды и оскорбления?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
			Text="Если бы Вы нашли что-нибудь ценное на улице, Вы попытались бы найти хозяина?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
			Text="Нравится ли Вам быть большую часть времени одному?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
			Text="Вы часто оставляете дела на последнюю минуту?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
			Text="Вы чувствуете себя иногда неловко, если люди приближаются к Вам слишком близко?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
			Text="Вас бы больше устроила такая работа, на которой Вы могли бы самостоятельно решать, как её выполнять?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
			Text="Вы иногда чувствуете себя несчастным без особой на то причины?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
			Text="В автомобиле Вы предпочитаете быструю езду?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
			Text="Вам приходилось когда-нибудь ломать или терять чужую вещь?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
			Text="Вам нравится общаться с большим количеством людей?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question
			Text="Вы часто попадаете впросак из-за того, что действуете необдуманно?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question
			Text="Вы бы предпочли исполнять распоряжения, а не отдавать их?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question
			Text="Вы чувствуете себя непринуждённо и уверенно среди других людей?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question
			Text="Чувствуете ли Вы себя обделённым, когда оглядываетесь на то, что случилось с Вами в прошлом?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question
			Text="Вы всегда активны и заняты каким-либо делом целый день до самого сна?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question
			Text="Вы часто настаиваете на том, чтобы сделать что-то по-своему?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question
			Text="Вы иногда говорите о том, в чём совсем не разбираетесь?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question
			Text="Часто ли Вы забываете о незначительных делах, которые должны сделать?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question
			Text="Вы более сдержанны и замкнуты, чем большинство людей?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question
			Text="Принимая важное решение, Вы всегда действуете самостоятельно?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question
			Text="Большую часть времени Вы ощущаете внутреннее спокойствие и удовлетворённость?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question
			Text="Вы часто напрасно беспокоитесь по поводу того, что на самом деле не имеет значения?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question
			Text="Вы когда-нибудь мошенничали во время игры?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question
			Text="Вы ведёте себя робко и застенчиво, оказавшись в общественном месте?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question
			Text="Свойственно ли Вам почти всё делать в быстром темпе?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question
			Text="Вам бы очень понравилась жизнь, полная разнообразия и перемен?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question
			Text="Бывает ли иногда так, что Вы пьёте до тех пор, пока не станете совсем пьяным?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question
			Text="Часто ли Вы испытываете печаль и уныние?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question
			Text="Вы довольно разговорчивы, когда находитесь в компании?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question
			Text="Вы всегда отстаиваете свои права?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question
			Text="Вы часто испытываете стыд по поводу того, что сделали?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question
			Text="Вам случалось когда-нибудь пожадничать, забирая себе больше, чем полагалось?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question
			Text="Вы обычно полны сил и энергии?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question
			Text="Вы обычно всё тщательно обдумываете, прежде чем что-то сделать?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question
			Text="Вы волнуетесь без достаточных оснований по поводу того, что может случиться?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question
			Text="Вы считаете, что жить в эпоху перемен гораздо интереснее, чем в условиях стабильности?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question
			Text="Часто ли Вы просыпаетесь в подавленном настроении?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question
			Text="Вы, как правило, можете добиться от окружающих Вас людей того, чего хотите?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question
			Text="Вам нравится быть в центре внимания в обществе?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question
			Text="Склонны ли Вы иногда пускать всё на самотёк?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question
			Text="Вы часто беспокоитесь, что можете не понравиться людям, и поэтому ведёте себя с ними сдержанно?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question
			Text="Обычно именно Вы принимаете решение, когда Вам случается действовать совместно с другими людьми вне работы?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question
			Text="Вам нравится слушать новую и необычную музыку?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question
			Text="Вы иногда приходите в состояние беспокойства и напряжения, обдумывая свои проблемы?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question
			Text="Вам случалось брать вещи, принадлежащие другому лицу, хотя бы даже такие мелочи, как булавка или пуговица?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question
			Text="Причиной Ваших неприятностей и неудач очень часто были другие люди?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question
			Text="В целом Вам обычно удавалось достичь поставленных целей?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question
			Text="Свойственно ли Вам жить одним днём (не вороша прошлое и не особенно задумываясь о будущем)?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question
			Text="У Вас часто бывает такое чувство, будто Вы никому не нужны?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question
			Text="Даже в присутствии начальников и старших Вы уверенно выражаете своё мнение?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question
			Text="Вы краснеете чаще, чем большинство людей?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 72-->
        <q:Question
			Text="Любите ли Вы бывать в обществе?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 73-->
        <q:Question
			Text="Вам действительно нравится рисковать?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 74-->
        <q:Question
			Text="Вы легко расстраиваетесь, если что-то происходит не так, как было запланировано?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 75-->
        <q:Question
			Text="Вы попытались бы избежать уплаты налога с дополнительного заработка, если бы были уверены, что Вас никогда не смогут в этом уличить?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 76-->
        <q:Question
			Text="Вас считают человеком, полным жизненных сил?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 77-->
        <q:Question
			Text="Вы настолько заражаетесь новыми захватывающими идеями, что никогда не задумываетесь о возможных «подводных камнях»?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 78-->
        <q:Question
			Text="Вы предпочитаете оставаться на вторых ролях, вместо того чтобы стараться выдвинуться вперёд?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 79-->
        <q:Question
			Text="Вам кажется, что Вам не везёт больше, чем другим?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 80-->
        <q:Question
			Text="Можно ли на Вас всегда и во всём положиться?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 81-->
        <q:Question
			Text="Часто ли у Вас возникает беспокойное чувство, как будто Вы хотите чего-то, но в действительности не знаете, чего именно?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 82-->
        <q:Question
			Text="Вы когда-нибудь обвиняли кого-нибудь в том, в чём на самом деле были виноваты сами?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 83-->
        <q:Question
			Text="Приняв решение, Вы обычно действуете самостоятельно, не ожидая помощи от других и не надеясь на судьбу?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 84-->
        <q:Question
			Text="Вам неловко заходить в комнату, где находятся незнакомые люди?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 85-->
        <q:Question
			Text="Трудно ли Вам сидеть спокойно, не дёргаясь и не ёрзая на стуле?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 86-->
        <q:Question
			Text="Жизнь без какой-либо опасности показалась бы Вам слишком скучной?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 87-->
        <q:Question
			Text="Вы обычно первым проявляете инициативу при знакомстве?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 88-->
        <q:Question
			Text="Вам нравится быть всё время чем-то занятым?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 89-->
        <q:Question
			Text="Вы когда-нибудь пользовались оплошностью человека в своих целях?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 90-->
        <q:Question
			Text="Часто ли Вам всё кажется безнадёжным?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 91-->
        <q:Question
			Text="Вы часто делаете покупки под влиянием сиюминутного настроения?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 92-->
        <q:Question
			Text="Часто ли Вы испытываете смущение, глядя на собственные фотографии, и сетуете, что на них Вы не похожи на себя?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 93-->
        <q:Question
			Text="Вам нравятся люди, которые постоянно устраивают какие-то розыгрыши?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 94-->
        <q:Question
			Text="Вы когда-нибудь ощущали потребность в успокоительных лекарствах?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 95-->
        <q:Question
			Text="В любой ситуации Вы всегда уверены в себе?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 96-->
        <q:Question
			Text="Вы иногда притворялись больным, чтобы избежать выполнения неприятных обязательств?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 97-->
        <q:Question
			Text="Если бы Вам представилась возможность, согласились бы Вы прыгнуть с парашютом?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 98-->
        <q:Question
			Text="Вы часто чувствуете, что мало влияете на происходящие с Вами события?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 99-->
        <q:Question
			Text="Вы часто ощущаете, что переполнены энергией, льющейся через край?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 100-->
        <q:Question
			Text="Вы обдумываете все «за» и «против», прежде чем принять решение? "
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>

</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\МДУ_Элерс.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Опросник содержит ряд утверждений, которые Вам необходимо соотнести с собственными 
            взглядами и поведением. Вам предлагается сделать выбор из двух вариантов ответа: ДА, НЕТ.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на 
            соответствующий ответ. При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих». Если Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:МДУ_Элерс x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Диагностика мотивации к достижению успеха (Т. Элерс)"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question
			Text="Если между двумя вариантами есть выбор, его лучше сделать быстрее, чем откладывать на потом"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
			Text="Если замечаю, что не могу на все 100% выполнить задание, я легко раздражаюсь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
			Text="Когда я работаю, это выглядит так, будто я ставлю на карту всё"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
			Text="Если возникает проблемная ситуация, чаще всего я принимаю решение одним из последних"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
			Text="Если два дня подряд у меня нет дела, я теряю покой"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
			Text="В некоторые дни мои успехи ниже средних"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
			Text="Я более требователен к себе, чем к другим"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
			Text="Я доброжелательнее других"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
			Text="Если я отказываюсь от сложного задания, впоследствии сурово осуждаю себя, так как знаю, что в нём я добился бы успеха"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
			Text="В процессе работы я нуждаюсь в небольших паузах для отдыха"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
			Text="Усердие — это не основная моя черта"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
			Text="Мои достижения в работе не всегда одинаковы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
			Text="Другая работа привлекает меня больше той, которой я занят"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
			Text="Порицание стимулирует меня сильнее похвалы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
			Text="Знаю, что коллеги считают меня деловым человеком"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
			Text="Преодоление препятствий способствует тому, что мои решения становятся более категоричными"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
			Text="На моем честолюбии легко сыграть"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
			Text="Если я работаю без вдохновения, это обычно заметно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
			Text="Выполняя работу, я не рассчитываю на помощь других"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
			Text="Иногда я откладываю на завтра то, что должен сделать сегодня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
			Text="Нужно полагаться только на самого себя"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
			Text="В жизни немного вещей важнее денег"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
			Text="Если мне предстоит выполнить важное задание, я никогда не думаю ни о чем другом"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
			Text="Я менее честолюбив, чем многие другие"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
			Text="В конце отпуска я обычно радуюсь, что скоро выйду на работу"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
			Text="Если я расположен к работе, делаю её лучше и квалифицированнее, чем другие"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
			Text="Мне проще и легче общаться с людьми, способными упорно работать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
			Text="Когда у меня нет работы, мне не по себе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
			Text="Ответственную работу мне приходится выполнять чаще других"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
			Text="Если мне приходится принимать решение, стараюсь делать это как можно лучше"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question
			Text="Иногда друзья считают меня ленивым"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question
			Text="Мои успехи в какой-то мере зависят от коллег"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question
			Text="Противодействовать воле руководителя бессмысленно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question
			Text="Иногда не знаешь, какую работу придется выполнять"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question
			Text="Если у меня что-то не ладится, я становлюсь нетерпеливым"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question
			Text="Обычно я обращаю мало внимания на свои достижения"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question
			Text="Если я работаю вместе с другими, моя работа более результативна, чем у других"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question
			Text="Не довожу до конца многое, за что берусь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question
			Text="Завидую людям, не загруженным работой"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question
			Text="Не завидую тем, кто стремится к власти и положению"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question
			Text="Если я уверен, что стою на правильном пути, для доказательства своей правоты пойду на крайние меры"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>

</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Мотивация_к_избеганию_неудач_Элерс.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Вам будут показаны одновременно по 3 слова, характеризующих личностные качества.
            Выберите только одно из трех слов, которое наиболее точно Вас характеризует.
            Выбор производится нажатием на соответствующее слово с помощью «мыши».
            После сделанного выбора Вам будут показаны очередные 3 слова.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Продолжайте прохождение теста до его завершения.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Будьте искренними. Важно знать свои сильные и слабые стороны».
        </Paragraph>
    </FlowDocument>

    <k:Мотивация_к_избеганию_неудач_Элерс x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Метод диагностики к избеганию неудач Элерс"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>смелый</q:Answer>
                <q:Answer>бдительный</q:Answer>
                <q:Answer>предприимчивый</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 2-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>кроткий</q:Answer>
                <q:Answer>робкий</q:Answer>
                <q:Answer>упрямый</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 3-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>осторожный</q:Answer>
                <q:Answer>решительный</q:Answer>
                <q:Answer>пессимистичный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 4-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>непостоянный</q:Answer>
                <q:Answer>бесцеремонный</q:Answer>
                <q:Answer>внимательный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 5-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>неумный</q:Answer>
                <q:Answer>трусливый</q:Answer>
                <q:Answer>недумающий</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 6-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>ловкий</q:Answer>
                <q:Answer>бойкий</q:Answer>
                <q:Answer>предусмотрительный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 7-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>хладнокровный</q:Answer>
                <q:Answer>колеблющийся</q:Answer>
                <q:Answer>удалой</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 8-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>стремительный</q:Answer>
                <q:Answer>легкомысленный</q:Answer>
                <q:Answer>боязливый</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 9-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>незадумывающийся</q:Answer>
                <q:Answer>жеманный</q:Answer>
                <q:Answer>непредусмотрительный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 10-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>оптимистичный</q:Answer>
                <q:Answer>добросовестный</q:Answer>
                <q:Answer>чуткий</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 11-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>меланхоличный</q:Answer>
                <q:Answer>сомневающийся</q:Answer>
                <q:Answer>неустойчивый</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 12-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>трусливый</q:Answer>
                <q:Answer>небрежный</q:Answer>
                <q:Answer>взволнованный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 13-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>опрометчивый</q:Answer>
                <q:Answer>тихий</q:Answer>
                <q:Answer>боязливый</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 14-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>внимательный</q:Answer>
                <q:Answer>неблагоразумный</q:Answer>
                <q:Answer>смелый</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 15-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>рассудительный</q:Answer>
                <q:Answer>быстрый</q:Answer>
                <q:Answer>мужественный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 16-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>предприимчивый</q:Answer>
                <q:Answer>осторожный</q:Answer>
                <q:Answer>предусмотрительный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 17-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>взволнованный</q:Answer>
                <q:Answer>рассеянный</q:Answer>
                <q:Answer>робкий</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 18-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>малодушный</q:Answer>
                <q:Answer>неосторожный</q:Answer>
                <q:Answer>бесцеремонный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 19-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>пугливый</q:Answer>
                <q:Answer>нерешительный</q:Answer>
                <q:Answer>нервный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 20-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>исполнительный</q:Answer>
                <q:Answer>преданный</q:Answer>
                <q:Answer>авантюрный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 21-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>предусмотрительный</q:Answer>
                <q:Answer>бойкий</q:Answer>
                <q:Answer>отчаянный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 22-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>укрощенный</q:Answer>
                <q:Answer>безразличный</q:Answer>
                <q:Answer>небрежный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 23-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>осторожный</q:Answer>
                <q:Answer>беззаботный</q:Answer>
                <q:Answer>терпеливый</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 24-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>разумный</q:Answer>
                <q:Answer>заботливый</q:Answer>
                <q:Answer>храбрый</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 25-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>предвидящий</q:Answer>
                <q:Answer>неустрашимый</q:Answer>
                <q:Answer>добросовестный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 26-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>поспешный</q:Answer>
                <q:Answer>пугливый</q:Answer>
                <q:Answer>беззаботный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 27-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>рассеянный</q:Answer>
                <q:Answer>опрометчивый</q:Answer>
                <q:Answer>пессимистичный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 28-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>осмотрительный</q:Answer>
                <q:Answer>рассудительный</q:Answer>
                <q:Answer>предприимчивый</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 29-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>тихий</q:Answer>
                <q:Answer>неорганизованный</q:Answer>
                <q:Answer>боязливый</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 30-->
        <q:Question Text="Выберите один из вариантов ответов">
            <q:AnswersCollection>
                <q:Answer>оптимистичный</q:Answer>
                <q:Answer>бдительный</q:Answer>
                <q:Answer>беззаботный</q:Answer>
            </q:AnswersCollection>
        </q:Question>

    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Опросник_САН.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Вам предлагается описать своё состояние, в котором Вы находитесь В НАСТОЯЩИЙ МОМЕНТ, с помощью 30 пар полярных признаков.
            Вы должны в каждой паре выбрать ту характеристику, которая СЕЙЧАС наиболее точно описывает Ваше состояние,
            и отметить цифру, которая соответствует степени (силе) выраженности данной характеристики.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения указателя на соответствующую цифру».
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>3</q:Answer>
        <q:Answer>2</q:Answer>
        <q:Answer>1</q:Answer>
        <q:Answer>0</q:Answer>
        <q:Answer>1</q:Answer>
        <q:Answer>2</q:Answer>
        <q:Answer>3</q:Answer>
    </q:AnswersCollection>

    <k:Опросник_САН x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Опросник САН"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question 
            Text="Самочувствие хорошее/Самочувствие плохое"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 2-->
        <q:Question 
            Text="Чувствую себя сильным/Чувствую себя слабым"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 3-->
        <q:Question 
            Text="Пассивный/Активный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 4-->
        <q:Question 
            Text="Малоподвижный/Подвижный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 5-->
        <q:Question 
            Text="Весёлый/Грустный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 6-->
        <q:Question 
            Text="Хорошее настроение/Плохое настроение"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 7-->
        <q:Question 
            Text="Работоспособный/Разбитый"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 8-->
        <q:Question 
            Text="Полный сил/Обессиленный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 9-->
        <q:Question 
            Text="Медлительный/Быстрый"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 10-->
        <q:Question 
            Text="Бездеятельный/Деятельный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 11-->
        <q:Question 
            Text="Счастливый/Несчастный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 12-->
        <q:Question 
            Text="Жизнерадостный/Мрачный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 13-->
        <q:Question 
            Text="Напряжённый/Расслабленный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 14-->
        <q:Question 
            Text="Здоровый/Больной"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 15-->
        <q:Question 
            Text="Безучастный/Увлечённый"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 16-->
        <q:Question 
            Text="Равнодушный/Взволнованный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 17-->
        <q:Question 
            Text="Восторженный/Унылый"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 18-->
        <q:Question 
            Text="Радостный/Печальный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 19-->
        <q:Question 
            Text="Отдохнувший/Усталый"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 20-->
        <q:Question 
            Text="Свежий/Изнурённый"
            Answers="{ StaticResource Answers}">
        </q:Question>
        
        <!--Вопрос 21-->
        <q:Question 
            Text="Сонливый/Возбуждённый"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 22-->
        <q:Question 
            Text="Желание отдохнуть/Желание работать"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 23-->
        <q:Question 
            Text="Спокойный/Озабоченный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 24-->
        <q:Question 
            Text="Оптимистичный/Пессимистичный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 25-->
        <q:Question 
            Text="Выносливый/Утомляемый"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 26-->
        <q:Question 
            Text="Бодрый/Вялый"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 27-->
        <q:Question 
            Text="Соображать трудно/Соображать легко"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 28-->
        <q:Question 
            Text="Рассеянный/Внимательный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 29-->
        <q:Question 
            Text="Полный надежд/Разочарованный"
            Answers="{ StaticResource Answers}">
        </q:Question>

        <!--Вопрос 30-->
        <q:Question 
            Text="Довольный/Недовольный"
            Answers="{ StaticResource Answers}">
        </q:Question>

    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Оценка_нервно_психической_устойчивости_НПУ.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам предлагается ряд утверждений, которые необходимо соотнести с собственными взглядами и поведением. 
            Предлагаемые утверждения касаются Вашего самочувствия, поведения или характера.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам предлагается на выбор 3 варианта ответа:
        </Paragraph>
        <List MarkerStyle="Circle" Margin="0">
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    Да,
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    Нет,
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    Не знаю
                </Paragraph>
            </ListItem>
        </List>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующий
            ответ. После сделанного выбора Вам будут показано очередное утверждение. При необходимости Вы можете 
            вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих»: люди различны и каждый имеет право на свою 
            собственную точку зрения.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
        <q:Answer>Не знаю</q:Answer>
    </q:AnswersCollection>

    <k:Оценка_нервно_психической_устойчивости_НПУ x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Оценка нервно-психической устойчивости"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question
			Text="Иногда мне в голову приходят такие нехорошие мысли, что лучше о них никому не рассказывать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
			Text="Запоры у меня бывают редко (или не бывают совсем)"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
			Text="Временами у меня бывают приступы смеха или плача, с которыми я никак не могу справиться"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
			Text="Бывают случаи, что я не сдерживаю своих обещаний"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
			Text="У меня часто болит голова"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
			Text="Иногда я говорю неправду"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
			Text="Раз в неделю или чаще я безо всякой видимой причины ощущаю жар во всем теле"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
			Text="Бывало, что я говорил о вещах, в которых не разбираюсь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
			Text="Бывает, что я сержусь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
			Text="Теперь мне трудно надеяться на то, что я чего-нибудь добьюсь в жизни"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
			Text="Бывает, что я откладываю на завтра то, что нужно сделать сегодня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
			Text="Я охотно принимаю участие в собраниях и других общественных мероприятиях"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
			Text="Самая трудная борьба для меня – борьба с самим собой"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
			Text="Мышечные судорога и подергивания у меня бывают редко (или не бывают совсем)"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
			Text="Иногда, когда я неважно себя чувствую, я бываю раздражительным"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
			Text="Я довольно безразличен к тому, что со мной будет"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
			Text="В гостях я держусь за столом лучше, чем дома"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
			Text="Если мне не грозит штраф и машин поблизости нет, я могу перейти улицу там, где мне хочется, а не там, где положено"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
			Text="Я считаю, что моя семейная жизнь такая же хорошая, как у большинства моих знакомых"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
			Text="Мне часто говорят, что я вспыльчив"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
			Text="В детстве у меня была такая компания, где все старались всегда и во всем стоять друг за друга"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
			Text="В игре я предпочитаю выигрывать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
			Text="Последние несколько лет большую часть времени я чувствую себя хорошо"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
			Text="Сейчас мой вес постоянен (я не полнею и не худею)"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
			Text="Мне приятно иметь среди своих знакомых значительных друзей, это как бы придает мне вес в собственных глазах"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
			Text="Я был бы довольно спокоен, если бы у кого-нибудь из моей семьи были неприятности"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
			Text="С моим рассудком творится что-то неладное"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
			Text="Меня беспокоят сексуальные (половые) вопросы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
			Text="Когда я пытаюсь что-то сказать, то часто замечаю, что у меня дрожат руки"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
			Text="Руки у меня такие же ловкие и проворные, как прежде"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question
			Text="Среди моих знакомых есть люди, которые мне не нравятся"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question
			Text="Думаю, что я человек обреченный"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question
			Text="Я ссорюсь с членами моей семьи очень редко"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question
			Text="Бывает, что я с кем-нибудь немного посплетничаю"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question
			Text="Часто я вижу сны, о которых лучше никому не рассказывать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question
			Text="Бывает, что при обсуждении некоторых вопросов я особенно не задумываюсь, соглашаюсь с мнением других"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question
			Text="В школе я усваивал материал медленнее, чем другие"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question
			Text="Моя внешность меня в общем устраивает"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question
			Text="Я вполне уверен в себе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question
			Text="Раз в неделю или чаще я бываю очень возбужденным или взволнованным"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question
			Text="Кто-то управляет моими мыслями"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question
			Text="Я ежедневно выпиваю необычно много воды"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question
			Text="Бывает, что неприличная или даже непристойная шутка вызывает у меня смех"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question
			Text="Счастливее всего я бываю, когда я один"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question
			Text="Кто-то пытается воздействовать на мои мысли"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question
			Text="Я люблю сказки Андерсена"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question
			Text="Даже среди людей я обычно чувствую себя одиноким"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question
			Text="Меня злит, когда меня торопят"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question
			Text="Меня легко привести в замешательство"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question
			Text="Я легко теряю терпение с людьми"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question
			Text="Часто мне хочется умереть"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question
			Text="Бывало, что я бросал начатое дело, так как боялся, что не справлюсь с ним"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question
			Text="Почти каждый день случается что-нибудь, что пугает меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question
			Text="К вопросам религии я отношусь равнодушно, она меня не занимает"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question
			Text="Приступы плохого настроения бывают у меня редко"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question
			Text="Я заслуживаю сурового наказания за свои поступки"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question
			Text="У меня были очень необычные мистические переживания"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question
			Text="Мои убеждения и взгляды непоколебимы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question
			Text="У меня бывают периоды, когда из-за волнения я теряю сон"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question
			Text="Я человек нервный и легковозбудимый"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question
			Text="Мне кажется, что обоняние у меня такое же, как и у других (не хуже)"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question
			Text="Все у меня получается плохо, не так, как надо"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question
			Text="Я почти всегда ощущаю сухость во рту"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question
			Text="Большую часть времени я чувствую себя усталым"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question
			Text="Иногда я чувствую, что близок к нервному срыву"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question
			Text="Меня очень раздражает, что я забываю, куда кладу вещи"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question
			Text="Я очень внимательно отношусь к тому, как я одеваюсь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question
			Text="Приключенческие рассказы мне нравятся больше, чем рассказы о любви"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question
			Text="Мне очень трудно приспособиться к новым условиям жизни, работы, переход к любым новым условиям жизни, работы, учебы кажется невыносимо трудным"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question
			Text="Мне кажется, что по отношению именно ко мне особенно часто поступают несправедливо"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question
			Text="Я часто чувствую себя несправедливо обиженным"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 72-->
        <q:Question
			Text="Мое мнение часто не совпадает с мнением окружающих"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 73-->
        <q:Question
			Text="Я часто испытываю чувство усталости от жизни, и мне не хочется жить"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 74-->
        <q:Question
			Text="На меня обращают внимание чаще, чем на других"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 75-->
        <q:Question
			Text="У меня бывают головные боли и головокружения из-за переживаний"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 76-->
        <q:Question
			Text="Часто у меня бывают периоды, когда мне никого не хочется видеть"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 77-->
        <q:Question
			Text="Мне трудно проснуться в назначенный час"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 78-->
        <q:Question
			Text="Если в моих неудачах кто-то виноват, я не оставлю его безнаказанным"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 79-->
        <q:Question
			Text="В детстве я был капризным и раздражительным"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 80-->
        <q:Question
			Text="Мне известны случаи, когда мои родственники лечились у невропатологов, психиатров"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 81-->
        <q:Question
			Text="Иногда я принимаю валериану, элениум и другие успокаивающие средства"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 82-->
        <q:Question
			Text="Среди моих близких родственников есть лица, привлекавшиеся к уголовной ответственности"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 83-->
        <q:Question
			Text="У меня были приводы в милицию"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 84-->
        <q:Question
			Text="В школе я учился плохо, бывали случаи, когда меня хотели оставить (оставляли) на второй год"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>
    
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Потребность_в_достижении.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Вам будет предложено оценить 23 утверждения, касающихся различных сторон жизни.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор, ответ «ДА» или «НЕТ», производите нажатием на левую кнопку «мыши» после наведения указателя на соответствующую слово.
            При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
            Имейте в виду, что утверждения коротки и не могут содержать все необходимые подробности.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Отвечайте быстро.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            "Плохих" или "хороших" ответов не существует; важно только,
            чтобы ответ выражал Ваше личное мнение - только в этом случае результаты тестирования могут оказаться полезными для Вас.»
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answer_Gender" x:Shared="False">
        <q:Answer>Мужской</q:Answer>
        <q:Answer>Женский</q:Answer>
    </q:AnswersCollection>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:Потребность_в_достижении x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Потребность в достижении"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        
        <!--Вопрос 1-->
        <q:Question Text="Ваш пол."
Answers="{ StaticResource Answer_Gender}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question Text=" Думаю, что успех в жизни зависит скорее от случая, чем от расчёта."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text=" Если я лишусь любимого занятия, жизнь для меня потеряет смысл."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text=" Для меня в любом деле важнее процесс, а не конечный результат."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text=" Считаю, что люди больше страдают от неудач на работе, чем от плохих взаимоотношений с близкими."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text=" По моему мнению, большинство людей живёт далекими целями, а не ближними."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text=" В жизни у меня было больше успехов, чем неудач."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text=" Эмоциональные люди мне нравятся больше, чем деятельные."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text=" Даже в обычной работе я стараюсь усовершенствовать некоторые её элементы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text=" Поглощенный мыслями об успехе, я могу забыть о мерах предосторожности."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text=" Мои близкие считают меня ленивым человеком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text=" Думаю, что в моих неудачах повинны скорее обстоятельства, чем я сам."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text=" Мои родители слишком строго контролировали меня."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text=" Терпения во мне больше, чем способностей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text=" Лень, а не сомнение в успехе вынуждают меня часто отказываться от своих намерений."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text=" Думаю, что я уверенный в себе человек."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text=" Ради успеха я могу рискнуть, даже если шансы не в мою пользу."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text=" Я не усердный человек."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text=" Когда всё идёт гладко, моя энергия усиливается."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text=" Если бы я был журналистом, я бы писал скорее об оригинальных изобретениях, чем о происшествиях."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question Text=" Мои близкие обычно не разделяют моих планов."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question Text=" Уровень моих требований к жизни ниже, чем у моих ровесников."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question Text=" Мне кажется, что настойчивости во мне больше, чем способностей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question Text=" Я мог бы достичь большего, освободившись от текущих дел."
Answers="{ StaticResource Answers}">
        </q:Question>


    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Склонность_к_зависимому_поведению.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Перед Вами ряд утверждений. Укажите, в какой степени Вы согласны или не согласны с ними.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам предлагается на выбор 5 вариантов ответа:
        </Paragraph>
        <List MarkerStyle="Circle" Margin="0">
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    совершенно не согласен (совсем не так);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    скорее не согласен (скорее не так);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    ни то, ни другое (и так, и так);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    скорее согласен (скорее так);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    совершенно согласен (именно так).
                </Paragraph>
            </ListItem>
        </List>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующий 
            ответ. При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих»: важно объективно оценивать свои индивидуальные особенности.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>совершенно не согласен (совсем не так)</q:Answer>
        <q:Answer>скорее не согласен (скорее не так)</q:Answer>
        <q:Answer>ни то, ни другое (и так, и так)</q:Answer>
        <q:Answer>скорее согласен (скорее так)</q:Answer>
        <q:Answer>совершенно согласен (именно так)</q:Answer>
    </q:AnswersCollection>

    <k:Склонность_к_зависимому_поведению x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Склонность к зависимому поведению"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question
			Text="Я склонен разочаровываться в людях"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
			Text="Верить в приметы глупо"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
			Text="Часто бывает, что я обижаюсь на родителей или друзей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
			Text="Нередко я опаздываю на учёбу (работу) или на встречу из-за непредвиденных случайностей в пути"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
			Text="Окружающие часто удивляют меня своим поведением"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
			Text="Мои родители часто пытаются обращаться со мной как с маленьким ребенком"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
			Text="Я люблю планировать своё время до мелочей и с точностью до минут"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
			Text="Мне кажется, что я чувствую происходящее вокруг более остро, чем другие"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
			Text="Родители сами виноваты в том, что их дети начинают принимать наркотики («колоться»)"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
			Text="Для меня не существует абсолютных авторитетов"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
			Text="В детстве был период, когда я страстно любил что-либо подсчитывать (количество окон, ступеней, номера машин) "
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
			Text="Если бы родители или другие взрослые больше бы говорили с детьми о вреде наркотиков, то мало кто становился бы наркоманом"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
			Text="Мне легче перенести скандал, чем однообразную размеренную жизнь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
			Text="Я верю в порчу и сглаз"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
			Text="Прежде, чем что-либо предпринять, я стараюсь предусмотреть все опасности, которые могут подстерегать меня"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
			Text="Если я чем-то увлечённо занят, то часто даже не замечаю, что происходит вокруг "
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
			Text="Я живу и поступаю в соответствии с поговоркой: «надейся на лучшее, но готовься к худшему»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
			Text="Меня нелегко убедить в чём бы то ни было"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
			Text="Меня нередко обманывали (обманывают)"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
			Text="Неизвестность для меня очень мучительна и тягостна"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
			Text="Меня раздражает, когда на улице, в магазине или в транспорте на меня пристально смотрят"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
			Text="Жизнь малоинтересна, когда в ней нет опасностей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
			Text="Я не уважаю тех, кто отрывается от коллектива"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
			Text="Некоторые люди одним прикосновением могут исцелить больного человека"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
			Text="Жизнь должна быть радостной, иначе незачем жить"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
			Text="Я хорошо ориентируюсь во времени и, не глядя на часы, могу точно сказать «который сейчас час»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
			Text="Если я захочу что-нибудь сделать, но окружающие считают, что этого делать не стоит, то я готов отказаться от своих намерений"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
			Text="В детстве я часто отказывался оставаться один "
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
			Text="Мне нередко бывает скучно, когда нечем себя занять"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
			Text="В жизни надо попробовать всё"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question
			Text="Я легко могу заснуть в любое удобное время (и ночью, и днём)"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question
			Text="После того, как я схожу в лес за грибами, у меня долго перед глазами могут сохраняться воспоминания о грибах"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question
			Text="Я люблю помечтать о том, на что я потрачу возможный будущий выигрыш в лотерее, как поступлю с обещанным подарком"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question
			Text="Часто думаю: «Хорошо бы стать ребёнком»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question
			Text="Мне часто трудно находить правильные слова для моих чувств"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question
			Text="Для меня не сложно дать знакомому денег взаймы на покупку спиртного"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question
			Text="Я склонен жить, стараясь не отягощать себя раздумьями о том, что может произойти со мной в будущем"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question
			Text="Я люблю, когда мне гадают на картах или по руке"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question
			Text="Мне хорошо удается копировать мимику и жесты других людей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question
			Text="Когда меня будят ночью или рано утром, то я долго не могу понять, что происходит вокруг"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question
			Text="Музыку я люблю громкую, а не тихую"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question
			Text="У меня бывают чувства, которым я не могу дать вполне точное определение"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question
			Text="Человек должен стараться понимать свои сны, руководствоваться ими в жизни и извлекать из них предостережения"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question
			Text="Меня трудно застать врасплох"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question
			Text="Все известные мне «чудеса» объясняются очень просто – обман и фокусы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question
			Text="Меня считают наивным человеком, поскольку мне часто случается попадать впросак"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question
			Text="Наркотики бывают «лёгкими» и они не вызывают наркомании"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question
			Text="Я иногда чувствовал, что кто-то посредством гипноза заставлял меня совершать какие-либо поступки"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question
			Text="Мои знакомые считают меня романтиком"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question
			Text="Я верю в чудеса"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question
			Text="Даже психически здоровый человек иногда не может отвечать за свои поступки"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question
			Text="Меня часто озадачивают поведение и поступки людей, которых я давно знаю"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question
			Text="Никому нельзя доверять – это правильная позиция"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question
			Text="Самое счастливое время жизни – это молодость"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question
			Text="В детстве я боялся, что мама может бросить меня, уйти из дома и не вернуться"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question
			Text="Я склонен лучше помнить реально происшедшие со мной неприятные события, чем собственные прогнозы по поводу возможности их появления"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question
			Text="Я люблю советоваться с друзьями (или взрослыми), как поступить в сложной ситуации"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question
			Text="Я бы согласился пожить пусть мало, но бурно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question
			Text="Я бы мог на спор ввести себе в вену наркотик (героин)"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question
			Text="Часто меня не оценивали по заслугам"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question
			Text="Я всегда точно могу сказать, сколько денег я потратил и сколько у меня осталось"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question
			Text="В детстве я долго не мог привыкнуть к детскому саду (яслям) и не хотел туда из-за этого ходить"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question
			Text="Своим друзьям или подругам я доверяю полностью и убеждён, что они меня не обманут и не предадут"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question
			Text="Опасность употребления наркотиков явно преувеличена"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question
			Text="В жизни всё-таки мало ярких событий"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question
			Text="Я не люблю долгие поездки в поезде или на автобусе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question
			Text="Меня раздражает грязное стекло, потому что весь мир тогда кажется грязным и серым"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question
			Text="Когда мне скучно, я обычно ложусь поспать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question
			Text="Часто родители (или взрослые) упрекают меня в том, что я слушаю излишне громкую музыку"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question
			Text="Очень мучительно чего-либо ждать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question
			Text="Я мог бы после некоторых предварительных объяснений управлять маленьким (спортивным) самолетом"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 72-->
        <q:Question
			Text="Я нередко просыпаюсь утром за несколько секунд или минут до звонка будильника"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 73-->
        <q:Question
			Text="Если бы случился пожар и мне надо было бы из окна пятого этажа прыгнуть на тент, развёрнутый пожарниками, я бы не задумываясь сделал это"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 74-->
        <q:Question
			Text="Мне жалко наивных людей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 75-->
        <q:Question
			Text="Меня смущает, когда люди долго и пристально смотрят мне в глаза"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 76-->
        <q:Question
			Text="Рисковать всем, например, в казино, могут только сильные люди"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 77-->
        <q:Question
			Text="В том, что подросток становится наркоманом, виноваты те, кто продаёт наркотики"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 78-->
        <q:Question
			Text="Я люблю очень быструю, а не медленную езду"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 79-->
        <q:Question
			Text="Я доверяю предсказаниям гороскопов и следую содержащимся в них рекомендациям"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 80-->
        <q:Question
			Text="Меня очень интересуют лотереи"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 81-->
        <q:Question
			Text="Прогнозировать будущее - бесполезное дело, т.к. многое от тебя не зависит"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 82-->
        <q:Question
			Text="Я способен с лёгкостью описывать свои чувства"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 83-->
        <q:Question
			Text="У меня в жизни бывали случаи, когда я что-то делал, а потом не помнил, что именно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 84-->
        <q:Question
			Text="Считаю, что любопытство – не порок"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 85-->
        <q:Question
			Text="Бывает, что меня пугают люди с громким голосом"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 86-->
        <q:Question
			Text="У меня было (есть) много интересов, хобби"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 87-->
        <q:Question
			Text="Когда я остаюсь дома, то мне часто бывает не по себе от одиночества"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 88-->
        <q:Question
			Text="Я не суеверен"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 89-->
        <q:Question
			Text="Мне говорили, что у меня неплохие способности имитировать голоса или повадки людей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 90-->
        <q:Question
			Text="Есть люди, которым я верю безоговорочно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 91-->
        <q:Question
			Text="Случается, что во время разговора с заикающимся я сам начинаю говорить сбивчиво и с запинками"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 92-->
        <q:Question
			Text="Самое тягостное в жизни – это одиночество"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 93-->
        <q:Question
			Text="Если я начинаю играть в какую-нибудь игру, то меня нередко нелегко оторвать от нее"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 94-->
        <q:Question
			Text="Бывает, что я могу сделать назло даже то, что мне самому окажется невыгодным"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 95-->
        <q:Question
			Text="Меня всегда притягивали и притягивают таинственность, загадочность, мистика"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 96-->
        <q:Question
			Text="Бывало, что я на улице соглашался на игру с «напёрсточниками»"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 97-->
        <q:Question
			Text="Я знаю многих, кто употребляет или употреблял наркотики"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 98-->
        <q:Question
			Text="Я, как правило, ставлю будильник так, чтобы не только все успеть сделать до ухода из дома, но и иметь несколько минут в запасе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 99-->
        <q:Question
			Text="В своей жизни я часто сталкиваюсь (сталкивался) с невообразимым стечением неблагоприятных обстоятельств"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 100-->
        <q:Question
			Text="Я готов полностью подчиниться и даже доверить свою судьбу, но только тому, кого действительно уважаю"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 101-->
        <q:Question
			Text="Я люблю рисковать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 102-->
        <q:Question
			Text="Среди моих знакомых есть люди, которые обладают даром убеждать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 103-->
        <q:Question
			Text="Меня часто невозможно оторвать от интересного дела, игры, занятия"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 104-->
        <q:Question
			Text="Я мог бы прыгнуть с парашютом "
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 105-->
        <q:Question
			Text="Мне все равно, что обо мне думают окружающие"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 106-->
        <q:Question
			Text="Меня многое в жизни удивляет"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 107-->
        <q:Question
			Text="Я могу переспорить кого угодно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 108-->
        <q:Question
			Text="Я вошел бы вы вместе с укротителем в клетку со львами, если бы он мне сказал, что это безопасно "
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 109-->
        <q:Question
			Text="Если меня о чём-то просят, мне трудно отказать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 110-->
        <q:Question
			Text="Мне легче придумать свои собственные примеры, чем выучить наизусть примеры из учебника"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 111-->
        <q:Question
			Text="Мне никогда не бывает скучно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 112-->
        <q:Question
			Text="Часто я сам от себя не ожидаю какого-либо поступка"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 113-->
        <q:Question
			Text="В детстве у меня какое-то время были тики или разнообразные повторяющиеся движения"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 114-->
        <q:Question
			Text="Я люблю помечтать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 115-->
        <q:Question
			Text="Меня влечёт всё новое и необычное"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 116-->
        <q:Question
			Text="Со мной нередко происходят «несчастные случаи» и случаются всяческие происшествия"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>

</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Склонность_к_риску_Шуберт.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Оцените степень своей готовности совершить действия, предложенные в опроснике. Отвечая на 
            каждый из 25 вопросов, поставьте соответствующий балл по следующей схеме:
        </Paragraph>
        <List MarkerStyle="Circle" Margin="0">
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    полностью согласен (полное «ДА»);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    больше «ДА», чем «НЕТ»;
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    ни «ДА», ни «НЕТ» (нечто среднее);
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    больше «НЕТ», чем «ДА»;
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    полностью не согласен (полное «НЕТ»).
                </Paragraph>
            </ListItem>
        </List>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на 
            соответствующий ответ. При необходимости Вы можете вернуться к предыдущему вопросу,
            нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих»: люди различны, и каждый имеет право 
            на свою собственную точку зрения.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>полностью согласен (полное «ДА»);</q:Answer>
        <q:Answer>больше «ДА», чем «НЕТ»</q:Answer>
        <q:Answer>ни «ДА», ни «НЕТ»</q:Answer>
        <q:Answer>больше «НЕТ», чем «ДА»</q:Answer>
        <q:Answer>полностью не согласен (полное «НЕТ»)</q:Answer>
    </q:AnswersCollection>

    <k:Склонность_к_риску_Шуберт x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Методика диагностики степени готовности (склонности) к риску (по Шуберту)"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question
			Text="Превысили бы Вы установленную скорость, чтобы быстрее оказать необходимую медицинскую помощь тяжелобольному человеку?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
			Text="Согласились бы Вы ради хорошего заработка участвовать в опасной и длительной экспедиции?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
			Text="Стали бы Вы на пути убегающего опасного взломщика?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
			Text="Могли бы ехать на подножке товарного вагона на скорости более 100 км/ч?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
			Text="Можете ли Вы на другой день после бессонной ночи нормально работать?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
			Text="Стали бы Вы первым переходить очень холодную реку?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
			Text="Одолжили бы Вы другу большую сумму денег, будучи не совсем уверенным, что он сможет Вам вернуть эти деньги?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
			Text="Вошли бы Вы вместе с укротителем в клетку со львами при его заверении, что это безопасно?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
			Text="Могли бы Вы под руководством извне залезть на высокую фабричную трубу?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
			Text="Могли бы Вы без тренировки управлять парусной лодкой?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
			Text="Рискнули бы Вы схватить за уздечку бегущую лошадь?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
			Text="Могли бы Вы после 10 стаканов пива ехать на велосипеде?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
			Text="Могли бы Вы совершить прыжок с парашютом?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
			Text="Могли бы Вы при необходимости проехать без билета от Таллина до Москвы?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
			Text="Могли бы Вы совершить автотурне, если бы за рулем сидел Ваш знакомый, который совсем недавно был в тяжёлом дорожном происшествии?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
			Text="Могли бы Вы с 10-метровой высоты прыгнуть на тент пожарной команды?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
			Text="Могли бы Вы, чтобы избавиться от затяжной болезни с постельным режимом, пойти на опасную для жизни операцию?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
			Text="Могли бы Вы спрыгнуть с подножки товарного вагона, движущегося со скоростью 50 км/час?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
			Text="Могли бы Вы в виде исключения вместе с семью другими людьми подняться в лифте, рассчитанном только на шесть человек?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
			Text="Могли бы Вы за большое денежное вознаграждение перейти с завязанными глазами оживленный уличный перекресток?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
			Text="Взялись бы Вы за опасную для жизни работу, если бы за неё хорошо платили?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
			Text="Могли бы Вы после 10 рюмок водки вычислять проценты?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
			Text="Могли бы Вы по указанию Вашего начальника взяться за высоковольтный провод, если бы он заверил Вас, что провод обесточен?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
			Text="Могли бы Вы после некоторых предварительных объяснений управлять вертолётом?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
			Text="Могли бы Вы, имея билеты, но без денег и продуктов, доехать из Москвы до Хабаровска?"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>

</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\СМОЛ.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам предлагается пройти тест, состоящий из 71 утверждения, которые касаются состояния вашего 
            здоровья и вашего характера. Внимательно прочитайте каждое утверждение и решите: верно оно или 
            неверно по отношению к Вам.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующий 
            ответ (ВЕРНО или НЕВЕРНО). Не тратьте времени на раздумывание. Наиболее естественно то решение, 
            которое первым приходит в голову.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад»
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту».
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Верно</q:Answer>
        <q:Answer>Неверно</q:Answer>
    </q:AnswersCollection>

    <k:СМОЛ x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Сокращённый многопрофильный опросник личности"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question
            Text="У вас хороший аппетит?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
			Text="По утрам вы обычно чувствуете, что выспались и отдохнули"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
			Text="В вашей повседневной жизни масса интересного"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
			Text="Вы работаете с большим напряжением"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
			Text="Временами вам приходят в голову такие нехорошие мысли, что о них лучше не рассказывать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
			Text="У вас очень редко бывает запор"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
			Text="Иногда вам очень хотелось навсегда уйти из дома"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
			Text="Временами у вас бывают приступы неудержимого смеха или плача"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
			Text="Временами вас беспокоит тошнота и позывы на рвоту"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
			Text="У вас такое впечатление, что вас никто не понимает"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
			Text="Иногда вам хочется выругаться"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
			Text="Каждую неделю вам снятся кошмары"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
			Text="Вам труднее сосредоточиться, чем большинству людей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
			Text="С вами происходили (или происходят) странные вещи"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
			Text="Вы достигли бы в жизни гораздо большего, если бы люди не были настроены против вас"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
			Text="В детстве вы одно время совершали кражи"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
			Text="Бывало, что по несколько дней, недель или целых месяцев вы ничем не могли заняться, потому что трудно было заставить себя включиться в работу"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
			Text="У вас прерывистый и беспокойный сон"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
			Text="Когда вы находитесь среди людей, вам слышатся странные вещи"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
			Text="Большинство знающих вас людей не считают вас неприятным человеком"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
			Text="Вам часто приходилось подчиняться кому-нибудь, кто знал меньше вас"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
			Text="Большинство людей довольны своей жизнью более чем вы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
			Text="Очень многие преувеличивают свои несчастья, чтобы добиться сочувствия и помощи"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
			Text="Иногда вы сердитесь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
			Text="Вам определённо не хватает уверенности в себе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
			Text="У вас часто бывает чувство, как будто вы сделали что-то неправильное или нехорошее"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
			Text="У вас может ухудшиться самочувствие и здоровье, если люди критикуют вас, требуют от вас слишком многого"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
			Text="Обычно вы удовлетворены своей судьбой"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
			Text="Некоторые так любят командовать, что вам хочется всё сделать наперекор, хотя вы знаете, что они правы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
			Text="Вы считаете, что против вас что-то замышляют"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question
            Text="Большинство людей способно добиваться выгоды не совсем честным путем"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question
			Text="Вас часто беспокоит желудок"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question
			Text="Часто вы не можете понять, почему накануне вы были в плохом настроении и раздражены"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question
			Text="Временами ваши мысли текли так быстро, что вы не успевали их высказывать"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question
			Text="Вы считаете, что ваша семейная жизнь не хуже, чем у большинства ваших знакомых"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question
			Text="Временами вы уверены в собственной бесполезности"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question
			Text="В последние годы ваше самочувствие было в основном хорошим"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question
			Text="У вас бывали периоды, во время которых вы что-то делали и потом не могли вспомнить, что именно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question
			Text="Вы считаете, что вас часто незаслуженно наказывали"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question
			Text="Вы никогда не чувствовали себя лучше, чем теперь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question
			Text="Вам безразлично, что думают о вас другие"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question
			Text="С памятью у вас всё благополучно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question
			Text="Вам трудно поддерживать разговор с человеком, с которым вы только что познакомились"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question
			Text="Большую часть времени вы чувствуете общую слабость"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question
			Text="У вас редко болит голова"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question
			Text="Иногда вам бывало трудно сохранить равновесие при ходьбе"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question
			Text="Не все ваши знакомые вам нравятся"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question
			Text="Есть люди, которые пытаются украсть ваши идеи и мысли"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question
            Text="Вы считаете, что совершали поступки, которые нельзя простить"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question
			Text="Вы считаете, что вы слишком застенчивы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question
			Text="Вы почти всегда о чём-нибудь тревожитесь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question
			Text="Ваши родители часто не одобряли ваших знакомств"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question
			Text="Иногда вы немного сплетничаете"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question
			Text="Временами вы чувствуете, что вам необыкновенно легко принимать решения"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question
			Text="У вас бывает сильное сердцебиение и вы часто задыхаетесь"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question
			Text="Вы вспыльчивы, но отходчивы"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question
			Text="У вас бывают периоды такого беспокойства, что трудно усидеть на месте"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question
			Text="Ваши родители и другие члены семьи часто придираются к вам"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question
			Text="Ваша судьба никого особенно не интересует"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question
			Text="Вы не осуждаете человека, который не прочь воспользоваться в своих интересах ошибками другого"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question
            Text="Иногда вы полны энергии"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question
			Text="За последнее время у вас ухудшилось зрение"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question
			Text="Часто у вас звенит или шумит в ушах"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question
			Text="В вашей жизни были случаи (может быть, только один), когда вы чувствовали, что на вас действуют гипнозом"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question
			Text="У вас бывают периоды, когда вы необычно веселы без особой причины"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question
			Text="Даже находясь в обществе, вы обычно чувствуете себя одиноко"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question
			Text="Вы считаете, что почти каждый может солгать, чтобы избежать неприятностей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question
			Text="Вы чувствуете острее, чем большинство других людей"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question
			Text="Временами ваша голова работает как бы медленнее, чем обычно"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question
			Text="Вы часто разочаровываетесь в людях"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question
			Text="Вы злоупотребляли спиртными напитками"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>

</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Стиль_руководства.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Вам предлагается пройти тест, результаты которого помогут вам уточнить стиль Вашего руководства.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам будет предложен ряд утверждений, объединённых по 27 различным темам,
            касающихся различных сторон деятельности руководителя.
            Вам следует выбрать те утверждения, которые, по Вашему мнению, характеризуют Вас как руководителя.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Утверждения каждый раз будут предлагаться в пяти различных вариантах, Вы можете выбрать из них в каждом случае от
            <Run FontWeight="Bold">одного до трёх</Run> .
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения указателя на соответствующие ответы.
            После завершения своего выбора нажмите кнопку «Далее». 
            При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы не имеете опыта руководящей работы, попробуйте мысленно представить себя в качестве руководителя».
        </Paragraph>
    </FlowDocument>

    <k:Стиль_руководства x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Стиль руководства"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Централизует руководство. Требует, чтобы о всех делах докладывали именно ему.</q:Answer>
                <q:Answer>Руководитель пассивен в выполнении управленческих функций.</q:Answer>
                <q:Answer>Чётко распределяет функции между собой, своими заместителями и подчинёнными.</q:Answer>
                <q:Answer>Ожидает указаний сверху или даже требует их.</q:Answer>
                <q:Answer>Централизует руководство только в трудных ситуациях.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 2-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>В критических ситуациях руководитель, как правило, переходит на более жёсткие методы руководства.</q:Answer>
                <q:Answer>Критические ситуации не изменяют его способов руководства.</q:Answer>
                <q:Answer>В критических ситуациях он не обходится без помощи вышестоящих руководителей.</q:Answer>
                <q:Answer>Сталкиваясь с трудностями, руководитель начинает более тесно взаимодействовать с подчинёнными.</q:Answer>
                <q:Answer>В критических ситуациях руководитель плохо справляется со своими обязанностями.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 3-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Недостаточно общительный человек, с людьми разговаривает мало.</q:Answer>
                <q:Answer>Регулярно общается с подчинёнными, говорит о положении дел в коллективе, о трудностях в работе.</q:Answer>
                <q:Answer>Умеет общаться, но специально ограничивает общение с подчинёнными людьми, держится от них на расстоянии.</q:Answer>
                <q:Answer>Старается общаться с подчинёнными, но при этом испытывает трудности в общении.</q:Answer>
                <q:Answer>Общается в основном с активом коллектива.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 4-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>В отсутствие руководителя исполнители работают хуже.</q:Answer>
                <q:Answer>Коллектив не снижает продуктивности, если руководитель временно отсутствует.</q:Answer>
                <q:Answer>Исполнители постоянно работают не в полную силу, при другом руководителе могли бы сделать больше.</q:Answer>
                <q:Answer>Продуктивность работы повышается в отсутствие руководителя.</q:Answer>
                <q:Answer>В отсутствие руководителя коллектив работает с переменным успехом.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 5-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Сам обращается за советом к подчинённым.</q:Answer>
                <q:Answer>Не допускает, чтобы подчинённые ему советовали и тем более возражали.</q:Answer>
                <q:Answer>Подчинённые не только советуют, но могут давать указания своему руководителю.</q:Answer>
                <q:Answer>Руководитель советуется даже тогда, когда обстоятельства не особенно способствуют этому.</q:Answer>
                <q:Answer>Если исполнители знают, как лучше выполнить работу, они говорят об этом своему руководителю.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 6-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Контролирует работу от случая к случаю.</q:Answer>
                <q:Answer>Всегда очень строго контролирует работу подчинённых  и коллектива в целом.</q:Answer>
                <q:Answer>Контролирует работу, всегда замечает положительные результаты, хвалит исполнителей.</q:Answer>
                <q:Answer>Контролируя, обязательно выискивает недостатки в работе.</q:Answer>
                <q:Answer>Нередко вмешивается в работу исполнителей.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 7-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Его интересует только выполнение плана, а не отношения людей друг с другом.</q:Answer>
                <q:Answer>Решая производственные задачи, старается создать хорошие отношения между людьми в коллективе.</q:Answer>
                <q:Answer>В работе не заинтересован, подходит к делу формально.</q:Answer>
                <q:Answer>Больше внимания уделяет налаживанию взаимоотношений в коллективе, а не выполнению производственных заданий.</q:Answer>
                <q:Answer>Когда нужно, защищает интересы своих подчинённых.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 8-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Приказывает так, что хочется выполнить.</q:Answer>
                <q:Answer>Приказывать руководитель не умеет.</q:Answer>
                <q:Answer>Просьба руководителя не отличается от приказа.</q:Answer>
                <q:Answer>Приказы принимаются, но выполняются недостаточно хорошо и быстро.</q:Answer>
                <q:Answer>Его приказы вызывают у подчинённых недовольство.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 9-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>На критику руководитель обычно не обижается, прислушивается к ней.</q:Answer>
                <q:Answer>Критику выслушивает, даже обещает принять меры, но ничего не делает.</q:Answer>
                <q:Answer>Не любит, когда его критикуют, и не старается скрыть это.</q:Answer>
                <q:Answer>Принимает критику только со стороны вышестоящих руководителей.</q:Answer>
                <q:Answer>Не реагирует на критику.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 10-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Сам решает даже те вопросы, с которыми не совсем хорошо знаком.</q:Answer>
                <q:Answer>Если чего-то не знает, то не боится это показать и обращается за помощью к другим.</q:Answer>
                <q:Answer>Можно сказать, что руководитель не стремиться пополнить свои недостатки в знаниях.</q:Answer>
                <q:Answer>Когда чего-то не знает, то скрывает это и старается самостоятельно восполнить недостатки в знаниях</q:Answer>
                <q:Answer>Если руководитель не знает, как решить вопрос или выполнить работу, то поручает это своим подчинённым.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 11-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Складывается впечатление, что он боится отвечать за свои действия, хочет уменьшить свою ответственность.</q:Answer>
                <q:Answer>Ответственность распределяет между собой и своими подчинёнными.</q:Answer>
                <q:Answer>Всю ответственность возлагает только на себя.</q:Answer>
                <q:Answer>Нередко подчёркивает ответственность вышестоящих руководителей, старается свою ответственность переложить на них.</q:Answer>
                <q:Answer>Бывает, что руководитель, являясь ответственным за какое-то дело, пытается переложить его на своих подчинённых.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 12-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Старается, чтобы его заместители были квалифицированными специалистами.</q:Answer>
                <q:Answer>Он добивается безотказного подчинения заместителей и помощников.</q:Answer>
                <q:Answer>Руководителю безразлично, кто у него работает заместителем или помощником.</q:Answer>
                <q:Answer>Осторожен по отношению к заместителям, потому что боится за свое положение.</q:Answer>
                <q:Answer>Не желает иметь рядом очень квалифицированных специалистов.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 13-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Исполнители довольны, когда рядом отсутствует руководитель: они чувствуют некоторое облегчение.</q:Answer>
                <q:Answer>С руководителем работать интересно, поэтому ожидают его возвращения.</q:Answer>
                <q:Answer>Отсутствие руководителя не замечается исполнителями.</q:Answer>
                <q:Answer>Вначале исполнители довольны, что отсутствует руководитель, а потом скучают.</q:Answer>
                <q:Answer>Сначала отсутствие руководителя чувствуется исполнителями, а затем быстро забывается.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 14-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Для выполнения какой-либо работы ему нередко приходится уговаривать своих подчинённых.</q:Answer>
                <q:Answer>Всегда что-нибудь приказывает, распоряжается, наставляет, но никогда не просит.</q:Answer>
                <q:Answer>Часто обращается к подчинённым с поручениями, просьбами, советами.</q:Answer>
                <q:Answer>Часто делает подчинённым замечания и выговоры.</q:Answer>
                <q:Answer>Его замечания всегда справедливы.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 15-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Всегда обращается с подчинёнными вежливо и благожелательно.</q:Answer>
                <q:Answer>По отношению к подчинённым бывает нетактичным и даже грубым.</q:Answer>
                <q:Answer>В обращении с подчинёнными часто проявляет равнодушие.</q:Answer>
                <q:Answer>Создаётся впечатление, что вежливость руководителя неискренняя.</q:Answer>
                <q:Answer>Характер обращения с подчинёнными у него часто меняется.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 16-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Руководитель привлекает к управлению рядовых членов коллектива.</q:Answer>
                <q:Answer>Нередко руководитель перекладывает свои функции на других.</q:Answer>
                <q:Answer>Управленческие функции не закрепляются стабильно, их распределение может меняться.</q:Answer>
                <q:Answer>Бывает, что управленческие функции фактически принимает на себя не руководитель, а члены коллектива.</q:Answer>
                <q:Answer>Руководитель следит за равномерным распределением управленческих функций.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 17-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Руководитель стремится к формальной дисциплине и идеальному подчинению.</q:Answer>
                <q:Answer>Не может влиять на дисциплину.</q:Answer>
                <q:Answer>Руководитель умеет поддерживать дисциплину и порядок.</q:Answer>
                <q:Answer>Дисциплина выглядит хорошей, так как подчиненные боятся руководителя.</q:Answer>
                <q:Answer>Руководитель недостаточно пресекает нарушения дисциплины.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 18-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Общается с подчинёнными только по деловым вопросам.</q:Answer>
                <q:Answer>Заговаривая с подчинёнными о деле, руководитель спрашивает и о личном, и о семье.</q:Answer>
                <q:Answer>Часто общается по личным вопросам, не касаясь дела.</q:Answer>
                <q:Answer>Инициатива общения исходит от исполнителей, руководитель редко заговаривает сам.</q:Answer>
                <q:Answer>Нередко руководителя трудно понять в общении с ним.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 19-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Руководитель единолично вырабатывает решения или отменяет их.</q:Answer>
                <q:Answer>Редко берётся за исполнение сложного дела, а скорее всего уходит от этого.</q:Answer>
                <q:Answer>Старается всё решить вместе с подчинёнными, единолично решает только самые срочные и оперативные вопросы.</q:Answer>
                <q:Answer>Решает только те вопросы, которые сами возникают, не старается заранее предусмотреть их возникновение.</q:Answer>
                <q:Answer>Берётся за решение в основном мелких вопросов.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 20-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>В руководимом коллективе недостаточно развиты взаимопомощь и взаимное доверие.</q:Answer>
                <q:Answer>Старается, чтобы у подчинённых на работе было хорошее настроение.</q:Answer>
                <q:Answer>В его коллективе наблюдается повышенная текучесть кадров, люди нередко уходят из коллектива и не жалеют об этом.</q:Answer>
                <q:Answer>Люди, которыми он руководит, относятся друг к другу чутко, по-дружески.</q:Answer>
                <q:Answer>В присутствии руководителя исполнителям постоянно приходится работать в напряжении.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 21-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Способствует тому, чтобы подчинённые работали самостоятельно.</q:Answer>
                <q:Answer>Иногда руководитель навязывает своё мнение, а говорит, что это мнение большинства.</q:Answer>
                <q:Answer>Исполнители работают больше по указаниям руководителя, нежели самостоятельно.</q:Answer>
                <q:Answer>Исполнители предоставлены сами себе.</q:Answer>
                <q:Answer>Предоставляет подчинённым самостоятельность лишь время от времени.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 22-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Регулярно советуется с исполнителями, особенно с опытными сотрудниками.</q:Answer>
                <q:Answer>Советуется с подчинёнными только в сложной ситуации.</q:Answer>
                <q:Answer>Обычно советуется с заместителями и нижестоящими руководителями, но не с рядовыми исполнителями.</q:Answer>
                <q:Answer>С удовольствием прислушивается к мнению своих коллег.</q:Answer>
                <q:Answer>Советуется только с вышестоящими руководителями.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 23-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Инициатива подчинённых руководителем не принимается.</q:Answer>
                <q:Answer>Считает, что лучше сделать меньше (тогда меньше и спросят).</q:Answer>
                <q:Answer>Руководитель поддерживает инициативу подчинённых.</q:Answer>
                <q:Answer>Он не может действовать сам, а ждёт «подталкивания» со стороны.</q:Answer>
                <q:Answer>Инициативы не проявляют ни сам, ни его подчиненные.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 24-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Его любимый лозунг: «Давай, давай!».</q:Answer>
                <q:Answer>Он требователен, но одновременно справедлив.</q:Answer>
                <q:Answer>О нём можно сказать, что он является слишком строгим и даже придирчивым.</q:Answer>
                <q:Answer>Пожалуй, он не очень требовательный человек.</q:Answer>
                <q:Answer>Руководитель требователен и к себе, и к другим.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 25-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Наверное, он консервативен, потому что боится нового.</q:Answer>
                <q:Answer>Охотно поддерживает целесообразные нововведения.</q:Answer>
                <q:Answer>Поддерживает нововведения в сфере производства, с большим трудом меняет характер общения с людьми.</q:Answer>
                <q:Answer>У него лучше получается с нововведениями в непроизводственной сфере: в быту, на отдыхе, в межличностных отношениях.</q:Answer>
                <q:Answer>Нововведения проходят мимо руководителя.</q:Answer>
            </q:AnswersCollection>
        </q:Question>
        
        <!--Вопрос 26-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>В своей работе широко опирается на общественные организации.</q:Answer>
                <q:Answer>Многие вопросы решаются коллективом на общем собрании.</q:Answer>
                <q:Answer>Некоторые важные дела решаются фактически без участия руководителя, его функции выполняют другие.</q:Answer>
                <q:Answer>Большинство вопросов решает за коллектив сам руководитель.</q:Answer>
                <q:Answer>Руководитель способствует внедрению различных форм самоуправления в коллективе.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 27-->
        <q:Question AnswersType="MultiChoice">
            <q:AnswersCollection>
                <q:Answer>Руководителю безразлично, что о нём думают подчинённые.</q:Answer>
                <q:Answer>Никогда и ни в чём не проявляет своего превосходства  над исполнителями.</q:Answer>
                <q:Answer>Считает себя незаменимым в коллективе.</q:Answer>
                <q:Answer>Увлечённо занимается своим делом и не думает о том, как его оценивают.</q:Answer>
                <q:Answer>Руководитель излишне критичен по отношению к исполнителям.</q:Answer>
            </q:AnswersCollection>
        </q:Question>

    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Структура_темперамента_Смирнов.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Вам предлагается тест, содержащий 48 вопросов. Внимательно
            прочитайте каждое утверждение и решите: верно («ДА») или неверно
            («НЕТ») оно по отношению к Вам.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения
            курсора на соответствующий ответ. При необходимости Вы можете вернуться к
            предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих», отвечайте искренне.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту».
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:Структура_темперамента_Смирнов x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Структура темперамента"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question
			Text="Вы любите часто бывать в компании?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question
			Text="Вы избегаете иметь вещи, которые ненадежны, непрочны, хотя и красивы?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question
			Text="Часто ли у Вас бывают подъемы и спады настроения?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question
			Text="Во время беседы Вы очень быстро говорите?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question
			Text="Вам нравится работа, требующая полного напряжения сил и способностей?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question
			Text="Бывает ли, что Вы передаете слухи?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question
			Text="Считаете ли Вы себя человеком очень веселым и жизнерадостным?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question
			Text="Вы очень привыкаете к определенной одежде, ее цвету и покрою, так что неохотно меняете ее на что-нибудь другое?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question
			Text="Часто ли Вы чувствуете, что нуждаетесь в людях, которые Вас понимают, могут одобрить и утешить?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question
			Text="У Вас очень быстрый почерк?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question
			Text="Ищете ли Вы себе сами работу, занятие, хотя можно было бы и отдыхать?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question
			Text="Бывает ли так, что Вы не выполняете своих обещаний?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question
			Text="У Вас много очень хороших друзей?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question
			Text="Трудно ли Вам оторваться от дела, которым поглощены, и переключиться на другое?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question
			Text="Часто ли Вас терзает чувство вины?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question
			Text="Обычно Вы ходите очень быстро, независимо от того, спешите или нет?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question
			Text="В школе Вы бились над трудными задачками до тех пор, пока не решали их?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question
			Text="Бывает ли, что иногда Вы соображаете хуже, чем обычно?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question
			Text="Вам легко найти общий язык с незнакомыми людьми?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question
			Text="Часто ли Вы планируете, как будете себя вести при встрече, беседе?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question
			Text="Вы вспыльчивы и легко ранимы намеками и шутками?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question
			Text="Во время беседы обычно Вы жестикулируете?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question
			Text="Чаще всего Вы просыпаетесь утром свежим и хорошо отдохнувшим?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question
			Text="Бывают ли у Вас такие мысли, о которых Вы не хотели, чтобы о них знали другие?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question
			Text="Вы любите подшучивать над другими?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question
			Text="Склонны ли Вы к тому, чтобы основательно проверить свои мысли, прежде чем их сообщать кому-либо?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question
			Text="Часто ли Вам снятся кошмары?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question
			Text="Обычно Вы легко запоминаете и усваиваете новый учебный материал?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question
			Text="Вы настолько активны, что вам трудно даже несколь¬ко часов быть без дела?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question
			Text="Бывало ли, что разозлившись, Вы выходили из себя?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question
			Text="Вам не трудно внести оживление в довольно скучную компанию?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question
			Text="Вы обычно довольно долго раздумываете, принимая какое-то, даже не очень важное, решение?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question
			Text="Вам говорили, что Вы принимаете все слишком близко к сердцу?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question
			Text="Вам нравится играть в игры, требующие быстроты и хорошей реакции?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question
			Text="Если у Вас что-то долго не получается, то обычно Вы все же пытаетесь сделать это?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question
			Text="Возникало ли у Вас, хотя и кратковременно, чувство раздражения к Вашим родителям?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question
			Text="Считаете ли Вы себя открытым и общительным человеком?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question
			Text="Обычно Вам трудно взяться за новое дело?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question
			Text="Беспокоит ли Вас чувство, что Вы чем-то хуже других?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question
			Text="Обычно Вам трудно что-то делать с медлительными и неторопливыми людьми?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question
			Text="В течение дня Вы можете долго и продуктивно заниматься чем-либо, не чувствуя усталости?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question
			Text="У Вас есть привычки, от которых следовало бы избавиться?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question
			Text="Вас принимают иногда за человека беззаботного?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question
			Text="Считаете ли Вы хорошим другом только того, чья симпатия к Вам надежна и проверена?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question
			Text="Вас можно быстро рассердить?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question
			Text="Во время дискуссии обычно Вы быстро находите подходящий ответ?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question
			Text="Вы можете заставить себя долго и продуктивно, не отвлекаясь, заниматься чем-либо?"
            Answers="{StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question
			Text="Бывает ли, что Вы говорите о вещах, в которых совсем не разбираетесь?"
            Answers="{StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Тест_MMPI_Березина.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Сейчас Вам будут предложены 378 утверждений,
            касающихся различных сторон поведения людей,
            привычек, самочувствия и т.д. Прочитайте каждое утверждение и решите,
            ВЕРНО оно или НЕВЕРНО по отношению к Вам.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Внимательно читайте утверждения, но не тратьте время на долгие раздумья.
            Помните, что нет «плохих» или «хороших» ответов. Важно Ваше личное мнение. 
            При обработке результатов ответы на отдельные вопросы не учитываются - важна лишь общая картина ответов - поэтому
            можете быть СОВЕРШЕHHО ОТКРОВЕHHЫ.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если утверждение по отношению к Вам бывает и ВЕРHО, и HЕВЕРHО в разных ситуациях или в разные периоды жизни,
            выбирайте тот ответ, что бывает ЧАЩЕ или является правильным В НАСТОЯЩЕЕ ВРЕМЯ. 
            При сомнениях постарайтесь представить себя непосредственно действующим в предлагаемой ситуации и 
            сделайте предположительный выбор. 
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что всякое утверждение, которое Вы не можете расценить по отношению
            к себе как верное, следует считать неверным.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующую слово.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="GenderAnswers" x:Shared="False">
        <q:Answer>Мужской</q:Answer>
        <q:Answer>Женский</q:Answer>
    </q:AnswersCollection>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Верно</q:Answer>
        <q:Answer>Неверно</q:Answer>
    </q:AnswersCollection>

    <k:Тест_MMPI_Березина x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Тест MMPI Березина"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question Text="Ваш пол (варианты ответа: мужской/женский)."
Answers="{ StaticResource GenderAnswers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question Text=" Вам понравилась бы работа медсестры."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text=" Вы никогда не выходили из себя настолько, чтобы это Вас беспокоило."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text=" В детстве Вы играли в «классы»."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text=" Вас не беспокоит желание стать красивее."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text=" Вы всё чувствуете острее, чем большинство других людей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text=" На вечерах Вы чаще сидите в одиночку или разговариваете с одним из гостей, а не присоединяетесь к группе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text=" Вы стараетесь избегать конфликтов и затруднительных положений."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text=" Когда Вы находитесь в обществе, Вам трудно найти подходящую тему для разговора."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text=" Вас часто одолевают мрачные мысли."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text=" Почти все Ваши родственники хорошо к Вам относятся."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text=" Вы ведёте себя так, как принято в кругу людей, среди которых Вы находитесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text=" Вы достигли бы в жизни гораздо большего, если бы люди не были настроены против Вас."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text=" Временами Ваша голова работает как бы медленнее, чем обычно."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text=" Вам случалось падать в обморок."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text="  У Вас бывает сильное сердцебиение и Вы часто задыхаетесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text=" У Вас редко бывают какие-нибудь боли (или вообще ничего не болит)."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text=" Раз в неделю (или чаще) Вас беспокоит неприятное ощущение в верхней части живота (под ложечкой)."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text=" Ваш рассудок работает сейчас не хуже, чем всегда."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text=" Обычно перед сном Вам в голову лезут мысли, которые мешают Вам спать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question Text=" Вы не осуждаете человека, который не прочь воспользоваться в своих интересах ошибками другого."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question Text=" Примерно раз в неделю (или чаще) Вы бываете очень взволнованы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question Text=" Некоторые из Ваших близких совершали поступки, которые Вас пугали."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question Text=" Часто Вы чувствуете, как будто вокруг все нереально."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question Text=" Вы любите детей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question Text=" Когда Вы видите мучения животных, это Вас не особенно трогает."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question Text=" Лучше всего Вы чувствуете себя в одиночестве."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question Text=" Вам говорят, что Вы ходите во сне."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question Text=" Временами Вы чувствуете, что Вами управляет какая-то злая сила."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question Text=" Вы не осуждаете тех, кто стремится взять от жизни всё, что может."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question Text=" Вы боитесь высоты."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question Text=" Вы любите популярную литературу по технике."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question Text=" Вы вели дневник."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question Text=" Большинство людей заводит знакомство потому, что друзья могут казаться полезными."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question Text=" Большинство людей честны главным образом потому, что опасаются попасться."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question Text=" У некоторых членов Вашей семьи есть привычки, которые Вас раздражают."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question Text=" Вы любите ходить на танцы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question Text=" Обычно люди требуют больше уважения к своим правам, чем сами уважают чужие права."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question Text=" Вам трудно поддерживать разговор с человеком, с которым Вы только что познакомились."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question Text=" В школе Вам было очень трудно говорить перед всем классом."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question Text=" Теперь Вы уже не надеетесь добиться желаемого положения в жизни."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question Text=" В Вашей повседневной жизни масса интересного."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question Text=" Вам определённо не везет в жизни."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question Text=" Вы никогда не чувствовали себя лучше, чем теперь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question Text=" Вам бывает очень досадно, если приходится признать, что кто-нибудь Вас провёл."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question Text=" Часто у Вас бывает чувство, как будто голова сжата повязкой или обручем."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question Text=" Часто у Вас холодеют руки и ноги."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question Text=" Вам легко регулировать свой стул."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question Text=" Вы легко просыпаетесь от любого шума."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question Text=" Вам определённо не хватает уверенности в себе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question Text=" Иногда Вы с удовольствием слушаете неприличные анекдоты."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question Text=" Временами у Вас бывают приступы неудержимого смеха или плача."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question Text=" Большую часть времени Вам хочется умереть."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question Text=" Вы боитесь пользоваться ножом или другими острыми предметами."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question Text=" Вы чувствуете, что у Вас что-то не в порядке с головой."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question Text=" Большую часть времени Вас беспокоит кашель."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question Text=" Вы обычно слышите голоса и не знаете, откуда они идут."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question Text=" Большинство Ваших знакомых не считают Вас неприятным человеком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question Text=" Иногда Вы сердитесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question Text=" Временами Вам так нравилась ловкость какого-нибудь преступника, что Вы надеялись, что его не поймают."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question Text=" Ваша внешность никогда не вызывает у Вас беспокойства."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question Text=" Вам понравилась бы работа инженера-строителя."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question Text=" В детстве Вы очень любили Диккенса."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question Text=" Вам понравилась бы работа лесничего."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question Text=" Вы разочаровались в любви."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question Text=" Если Вам не грозит штраф, то Вы переходите улицу там, где удобно, а не там, где положено."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question Text=" Вы могли бы успешно руководить людьми."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question Text=" Вы стараетесь запоминать смешные истории, чтобы потом их рассказывать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question Text=" Вы не обижаетесь, когда над Вами подшучивают."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question Text=" Вы легко смущаетесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question Text=" В школе Вас иногда вызывали к директору за плохое поведение."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 72-->
        <q:Question Text=" Вы всегда бываете возмущены, когда человеку ловко удаётся избежать заслуженного наказания."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 73-->
        <q:Question Text=" Вы злоупотребляли спиртными напитками."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 74-->
        <q:Question Text=" Вы вспыльчивы, но отходчивы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 75-->
        <q:Question Text=" Вы любите читать в газетах заметки о преступлениях."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 76-->
        <q:Question Text=" У Вас хороший аппетит."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 77-->
        <q:Question Text=" Большую часть времени Вы чувствуете как бы комок в горле."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 78-->
        <q:Question Text=" Вы часто чувствуете в разных местах тела жжение, покалывание, «ползанье мурашек»."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 79-->
        <q:Question Text=" Иногда Вам хочется затеять драку."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 80-->
        <q:Question Text=" Бывало, по нескольку дней, недель или месяцев Вы ничем не могли заняться, потому что трудно было заставить себя включиться работу."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 81-->
        <q:Question Text=" Вы почти всегда о чём-нибудь тревожитесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 82-->
        <q:Question Text=" Вам труднее сосредоточиться, чем большинству других людей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 83-->
        <q:Question Text="  Вы никогда ни в кого не были влюблены."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 84-->
        <q:Question Text=" Вы предпочли бы почти всё время мечтать, вместо того, чтобы заниматься делом."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 85-->
        <q:Question Text=" Вы любите бывать в новых для Вас местах."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 86-->
        <q:Question Text=" Иногда Вас так привлекают чужие вещи, что хочется их украсть, хотя они Вам не нужны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 87-->
        <q:Question Text=" Когда Вы находитесь среди людей, Вам слышатся странные вещи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 88-->
        <q:Question Text=" Вы считаете, что соблюдение законов обязательно для всех."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 89-->
        <q:Question Text=" У Вас более чем достаточно причин для беспокойства."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 90-->
        <q:Question Text=" Вам неудобно просить о чём-нибудь, если не можете оказать ответную услугу."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 91-->
        <q:Question Text=" Временами, когда Вы себя плохо чувствуете, Вы бываете раздражительны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 92-->
        <q:Question Text=" Если с Вами поступают несправедливо, то Вы чувствуете, что должны из принципа отплатить за это."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 93-->
        <q:Question Text=" Если бы Вы были журналистом, то предпочли бы писать о спорте."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 94-->
        <q:Question Text=" Вас очень привлекают люди одного с Вами пола."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 95-->
        <q:Question Text=" Временами Ваши мысли текли так быстро, что Вы не успевали их высказывать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 96-->
        <q:Question Text=" Выступать или высказываться в присутствии большого числа людей Вам трудно."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 97-->
        <q:Question Text=" Вам нравятся разные коллективные развлечения, потому что Вы любите бывать в обществе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 98-->
        <q:Question Text=" Когда это возможно, Вы стараетесь избегать толпы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 99-->
        <q:Question Text=" Критика и замечания очень обижают Вас."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 100-->
        <q:Question Text=" Не раз Вы бросали какое-нибудь дело, потому что считали, что не справитесь с ним."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 101-->
        <q:Question Text=" Обычно люди неправильно понимают Ваши поступки."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 102-->
        <q:Question Text=" Вы считаете, что Ваша семейная жизнь не хуже, чем у большинства Ваших знакомых."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 103-->
        <q:Question Text=" Вашей семье не нравится специальность, которую Вы себе избрали (или намерены избрать)."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 104-->
        <q:Question Text=" Часто Вы не можете понять, почему накануне Вы были в плохом настроении и раздражены."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 105-->
        <q:Question Text=" Вам нравятся книги о тайнах или преступлениях."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 106-->
        <q:Question Text=" Временами Вас беспокоит тошнота и позывы к рвоте."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 107-->
        <q:Question Text=" У Вас бывают периоды такого беспокойства, что трудно усидеть на месте."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 108-->
        <q:Question Text=" Часто у Вас бывают боли в шее."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 109-->
        <q:Question Text=" Вы работаете с большим напряжением."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 110-->
        <q:Question Text=" Вы боитесь сойти с ума."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 111-->
        <q:Question Text=" Иногда Вы так возбуждены, что бывает трудно заснуть."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 112-->
        <q:Question Text=" Почти каждый день Вас что-нибудь пугает."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 113-->
        <q:Question Text=" Некоторые вещи так сильно волнуют Вас, что Вы не можете о них разговаривать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 114-->
        <q:Question Text=" В Вашей жизни были случаи (может быть, только один), когда Вы чувствовали, что на Вас кто-то действует гипнозом."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 115-->
        <q:Question Text=" О Вас рассказывают оскорбительные, пошлые вещи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 116-->
        <q:Question Text="  Вы религиозны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 117-->
        <q:Question Text=" Иногда Вы чувствуете, что умираете."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 118-->
        <q:Question Text=" Вы полагаете, что было бы лучше отменить почти все законы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 119-->
        <q:Question Text=" Обычно Вы осторожны с людьми, которые относятся к Вам дружелюбнее, чем Вы ожидали."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 120-->
        <q:Question Text=" Если у кого-нибудь из Вашей семьи были бы неприятности из-за нарушения закона, то Вас бы это не особенно волновало."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 121-->
        <q:Question Text=" В гостях Вы держитесь лучше, чем дома."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 122-->
        <q:Question Text=" Вам понравилась бы военная служба."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 123-->
        <q:Question Text=" Было время, когда Вам нравилось играть в куклы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 124-->
        <q:Question Text=" Вам нравится наука."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 125-->
        <q:Question Text=" Большинство людей приходится долго убеждать, чтобы доказать им какую-нибудь истину."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 126-->
        <q:Question Text=" Вы не особенно застенчивы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 127-->
        <q:Question Text=" Когда Вы узнаёте об успехах близкого знакомого, у Вас появляется чувство, что Вы неудачник."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 128-->
        <q:Question Text=" Вы смущаетесь, если при Вас рассказывают неприличные анекдоты."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 129-->
        <q:Question Text="  Вам часто хочется снова стать ребёнком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 130-->
        <q:Question Text=" Вы легко раздражаетесь при общении с людьми."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 131-->
        <q:Question Text=" У Вас меньше причин чего-либо опасаться, чем у Ваших знакомых."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 132-->
        <q:Question Text=" Сейчас Вы не полнеете и не худеете."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 133-->
        <q:Question Text=" Ваши родители и другие члены семьи часто придираются к Вам."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 134-->
        <q:Question Text=" Очень многие преувеличивают свои несчастья, чтобы добиться сочувствия и помощи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 135-->
        <q:Question Text=" Когда Вы что-нибудь делаете, то часто замечаете, что у Вас дрожат руки."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 136-->
        <q:Question Text=" Нередко у Вас бывают головокружения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 137-->
        <q:Question Text=" Плохое настроение бывает у Вас чаще, чем хорошее."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 138-->
        <q:Question Text=" У Вас бывало кровохарканье или рвота кровью."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 139-->
        <q:Question Text=" Обычно Вы считаете, что живёте не напрасно."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 140-->
        <q:Question Text=" Вам довольно безразлична Ваша дальнейшая судьба."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 141-->
        <q:Question Text=" У Вас бывает плохое, тревожное настроение, когда Вам приходится уехать хотя бы на несколько дней."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 142-->
        <q:Question Text=" Иногда Вы боитесь некоторых предметов или людей, хотя и знаете, что они Вам никак не угрожают."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 143-->
        <q:Question Text=" Когда вокруг никого нет, Вы слышите странные вещи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 144-->
        <q:Question Text=" Вы считаете себя обречённым человеком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 145-->
        <q:Question Text=" Временами Вы так хорошо слышите, что это Вам мешает."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 146-->
        <q:Question Text=" Ваша судьба никого особенно не интересует."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 147-->
        <q:Question Text=" Вы видите предметы, животных или людей, которых не видят другие."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 148-->
        <q:Question Text=" Иногда Вы не могли удержаться от того, чтобы не украсть что-нибудь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 149-->
        <q:Question Text=" Мало кто искренне старается помочь другим, если это связано с неудобствами."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 150-->
        <q:Question Text=" Бывает, что Вы не можете выбрать одно из нескольких решений."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 151-->
        <q:Question Text=" Иногда Вы говорите неправду."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 152-->
        <q:Question Text=" Вы любите готовить (пищу)."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 153-->
        <q:Question Text=" Вам понравилась бы работа библиотекаря."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 154-->
        <q:Question Text=" Вы любите охоту."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 155-->
        <q:Question Text=" Вы часто беспокоитесь о чём-нибудь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 156-->
        <q:Question Text=" Вам часто приходится бороться с собой, чтобы не показать, что Вы  застенчивы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 157-->
        <q:Question Text=" Вы хорошо себя чувствуете в толпе веселящихся людей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 158-->
        <q:Question Text=" Когда Вы едете на поезде, в автобусе и т п, Вы часто разговариваете с незнакомыми."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 159-->
        <q:Question Text=" Вы часто разочаровываетесь в людях."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 160-->
        <q:Question Text=" Когда Вам что-нибудь говорят, Вы часто тут же это забываете."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 161-->
        <q:Question Text=" Вы любили школу."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 162-->
        <q:Question Text=" Иногда без причины (или даже при неприятностях) у Вас бывает приподнятое настроение, чувство радости."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 163-->
        <q:Question Text=" Вы уверены, что о Вас говорят за Вашей спиной."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 164-->
        <q:Question Text=" Иногда Вам хочется выругаться."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 165-->
        <q:Question Text=" Безопаснее никому не доверять."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 166-->
        <q:Question Text=" Работать Вам стало труднее, чем раньше."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 167-->
        <q:Question Text=" Раз в неделю (или чаще) без причины Вас вдруг «обдаёт жаром»."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 168-->
        <q:Question Text=" У Вас очень редко бывает запор."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 169-->
        <q:Question Text=" Когда Вы уходите из дома, то Вас мучает мысль о том, заперта ли дверь, выключен ли газ, электричество и т д Вы предпочитаете «не замечать» старых знакомых, которых Вы давно не видели, проходить мимо, если они не заговорят с Вами первыми."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 170-->
        <q:Question Text=" Вы склонны принимать всё слишком близко к сердцу."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 171-->
        <q:Question Text=" Даже находясь в обществе, Вы обычно чувствуете себя одиноко."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 172-->
        <q:Question Text=" Вы не любите находиться среди людей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 173-->
        <q:Question Text=" Вы чувствуете, что разная пища имеет один и тот же вкус."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 174-->
        <q:Question Text=" У Вас были приступы, во время которых Вы не управляли своими движениями или речью, однако понимали, что происходит вокруг."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 175-->
        <q:Question Text=" У Вас есть причины завидовать кому-нибудь из членов Вашей семьи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 176-->
        <q:Question Text=" Как правило, Вы считаете, что добьетесь поставленной перед собой цели."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 177-->
        <q:Question Text=" Единственное, что Вы любите в журналах - это страницу юмора."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 178-->
        <q:Question Text=" Находясь в закрытом помещении, Вы чувствуете некоторое беспокойство."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 179-->
        <q:Question Text=" Вы человек значительный."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 180-->
        <q:Question Text=" Вам приятно иметь значительных людей среди Ваших знакомых, потому что это увеличивает Ваш престиж."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 181-->
        <q:Question Text=" Вы любите собирать цветы или выращивать их дома."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 182-->
        <q:Question Text=" В школе Вы медленно усваивали материал."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 183-->
        <q:Question Text=" Вас трудно обидеть."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 184-->
        <q:Question Text=" Если попадаешь в неприятное положение, всегда лучше молчать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 185-->
        <q:Question Text=" Вы охотно знакомитесь с людьми."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 186-->
        <q:Question Text=" Вы часто встречали людей, завидовавших Вашим удачным идеям, потому что сами они не могли до этого додуматься."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 187-->
        <q:Question Text=" Вы считаете, что Вы слишком застенчивы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 188-->
        <q:Question Text=" Вы считаете, что почти каждый может солгать, чтобы избежать неприятностей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 189-->
        <q:Question Text=" Иногда по несколько дней Вы не можете отделаться от какой-нибудь пустяковой мысли."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 190-->
        <q:Question Text=" В Вашей семье отношения менее теплые и дружеские, чем в других."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 191-->
        <q:Question Text=" Самое трудное для Вас - это справится с собой."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 192-->
        <q:Question Text=" У Вас были неприятности из-за нарушения закона."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 193-->
        <q:Question Text=" Иногда Вы полны энергии."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 194-->
        <q:Question Text=" Вы можете дружить с людьми, поступки которых Вы не одобряете."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 195-->
        <q:Question Text=" По утрам Вы обычно чувствуете, что выспались и отдохнули."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 196-->
        <q:Question Text=" Некоторые так любят командовать, что Вам хочется все делать наперекор, хотя Вы знаете, что они правы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 197-->
        <q:Question Text=" В некоторых местах Вашего тела кожа немеет."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 198-->
        <q:Question Text=" Вы любите разные игры и развлечения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 199-->
        <q:Question Text=" Вы часто видите сны, о которых лучше не рассказывать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 200-->
        <q:Question Text=" Вам почти никогда не снятся сны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 201-->
        <q:Question Text=" Почти всё время Вы чувствуете, что жизнь Вас утомляет."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 202-->
        <q:Question Text=" Вам трудно на чём-нибудь сосредоточиться."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 203-->
        <q:Question Text=" Вы считаете, что против Вас что-то замышляют."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 204-->
        <q:Question Text=" У Вас были случаи, когда Вы вдруг были вынуждены прервать работу или другое занятие и не понимали, что происходит вокруг."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 205-->
        <q:Question Text=" Любой, кто может и хочет работать, обычно добивается своей цели."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 206-->
        <q:Question Text=" В детстве Вас исключали из школы за плохое поведение."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 207-->
        <q:Question Text=" Иногда у Вас появляется непреодолимое желание нанести повреждение себе или кому-нибудь другому."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 208-->
        <q:Question Text=" У Вас есть недоброжелатели, которые стараются причинять Вам неприятности."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 209-->
        <q:Question Text=" Вам часто приходилось подчиняться кому-нибудь, кто знал меньше Вас."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 210-->
        <q:Question Text=" Не все Ваши знакомые Вам нравятся."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 211-->
        <q:Question Text=" Вы очень редко мечтаете."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 212-->
        <q:Question Text=" Если Вы спорите, то предпочитаете спорить на что-нибудь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 213-->
        <q:Question Text=" Вам хотелось бы работать цветоводом."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 214-->
        <q:Question Text=" Когда Вы идете по тротуару, то стараетесь перешагивать через трещины или другие линии на нём."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 215-->
        <q:Question Text=" Если бы позволили условия, Вы могли бы принести большую пользу людям."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 216-->
        <q:Question Text=" Когда Вы попадаете в компанию весёлых друзей, Ваши заботы исчезают."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 217-->
        <q:Question Text=" В весёлой компании Вам бывает неудобно дурачиться вместе с другими."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 218-->
        <q:Question Text="  Большинство людей способно добиваться выгоды не совсем честным способом."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 219-->
        <q:Question Text=" Вам бывает неловко входить в комнату, где уже собрались и разговаривают люди."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 220-->
        <q:Question Text=" В семье Вы совершенно независимы, и Вам не приходится придерживаться установленных в ней порядков."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 221-->
        <q:Question Text=" Вы совершаете много поступков, о которых потом жалеете (больше и чаще, чем другие)."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 222-->
        <q:Question Text=" Вы знаете, кто виноват в большинстве Ваших неприятностей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 223-->
        <q:Question Text=" Иногда Вам хочется что-нибудь разбить."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 224-->
        <q:Question Text=" Вы не боитесь крови и Вам не становится плохо при виде её."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 225-->
        <q:Question Text=" У Вас прерывистый и беспокойный сон."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 226-->
        <q:Question Text=" Вы считаете, что большинство людей не остановится перед тем, чтобы солгать в своих интересах."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 227-->
        <q:Question Text=" Временами, когда Вы смущены, Вы сильно потеете, и это Вам очень неприятно."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 228-->
        <q:Question Text=" Вас беспокоит возможность заразиться какой-нибудь болезнью."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 229-->
        <q:Question Text=" Вам трудно начинать какое-нибудь дело."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 230-->
        <q:Question Text=" Прежде чем что-нибудь сделать или принять решения (даже в мелочах) Вам приходится подумать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 231-->
        <q:Question Text=" Временами Вам приходят в голову такие нехорошие мысли, что о них лучше не рассказывать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 232-->
        <q:Question Text=" Временами Вы ощущаете странные запахи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 233-->
        <q:Question Text=" В детстве и юности Вы любили свою мать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 234-->
        <q:Question Text=" Временами Вам очень хочется нарушить правила приличия или кому-нибудь навредить."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 235-->
        <q:Question Text="  Вы верите, что всегда в конце концов торжествует справедливость."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 236-->
        <q:Question Text=" Вам хочется спать днём, а не ночью."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 237-->
        <q:Question Text=" У Вас часто выступают красные пятна на шее."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 238-->
        <q:Question Text=" Вам часто случалось подчиняться родителям, даже если Вы считали, что они неправы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 239-->
        <q:Question Text=" Вы наметили для себя жизненную программу, основанную на сознании долга и стараетесь её придерживаться."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 240-->
        <q:Question Text=" Иногда Вы немного сплетничаете."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 241-->
        <q:Question Text=" Вы любите футбол."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 242-->
        <q:Question Text=" Вы очень боитесь змей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 243-->
        <q:Question Text=" Вы не раз замечали, что незнакомые люди смотрят на Вас критически."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 244-->
        <q:Question Text=" Иногда Вы дразните животных."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 245-->
        <q:Question Text=" Вас легко отговорить от какого-нибудь намерения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 246-->
        <q:Question Text=" Вы любите бывать на вечерах и встречах."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 247-->
        <q:Question Text=" С Вами происходят (или происходили) странные вещи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 248-->
        <q:Question Text=" Вы предпочитаете не заговаривать с людьми, пока они сами к Вам не обратятся."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 249-->
        <q:Question Text=" Ваша речь такая же, как и всегда (не ускорена и не замедлена, не труднее выговаривать слова, нет хрипоты)."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 250-->
        <q:Question Text=" Ваши родители часто не одобряли Ваших знакомств."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 251-->
        <q:Question Text=" У Вас очень часто бывает чувство, как будто Вы сделали что-то неправильное или нехорошее."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 252-->
        <q:Question Text=" Кое-кто затаил злобу против Вас."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 253-->
        <q:Question Text=" Временами Вы уверены в собственной бесполезности."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 254-->
        <q:Question Text=" В последние годы Ваше самочувствие в основном было хорошим."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 255-->
        <q:Question Text=" За последнее время у Вас ухудшилось зрение."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 256-->
        <q:Question Text=" Вы теперь ежедневно пьёте намного больше воды, чем прежде."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 257-->
        <q:Question Text=" Вы считаете себя человеком нервным."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 258-->
        <q:Question Text=" Вам стало труднее понимать содержание прочитанного."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 259-->
        <q:Question Text=" Вы легко можете заплакать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 260-->
        <q:Question Text=" У Вас есть привычка считать разные ненужные Вам вещи, например, лампочки, освещённые окна и т."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 261-->
        <q:Question Text="п."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 262-->
        <q:Question Text=" Вы любите детально изучать вещи, которыми Вы занимаетесь, и читать о них."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 263-->
        <q:Question Text=" Вы считаете, что Вас часто незаслуженно наказывали."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 264-->
        <q:Question Text=" Вы считаете, что Ваша мать хорошая женщина."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 265-->
        <q:Question Text=" Ваши родные обращаются с Вами как с ребенком, а не как со взрослым."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 266-->
        <q:Question Text=" Кто-то пытается ограбить Вас."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 267-->
        <q:Question Text=" У Вас страсть к перемене мест, и Вы счастливы только находясь в дороге."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 268-->
        <q:Question Text=" Вы считаете, что за Вами следят."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 269-->
        <q:Question Text=" Человек, который вводит других в соблазн, оставляя без присмотра ценное имущество, виноват не менее того, кто это имущество крадет."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 270-->
        <q:Question Text=" Временами Вы чувствуете, что Вам необыкновенно легко принимать решения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 271-->
        <q:Question Text=" Если у Вас есть возможность получить что-либо дефицитное и очень Вам нужное без очереди, по знакомству, то Вы этим воспользуетесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 272-->
        <q:Question Text=" Вам скучно слушать разговоры о модах."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 273-->
        <q:Question Text=" Вы вполне уверены в себе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 274-->
        <q:Question Text=" Вам хотелось бы играть на сцене."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 275-->
        <q:Question Text=" Время от времени Вы испытываете ненависть к членам своей семьи, которых обычно любите."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 276-->
        <q:Question Text=" Бывали случаи, когда Вы делали вид, что больны, чтобы избежать чего-нибудь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 277-->
        <q:Question Text=" В детстве Вы принадлежали к компании, где все стояли друг за друга, несмотря ни на что."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 278-->
        <q:Question Text=" У Вас бывают периоды, во время которых Вы необычайно веселы без особой причины."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 279-->
        <q:Question Text=" Вы часто упускаете разные возможности, потому что не в состоянии вовремя принять решения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 280-->
        <q:Question Text=" Иногда у Вас пропадает или изменяется голос, даже если Вы в это время не простужены."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 281-->
        <q:Question Text=" Вам безразлично, что думают о Вас другие."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 282-->
        <q:Question Text=" Иногда Вам очень хотелось навсегда уйти из дома."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 283-->
        <q:Question Text=" Вы любите, чтобы окружающие знали Вашу точку зрения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 284-->
        <q:Question Text=" Вас беспокоят мысли о Вашем материальном и служебном положении."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 285-->
        <q:Question Text=" Ваше физическое здоровье не хуже, чем у большинства Ваших знакомых."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 286-->
        <q:Question Text=" У Вас устают глаза от долгого чтения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 287-->
        <q:Question Text=" Вас почти всё время беспокоит ощущение чего-то постороннего в носу или голове."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 288-->
        <q:Question Text=" Почти каждый месяц Вы ходите в театр."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 289-->
        <q:Question Text=" Вы редко беспокоитесь о своем здоровье."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 290-->
        <q:Question Text=" Вы часто потеете, даже в прохладную погоду."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 291-->
        <q:Question Text=" Иногда ни с того, ни с сего Вам в голову приходят нехорошие слова, часто ругательства, от которых Вы не можете избавиться."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 292-->
        <q:Question Text=" Вы обидчивее, чем большинство других людей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 293-->
        <q:Question Text=" Вам достаточно того внимания и участия, которое Вам уделяется."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 294-->
        <q:Question Text=" В детстве и юности Вы любили своего отца."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 295-->
        <q:Question Text=" Вы легко можете заставить человека бояться Вас и иногда делаете это ради собственного удовольствия."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 296-->
        <q:Question Text=" Есть люди, которые пытаются украсть Ваши идеи и мысли."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 297-->
        <q:Question Text=" Вы не боитесь иметь дело с деньгами."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 298-->
        <q:Question Text=" Кто-то пытался воздействовать на Ваше мышление."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 299-->
        <q:Question Text=" Ваше настроение не бывает подолгу плохим, почти всегда что-нибудь интересное или весёлое улучшает его."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 300-->
        <q:Question Text=" Когда Вам скучно, Вы стараетесь устроить что-нибудь весёлое."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 301-->
        <q:Question Text=" Вы не каждый день прочитываете всю газету."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 302-->
        <q:Question Text=" Вы любите поэзию."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 303-->
        <q:Question Text=" Вам часто хотелось быть женщиной, а если Вы женщина, то никогда об этом не жалели."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 304-->
        <q:Question Text=" Вам хотелось бы быть певцом (певицей)."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 305-->
        <q:Question Text=" Ваши руки стали неловкими."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 306-->
        <q:Question Text=" Иногда Вам бывает трудно мочиться или, наоборот, сдерживать позывы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 307-->
        <q:Question Text=" Вы охотно провели бы свой отпуск в доме отдыха или в коллективном туристическом походе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 308-->
        <q:Question Text=" Вас легко переспорить."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 309-->
        <q:Question Text=" Часто у Вас звенит или шумит в ушах."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 310-->
        <q:Question Text=" Знакомиться с людьми Вам труднее, чем другим."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 311-->
        <q:Question Text=" Вы против того, чтобы подавать милостыню."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 312-->
        <q:Question Text=" У Вас были неприятности из-за Вашего поведения, связанного с вопросами пола."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 313-->
        <q:Question Text=" Вам часто приходилось встречать людей, которые считались специалистами, а на деле знали не больше Вашего."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 314-->
        <q:Question Text=" Вы очень раздражаетесь, если к Вам обращаются за советом или еще как-нибудь мешают Вам, когда Вы заняты важной работой."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 315-->
        <q:Question Text=" Вы очень легко устаете."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 316-->
        <q:Question Text=" Большую часть времени Вы чувствуете общую слабость."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 317-->
        <q:Question Text=" Когда Вы притрагиваетесь к темени, то чувствуете болезненность."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 318-->
        <q:Question Text=" У Вас никогда не было ни припадков, ни судорог."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 319-->
        <q:Question Text=" По сравнению с большинством людей Вы достаточно способны и сообразительны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 320-->
        <q:Question Text=" Иногда Вы не уступаете людям не потому, что дело действительно важное, а просто из принципа."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 321-->
        <q:Question Text=" Часто Вы переходите на другую сторону улицы, чтобы не встретиться с кем-нибудь из знакомых."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 322-->
        <q:Question Text=" Иногда Вам приятно причинять боль или неприятности людям, которых Вы любите."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 323-->
        <q:Question Text=" У Вас никогда не было параличей или необычной слабости в руках и ногах."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 324-->
        <q:Question Text=" Вы считаете, что Ваш отец хороший человек."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 325-->
        <q:Question Text=" Вы считаете, что совершали поступки, которые нельзя простить."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 326-->
        <q:Question Text=" Раз в месяц (или чаще) у Вас бывает понос."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 327-->
        <q:Question Text=" Вы замечаете, что слух у Вас хуже, чем у большинства людей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 328-->
        <q:Question Text=" Вашим мышлением кто-то управляет."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 329-->
        <q:Question Text=" Когда несколько человек попадают в неприятную историю, им лучше условиться, что потом говорить."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 330-->
        <q:Question Text=" У Вас почти всё время пересыхает во рту."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 331-->
        <q:Question Text=" Иногда Вы откладываете на завтра то, что должно были сделать сегодня."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 332-->
        <q:Question Text=" Если бы Вы были журналистом, то предпочли бы писать о театре."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 333-->
        <q:Question Text=" Если бы Вы были художником, то охотно рисовали бы цветы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 334-->
        <q:Question Text=" Вам нравится бывать в обществе людей, которые любят подшучивать друг над другом."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 335-->
        <q:Question Text=" Дурные предчувствия всегда оправдываются."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 336-->
        <q:Question Text=" Вы помните периоды, когда у Вас был такой прилив сил, что казалось, можно было обходиться без сна по несколько суток подряд."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 337-->
        <q:Question Text=" Когда Вы играете, то предпочитаете играть на что-нибудь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 338-->
        <q:Question Text=" Когда Вы что-нибудь делаете, то всё время невольно отвлекаетесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 339-->
        <q:Question Text=" У Вас бывают приступы астмы или крапивницы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 340-->
        <q:Question Text=" Бывало, что Вы подвергали себя опасности из любви к риску."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 341-->
        <q:Question Text=" Вы очень редко ссорились с членами своей семьи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 342-->
        <q:Question Text=" В детстве Вы одно время совершали мелкие кражи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 343-->
        <q:Question Text=" Вам бывает трудно отложить начатое дело даже ненадолго."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 344-->
        <q:Question Text=" Если Вам делают приятное, то Вас обычно интересует, что за этим кроется."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 345-->
        <q:Question Text=" Часто Вас беспокоят боли в сердце или в груди."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 346-->
        <q:Question Text=" Иногда Вам бывало трудно сохранять равновесие во время ходьбы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 347-->
        <q:Question Text=" Вас часто беспокоит желудок."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 348-->
        <q:Question Text=" Вы верите, что в будущем люди будут жить намного лучше, чем теперь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 349-->
        <q:Question Text=" С памятью у Вас всё благополучно."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 350-->
        <q:Question Text=" Иногда Вы так настаиваете на чём-нибудь, что люди начинают терять терпение."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 351-->
        <q:Question Text=" Иногда Вам приходят в голову странные, необычные мысли."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 352-->
        <q:Question Text=" Временами Вам бывало приятно, если Вам причинял страдания дорогой Вам человек."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 353-->
        <q:Question Text=" Вы отказываетесь играть в некоторые игры, потому что у Вас это плохо получается."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 354-->
        <q:Question Text=" У Вас бывали периоды, во время которых Вы что-то делали и потом не могли вспомнить, что именно."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 355-->
        <q:Question Text=" Бывает, что Вы громко смеетесь без причины."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 356-->
        <q:Question Text=" Вы верите, что некоторые люди одним прикосновением могут исцелить болезнь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 357-->
        <q:Question Text=" Каждую неделю Вам снятся кошмары."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 358-->
        <q:Question Text=" Вас пытались отравить."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 359-->
        <q:Question Text=" В половом отношении женщины должны быть так же свободны, как и мужчины."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 360-->
        <q:Question Text=" Толкование снов может помочь принимать правильные решения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 361-->
        <q:Question Text=" В игре Вы предпочитаете выигрывать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 362-->
        <q:Question Text=" Вам хотелось бы быть журналистом."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 363-->
        <q:Question Text=" Вы охотно читаете книги о любви."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 364-->
        <q:Question Text=" Вы любите ходить в гости или в другие места, где бывает шумно и весело."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 365-->
        <q:Question Text=" Вам часто приходится отстаивать что-нибудь, что Вы считаете правильным."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 366-->
        <q:Question Text=" Вы очень часто не в курсе дел и интересов тех людей, которые Вас окружают."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 367-->
        <q:Question Text=" Если дело не клеится, Вам тут же хочется бросить его."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 368-->
        <q:Question Text=" Большинство людей довольно своей жизнью более, чем Вы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 369-->
        <q:Question Text=" Вы легко сходитесь с людьми и хорошо себя чувствуете в обществе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 370-->
        <q:Question Text=" Вы недовольны тем, как сложилась Ваша жизнь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 371-->
        <q:Question Text=" Обычно Вы удовлетворены своей судьбой."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 372-->
        <q:Question Text=" У Вас такое впечатление, что Вас никто не понимает."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 373-->
        <q:Question Text=" У Вас бывает чувство, что трудностей так много, что преодолеть их невозможно."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 374-->
        <q:Question Text=" У Вас почти всегда болит голова."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 375-->
        <q:Question Text=" У Вас редко болит голова."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 376-->
        <q:Question Text=" Часто у Вас бывают подергивания в мышцах."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 377-->
        <q:Question Text=" Несколько раз в неделю Вас беспокоит изжога."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 378-->
        <q:Question Text=" В хорошую погоду настроение у Вас обычно улучшается."
Answers="{ StaticResource Answers}">
        </q:Question>


    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Тест_Айзенка.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Вам предлагается ответить на вопросы, касающиеся Вашего обычного способа поведения.
            Постарайтесь представить типичные ситуации и дайте первый «естественный» ответ,
            который придёт Вам в голову. Если Вы согласны с утверждением, отвечайте «ДА»,
            если не согласны – «НЕТ».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
                Отвечайте искренне и быстро. Помните, что нет «хороших» или «плохих» ответов.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после
            наведения указателя на выбранный вариант ответа».
        </Paragraph>
       
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:Тест_Айзенка x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Тест Айзенка"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question Text="У Вас много различных хобби."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question Text=" Вы обдумываете предварительно то, что собираетесь сделать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text=" У Вас часто бывают спады и подъёмы настроения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text=" Вы претендовали когда-нибудь на похвалу за то, что в действительности сделал другой человек."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text=" Вы разговорчивый человек."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text=" Вас беспокоило бы то, что Вы залезли в долги."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text=" Вам приходилось чувствовать себя несчастным человеком без особых на то причин."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text=" Вам случалось когда-нибудь пожадничать, чтобы получить больше, чем Вам полагалось."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text=" Вы тщательно запираете дверь на ночь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text=" Вы считаете себя жизнерадостным человеком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text=" Увидев, как страдает ребёнок, животное, Вы бы сильно расстроились."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text=" Вы часто переживаете из-за того, что сделали или сказали что-то, чего не следовало бы делать или говорить."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text=" Вы всегда исполняете свои обещания, даже если лично Вам это очень неудобно."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text=" Вы получили бы удовольствие, прыгая с парашютом."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text=" Способны ли Вы дать волю чувствам и от души повеселиться в шумной компании."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text=" Вы раздражительны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text=" Вы когда-нибудь обвиняли кого-нибудь в том, в чём на самом деле были виноваты Вы сами."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text=" Вам нравится знакомиться с новыми людьми."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text=" Вы верите в пользу страхования."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text=" Легко ли Вас обидеть."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question Text=" Все ли Ваши привычки хороши и желательны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question Text=" Вы стараетесь быть в тени, находясь в обществе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question Text=" Стали бы Вы принимать средства, которые могут привести Вас в необычное или опасное состояние (алкоголь, наркотики)."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question Text=" Вы часто испытываете такое состояние, когда всё надоело."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question Text=" Вам случалось брать вещи, принадлежащие другому лицу, будь это даже такая мелочь, как булавка или пуговица."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question Text=" Вам нравится часто ходить к кому-нибудь в гости и бывать в обществе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question Text=" Вам доставляет удовольствие обижать тех, кого Вы любите."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question Text=" Вас часто беспокоит чувство вины."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question Text=" Вам приходилось говорить о том, в чем Вы плохо разбираетесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question Text=" Вы обычно предпочитаете книги встречам с людьми."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question Text=" У Вас есть явные враги."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question Text=" Вы назвали бы себя нервным человеком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question Text=" Вы всегда извиняетесь, когда нагрубите другому."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question Text=" У Вас много друзей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question Text=" Вам нравится устраивать розыгрыши и шутки, которые иногда могут действительно причинить людям боль."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question Text=" Вы беспокойный человек."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question Text=" В детстве Вы всегда безропотно и немедленно выполняли то, что Вам приказывали."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question Text=" Вы считаете себя беззаботным человеком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question Text=" Много ли для Вас значат хорошие манеры и чистоплотность."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question Text=" Волнуетесь ли Вы по поводу каких-либо ужасных событий, которые могли бы случиться, но не случились."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question Text=" Вам случалось сломать или потерять чужую вещь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question Text=" Вы обычно первыми проявляете инициативу при знакомстве."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question Text=" Можете ли Вы легко понять состояние человека, если он делится с Вами заботами."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question Text=" У Вас часто нервы бывают натянуты до предела."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question Text=" Бросите ли Вы ненужную бумажку на пол, если под рукой нет корзины."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question Text=" Вы больше молчите, находясь в обществе других людей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question Text=" Считаете ли Вы, что брак старомоден, и его следует отменить."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question Text=" Вы иногда чувствуете жалость к себе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question Text=" Вы иногда много хвастаетесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question Text=" Вы легко можете внести оживление в довольно скучную компанию."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question Text=" Раздражают ли Вас осторожные водители."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question Text=" Вы беспокоитесь о своём здоровье."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question Text=" Вы говорили когда-нибудь плохо о другом человеке."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question Text=" Вы любите пересказывать анекдоты и шутки своим друзьям."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question Text=" Для Вас большинство пищевых продуктов одинаковы на вкус."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question Text=" Бывает ли у Вас иногда дурное настроение."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question Text=" Вы дерзили когда-нибудь своим родителям в детстве."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question Text=" Вам нравится общаться с людьми."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question Text=" Вы переживаете, если узнаёте, что допустили ошибки в своей работе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question Text=" Вы страдаете от бессонницы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question Text=" Вы всегда моете руки перед едой."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question Text=" Вы из тех людей, которые не лезут за словом в карман."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question Text=" Вы предпочитаете приходить на встречу немного раньше назначенного срока."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question Text=" Вы чувствуете себя апатичным, усталым, без какой-либо причины."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question Text=" Вам нравится работа, требующая быстрых действий."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question Text=" Вы так любите поговорить, что не упускаете любого удобного случая побеседовать с новым человеком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question Text=" Ваша мать - хороший человек (была хорошим человеком)."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question Text=" Часто ли Вам кажется, что жизнь ужасно скучна."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question Text=" Вы когда-нибудь воспользовались оплошностью другого человека в своих целях."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question Text=" Вы часто берёте на себя больше, чем позволяет время."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question Text=" Есть ли люди, которые стараются избегать Вас."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 72-->
        <q:Question Text=" Вас очень заботит Ваша внешность."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 73-->
        <q:Question Text=" Вы всегда вежливы, даже с неприятными людьми."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 74-->
        <q:Question Text=" Считаете ли Вы, что люди затрачивают слишком много времени, чтобы обеспечить своё будущее, откладывая сбережения, страхуя себя и свою жизнь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 75-->
        <q:Question Text=" Возникало ли у Вас когда-нибудь желание умереть."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 76-->
        <q:Question Text=" Вы попытались бы избежать уплаты налога с дополнительного заработка, если бы были уверены, что Вас никогда не смогут уличить в этом."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 77-->
        <q:Question Text=" Вы можете внести оживление в компанию."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 78-->
        <q:Question Text=" Вы стараетесь не грубить людям."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 79-->
        <q:Question Text=" Вы долго переживаете после случившегося конфуза."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 80-->
        <q:Question Text=" Вы когда-нибудь настаивали на том, чтобы было по-вашему."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 81-->
        <q:Question Text=" Вы часто приезжаете на вокзал в последнюю минуту перед отходом поезда."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 82-->
        <q:Question Text=" Вы когда-нибудь намеренно говорили что-нибудь неприятное или обидное для человека."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 83-->
        <q:Question Text=" Вас беспокоили Ваши нервы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 84-->
        <q:Question Text=" Вам неприятно находиться среди людей, которые подшучивают над товарищами."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 85-->
        <q:Question Text=" Вы легко теряете друзей по своей вине."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 86-->
        <q:Question Text=" Вы часто испытываете чувство одиночества."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 87-->
        <q:Question Text=" Всегда ли Ваши слова совпадают с делом."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 88-->
        <q:Question Text=" Нравится ли Вам иногда дразнить животных."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 89-->
        <q:Question Text=" Вы легко обижаетесь на замечания, касающиеся лично Вас и Вашей работы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 90-->
        <q:Question Text=" Жизнь без какой-либо опасности показалась бы Вам слишком скучной."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 91-->
        <q:Question Text=" Вы когда-нибудь опаздывали на свидание или работу."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 92-->
        <q:Question Text=" Вам нравится суета и оживление вокруг Вас."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 93-->
        <q:Question Text=" Вы хотите, чтобы люди боялись Вас."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 94-->
        <q:Question Text=" Верно ли, что Вы иногда полны энергии и все горит в руках, а иногда совсем вялы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 95-->
        <q:Question Text=" Вы иногда откладываете на завтра то, что должны сделать сегодня."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 96-->
        <q:Question Text=" Считают ли Вас живым и весёлым человеком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 97-->
        <q:Question Text=" Часто ли Вам говорят неправду."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 98-->
        <q:Question Text=" Вы очень чувствительны к некоторым явлениям, событиям, вещам."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 99-->
        <q:Question Text=" Вы всегда готовы признавать свои ошибки."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 100-->
        <q:Question Text=" Вам когда-нибудь было жалко животное, которое попало в капкан."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 101-->
        <q:Question Text=" Трудно ли Вам было заполнять анкету."
Answers="{ StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Тест_Кеттелла.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            В этом тесте Вам будет предложено 187 вопросов, касающихся Ваших взглядов, убеждений,
            привычек и интересов. Вопросы будут появляться на экране по одному.
            Hа каждый вопрос предлагается три варианта ответа (например, "ДА", "НЕ ЗНАЮ", "НЕТ").
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующий ответ.
            При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
            Отвечая на вопрос, помните, что нет "правильных" и "неправильных" ответов.
            Hе старайтесь произвести благоприятное впечатление. Единственный критерий,
            которым Вы должны пользоваться, выбирая ответ, - именно Ваши взгляды, привычки и убеждения - только в этом 
            случае тестирование даст полезный результат.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Старайтесь избегать промежуточных, неопределённых вариантов ответа (типа "не знаю"),
            кроме тех случаев, когда Вы действительно не можете выбрать ни один из других ответов.
            Hе тратьте время на раздумья, давайте первый естественный ответ, который приходит Вам в голову.
            При сомнениях выбирайте наилучший предположительный ответ.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            При обработке результатов ответы на отдельные вопросы не учитываются - 
            важна лишь общая картина ответов - поэтому можете быть СОВЕРШЕHHО ОТКРОВЕHHЫ».
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:Тест_Кеттелла x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Тест Кеттелла"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question 
            Text="Ваш пол.">
            <q:AnswersCollection>
                <q:Answer>мужской</q:Answer>
                <q:Answer>женский</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 2-->
        <q:Question 
            Text="Ваш возраст?">
            <q:AnswersCollection>
                <q:Answer>менее 29 лет</q:Answer>
                <q:Answer>более 29 лет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 3-->
        <q:Question 
            Text="Я хорошо понял инструкцию, которую только что прочитал:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не знаю</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 4-->
        <q:Question 
            Text="Я готов отвечать на каждый вопрос как можно более искренно:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 5-->
        <q:Question 
            Text="Я бы предпочёл жить в доме, который находится:">
            <q:AnswersCollection>
                <q:Answer>в обжитом пригороде</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>в глухих лесах</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 6-->
        <q:Question 
            Text="Я чувствую в себе достаточно сил, чтобы справиться со своими трудностями:">
            <q:AnswersCollection>
                <q:Answer>всегда</q:Answer>
                <q:Answer>обычно</q:Answer>
                <q:Answer>редко</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 7-->
        <q:Question 
            Text="Я чувствую некоторое беспокойство при виде диких животных, даже если они находятся в прочных клетках:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 8-->
        <q:Question 
            Text="Я воздерживаюсь от критики людей и их высказываний:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 9-->
        <q:Question 
            Text="Я делаю саркастические (язвительные) замечания по поводу людей, если они этого, по моему, заслуживают:">
            <q:AnswersCollection>
                <q:Answer>обычно</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>никогда</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 10-->
        <q:Question 
            Text="Мне больше нравится классическая, чем эстрадная музыка:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 11-->
        <q:Question 
            Text="Если бы я увидел дерущихся соседских детей, то я:">
            <q:AnswersCollection>
                <q:Answer>дал бы им возможность договориться самим</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>рассудил бы их</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 12-->
        <q:Question 
            Text="При общении с людьми я:">
            <q:AnswersCollection>
                <q:Answer>с готовностью вступаю в разговор</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>предпочитаю спокойно оставаться в стороне</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 13-->
        <q:Question 
            Text="По-моему интереснее быть:">
            <q:AnswersCollection>
                <q:Answer>инженером-строителем</q:Answer>
                <q:Answer>не могу выбрать</q:Answer>
                <q:Answer>драматургом</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 14-->
        <q:Question 
            Text="Я могу остановиться на улице скорее, чтобы посмотреть на работу художника, чем слушать, как ссорятся люди:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не могу выбрать</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 15-->
        <q:Question 
            Text="Обычно я могу ладить с самодовольными людьми, несмотря на то, что они хвастаются или слишком много о себе воображают:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 16-->
        <q:Question 
            Text="По лицу человека почти всегда можно заметить, что он нечестен:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 17-->
        <q:Question 
            Text="Было бы хорошо, если бы отпуск (каникулы) был более продолжителен, и каждый был бы обязан его использовать:">
            <q:AnswersCollection>
                <q:Answer>согласен</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>не согласен</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 18-->
        <q:Question 
            Text="Я предпочел бы работу с возможно большим, но непостоянным заработком, чем работу со скромным, но постоянным окладом:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 19-->
        <q:Question 
            Text="Я говорю о своих чувствах:">
            <q:AnswersCollection>
                <q:Answer>только если это необходимо</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>охотно, когда представится возможность</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 20-->
        <q:Question 
            Text="Время от времени у меня возникает чувство неопределённой опасности или внезапного страха по непонятным причинам:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>редко</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 21-->
        <q:Question 
            Text="Когда меня неправильно критикуют за что-то, в чём я не виноват, я:">
            <q:AnswersCollection>
                <q:Answer>не испытываю чувства вины</q:Answer>
                <q:Answer>не могу выбрать</q:Answer>
                <q:Answer>всё же чувствую себя немного виноватым</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 22-->
        <q:Question 
            Text="За деньги можно купить почти всё:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 23-->
        <q:Question 
            Text="Моими решениями руководит больше:">
            <q:AnswersCollection>
                <q:Answer>сердце</q:Answer>
                <q:Answer>и то, и другое</q:Answer>
                <q:Answer>разум</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 24-->
        <q:Question 
            Text="Большинство людей были бы более счастливы, если бы они были ближе друг к другу и поступали так же, как все:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 25-->
        <q:Question 
            Text="Иногда, когда я смотрю в зеркало, мне трудно разобраться, где у меня правая, а где левая сторона:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не знаю</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 26-->
        <q:Question 
            Text="При разговоре я предпочитаю:">
            <q:AnswersCollection>
                <q:Answer>высказывать свои мысли так, как они приходят мне в голову</q:Answer>
                <q:Answer>не могу выбрать</q:Answer>
                <q:Answer>сначала сформулировать получше свои мысли</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 27-->
        <q:Question 
            Text="После того, как меня что-то сильно рассердит, я довольно быстро успокаиваюсь:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 28-->
        <q:Question 
            Text="При одинаковом рабочем времени и заработке было бы интереснее работать:">
            <q:AnswersCollection>
                <q:Answer>плотником или поваром</q:Answer>
                <q:Answer>не могу выбрать</q:Answer>
                <q:Answer>официантом в хорошем ресторане</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 29-->
        <q:Question 
            Text="Hа общественные должности меня выбирали:">
            <q:AnswersCollection>
                <q:Answer>очень редко</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>много раз</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 30-->
        <q:Question 
            Text="«Лопата» относится к «копать», как «нож» относится к:">
            <q:AnswersCollection>
                <q:Answer>«острый»</q:Answer>
                <q:Answer>«резать»</q:Answer>
                <q:Answer>«указывать»</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 31-->
        <q:Question 
            Text="Иногда я не могу заснуть, потому что какая-нибудь мысль не выходит из головы:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>редко</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 32-->
        <q:Question 
            Text="В своей жизни я почти всегда достигаю поставленных целей:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 33-->
        <q:Question 
            Text="Устаревший закон следует изменить:">
            <q:AnswersCollection>
                <q:Answer>только после глубокого основательного обсуждения</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>как можно скорей</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 34-->
        <q:Question 
            Text="Я чувствую себя «не в своей тарелке», когда от меня требуются быстрые действия, результаты которых могут повлиять на других людей:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не могу выбрать</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 35-->
        <q:Question 
            Text="Большинство знакомых считает меня интересным рассказчиком:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 36-->
        <q:Question 
            Text="Когда я вижу неряшливых, неопрятных людей, я:">
            <q:AnswersCollection>
                <q:Answer>принимаю их такими, какими они есть</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>испытываю отвращение и возмущение</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 37-->
        <q:Question 
            Text="Я чувствую себя немного не по себе, если неожиданно оказываюсь в центре внимания группы людей:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 38-->
        <q:Question 
            Text="Я всегда рад оказаться среди людей, например, в гостях, на танцах, на какой-либо коллективной встрече:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 39-->
        <q:Question 
            Text="В школе я предпочитал (предпочитаю):">
            <q:AnswersCollection>
                <q:Answer>заниматься музыкой, пением</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>выпиливать и мастерить что-либо</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 40-->
        <q:Question 
            Text="Если меня назначают руководителем, я настаиваю на том, чтобы мои указания выполнялись, иначе я отказываюсь от этой работы:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 41-->
        <q:Question 
            Text="Важнее, чтобы родители:">
            <q:AnswersCollection>
                <q:Answer>помогали детям развивать свои чувства</q:Answer>
                <q:Answer>и то, и другое</q:Answer>
                <q:Answer>обучали детей сдерживать свои чувства</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 42-->
        <q:Question 
            Text="Участвуя в групповой деятельности, я бы предпочёл:">
            <q:AnswersCollection>
                <q:Answer>постараться улучшить организацию работы</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>следить за результатами и соблюдением правил</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 43-->
        <q:Question 
            Text="Время от времени у меня появляется потребность в интенсивной физической деятельности:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 44-->
        <q:Question 
            Text="Я предпочёл бы скорее общаться с вежливыми людьми, чем с грубыми или любящими возражать:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 45-->
        <q:Question 
            Text="Я чувствую себя униженным, когда меня критикуют в присутствии других людей:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 46-->
        <q:Question 
            Text="Если меня вызывает начальство, то я:">
            <q:AnswersCollection>
                <q:Answer>пользуюсь случаем, чтобы попросить о чём-то нужном мне</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>боюсь, что это связано с какой-нибудь оплошностью в моей работе</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 47-->
        <q:Question 
            Text="В наше время требуется:">
            <q:AnswersCollection>
                <q:Answer>больше спокойных, солидных людей</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>больше «идеалистов», планирующих лучшее будущее</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 48-->
        <q:Question 
            Text="При чтении я сразу замечаю, когда автор произведения хочет меня в чём-то убедить:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 49-->
        <q:Question 
            Text="В юности я принимал участие в спортивных мероприятиях:">
            <q:AnswersCollection>
                <q:Answer>иногда</q:Answer>
                <q:Answer>довольно часто</q:Answer>
                <q:Answer>многократно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 50-->
        <q:Question 
            Text="Я поддерживаю порядок в моей комнате, все вещи всегда лежат на своих местах:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 51-->
        <q:Question 
            Text="Иногда у меня возникает чувство напряжения и беспокойства, когда я вспоминаю, что произошло в течение дня:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 52-->
        <q:Question 
            Text="Иногда я сомневаюсь, действительно ли люди, с которыми я разговариваю, интересуются тем, что я говорю:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>
        
        <!--Вопрос 53-->
        <q:Question 
            Text="Если бы пришлось выбирать, то я предпочел бы быть:">
            <q:AnswersCollection>
                <q:Answer>лесником</q:Answer>
                <q:Answer>не могу выбрать</q:Answer>
                <q:Answer>учителем средней школы</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 54-->
        <q:Question 
            Text="Hа праздники и дни рождения я:">
            <q:AnswersCollection>
                <q:Answer>люблю делать подарки</q:Answer>
                <q:Answer>не могу сказать</q:Answer>
                <q:Answer>считаю, что делать подарки - довольно обременительно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 55-->
        <q:Question 
            Text="«Усталый» относится к «работе», как «гордый» относится к:">
            <q:AnswersCollection>
                <q:Answer>«улыбка»</q:Answer>
                <q:Answer>«успех»</q:Answer>
                <q:Answer>«счастливый»</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 56-->
        <q:Question 
            Text="Какой из следующих предметов по существу отличается от двух других:">
            <q:AnswersCollection>
                <q:Answer>свеча</q:Answer>
                <q:Answer>луна</q:Answer>
                <q:Answer>электрический свет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 57-->
        <q:Question 
            Text="Друзья меня подводили:">
            <q:AnswersCollection>
                <q:Answer>очень редко</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>довольно часто</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 58-->
        <q:Question 
            Text="У меня есть качества, по которым я определенно выше большинства людей:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 59-->
        <q:Question 
            Text="Когда я расстроен, я стараюсь скрыть свои чувства от других:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 60-->
        <q:Question 
            Text="Я склонен посещать зрелищные мероприятия и развлечения:">
            <q:AnswersCollection>
                <q:Answer>чаще, чем раз в неделю (т.е. чаще, чем большинство)</q:Answer>
                <q:Answer>примерно раз в неделю (т.е. как все)</q:Answer>
                <q:Answer>реже, чем раз в неделю (т.е. реже, чем большинство)</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 61-->
        <q:Question 
            Text="Я считаю, что для меня непринуждённое поведение важнее, чем хорошие манеры и уважение к существующим правилам поведения:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 62-->
        <q:Question 
            Text="Обычно я молчу в присутствии старших по возрасту, опыту и положению:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>
        
        <!--Вопрос 63-->
        <q:Question 
            Text="Мне трудно говорить или выступать перед группой людей:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 64-->
        <q:Question 
            Text="У меня хорошее чувство ориентировки в незнакомом месте (мне легко сказать, где север, где юг, где восток или запад):">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 65-->
        <q:Question 
            Text="Если кто-нибудь рассердится на меня, то я:">
            <q:AnswersCollection>
                <q:Answer>постараюсь его успокоить</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>раздражаюсь</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 66-->
        <q:Question 
            Text="Встречаясь с несправедливостью, я скорее склонен забывать об этом, чем реагировать:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 67-->
        <q:Question 
            Text="Из моей памяти часто выпадают несущественные, тривиальные вещи, например, названия улиц, магазинов:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 68-->
        <q:Question 
            Text="Мне бы понравилась жизнь ветеринара, лечение и операции на животных:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 69-->
        <q:Question 
            Text="Я ем со вкусом, не всегда так аккуратно и тщательно, как другие люди:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 70-->
        <q:Question 
            Text="Бывают времена, когда у меня нет настроения видеть кого бы то ни было:">
            <q:AnswersCollection>
                <q:Answer>очень редко</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>довольно часто</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 71-->
        <q:Question 
            Text="Иногда меня предупреждают о том, что в моём голосе и манерах слишком проявляется возбуждение:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 72-->
        <q:Question 
            Text="В юности, если я расходился во мнении с родителями, то я:">
            <q:AnswersCollection>
                <q:Answer>оставался при своем мнении</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>соглашался с их авторитетом</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 73-->
        <q:Question 
            Text="Я предпочёл бы заниматься самостоятельной работой, а не совместной с другими:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 74-->
        <q:Question 
            Text="Мне бы больше понравилась спокойная жизнь, чем слава и шумный успех:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 75-->
        <q:Question 
            Text="В большинстве случаев я чувствую себя зрелым человеком:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 76-->
        <q:Question 
            Text="Замечания в мой адрес, которые позволяют себе некоторые люди, меня больше расстраивают, чем помогают:">
            <q:AnswersCollection>
                <q:Answer>часто</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>никогда</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 77-->
        <q:Question 
            Text="Я всегда способен управлять проявлением своих чувств:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 78-->
        <q:Question 
            Text="Hачиная работу над полезным изобретением, я бы предпочел:">
            <q:AnswersCollection>
                <q:Answer>разрабатывать его в лаборатории</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>заниматься его практической реализацией</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 79-->
        <q:Question 
            Text="«Удивление» относится к «странный», как «страх» относится к:">
            <q:AnswersCollection>
                <q:Answer>«смелый»</q:Answer>
                <q:Answer>«тревожный»</q:Answer>
                <q:Answer>«ужасный»</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 80-->
        <q:Question 
            Text="Какая из следующих дробей отличается от двух других:">
            <q:AnswersCollection>
                <q:Answer>3/7</q:Answer>
                <q:Answer>3/9</q:Answer>
                <q:Answer>3/11</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 81-->
        <q:Question 
            Text="Кажется, некоторые люди игнорируют и избегают меня, хотя я не знаю почему:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 82-->
        <q:Question 
            Text="Отношение ко мне людей не соответствует моим добрым намерениям:">
            <q:AnswersCollection>
                <q:Answer>часто</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>никогда</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 83-->
        <q:Question 
            Text="Употребление нецензурных выражений вызывает у меня возмущение, даже если при этом не присутствуют лица другого пола:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 84-->
        <q:Question 
            Text="У меня определённо меньше друзей, чем у большинства людей:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 85-->
        <q:Question 
            Text="Я бы очень не хотел находиться в таком месте, где нет таких людей, с которыми можно поговорить:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 86-->
        <q:Question 
            Text="Люди иногда считают меня небрежным, хотя и думают, что я приятный человек:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 87-->
        <q:Question 
            Text="Волнение перед выступлением в присутствии многих людей я испытывал:">
            <q:AnswersCollection>
                <q:Answer>довольно часто</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>почти никогда</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 88-->
        <q:Question 
            Text="Когда я нахожусь в большой группе людей, то я предпочитаю молчать и предоставляю говорить другим:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 89-->
        <q:Question 
            Text="Я предпочитаю читать:">
            <q:AnswersCollection>
                <q:Answer>реалистические описания военных или политических сражений</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>романы, где много чувств и воображения</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 90-->
        <q:Question 
            Text="Когда люди пытаются мною командовать, я поступаю как раз наоборот:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 91-->
        <q:Question 
            Text="Hачальники или члены моей семьи как правило критикуют меня только тогда, когда к этому действительно есть повод:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 92-->
        <q:Question 
            Text="Hа улицах или в магазинах мне не нравится, когда некоторые люди пристально разглядывают других:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 93-->
        <q:Question 
            Text="Во время длительной поездки я бы предпочел:">
            <q:AnswersCollection>
                <q:Answer>читать что-нибудь серьезное, но интересное</q:Answer>
                <q:Answer>не могу выбрать</q:Answer>
                <q:Answer>провести время, беседуя с кем-либо из пассажиров</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 94-->
        <q:Question 
            Text="В случаях, когда может возникнуть опасность, я громко разговариваю, хотя это выглядит невежливо и нарушает спокойствие:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 95-->
        <q:Question 
            Text="Если знакомые плохо обращаются со мной и демонстрируют свою неприязнь ко мне, то:">
            <q:AnswersCollection>
                <q:Answer>меня совершенно это не трогает</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>я расстраиваюсь</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 96-->
        <q:Question 
            Text="Я смущаюсь, когда меня хвалят или говорят мне комплименты:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 97-->
        <q:Question 
            Text="Я бы предпочел иметь работу:">
            <q:AnswersCollection>
                <q:Answer>с постоянным окладом</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>с большим окладом, который зависел бы от моей способности показать людям, чего я стою</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 98-->
        <q:Question 
            Text="Чтобы быть информированным, я предпочитаю получать информацию:">
            <q:AnswersCollection>
                <q:Answer>в общении с людьми</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>из литературы</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 99-->
        <q:Question 
            Text="Мне нравится принимать активное участие в общественной работе:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 100-->
        <q:Question 
            Text="При выполнении задания я удовлетворяюсь только тогда, когда должное внимание будет уделено всем мелочам:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 101-->
        <q:Question 
            Text="Даже самые незначительные неудачи иногда меня очень раздражают:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 102-->
        <q:Question 
            Text="Сон у меня всегда крепкий, я никогда не хожу и не разговариваю во сне:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 103-->
        <q:Question 
            Text="Для меня интереснее работа, при которой:">
            <q:AnswersCollection>
                <q:Answer>нужно разговаривать с людьми</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нужно заниматься счетами и записями</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 104-->
        <q:Question 
            Text="«Размер» так относится к «длине», как «нечестный» относится к:">
            <q:AnswersCollection>
                <q:Answer>«тюрьма»</q:Answer>
                <q:Answer>«нарушение»</q:Answer>
                <q:Answer>«кража»</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 105-->
        <q:Question 
            Text="«АБ» так относится к «ГВ», как «СР» относится к:">
            <q:AnswersCollection>
                <q:Answer>«ПО»</q:Answer>
                <q:Answer>«ОП»</q:Answer>
                <q:Answer>«ТУ»</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 106-->
        <q:Question 
            Text="Когда люди ведут себя неразумно, то я:">
            <q:AnswersCollection>
                <q:Answer>молчу</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>высказываю свое презрение</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 107-->
        <q:Question 
            Text="Если кто-нибудь громко разговаривает, когда я слушаю музыку, то я:">
            <q:AnswersCollection>
                <q:Answer>могу сосредоточиться на музыке и не отвлекаться</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>чувствую, что это портит мне удовольствие и раздражает меня</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 108-->
        <q:Question 
            Text="Меня лучше охарактеризовать как:">
            <q:AnswersCollection>
                <q:Answer>вежливого и спокойного</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>энергичного</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 109-->
        <q:Question 
            Text="В общественных мероприятиях я принимаю участие только тогда, когда это необходимо, а чаще избегаю их:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 110-->
        <q:Question 
            Text="Быть осторожным и не ждать многого лучше, чем быть оптимистом и всегда ждать успеха:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 111-->
        <q:Question 
            Text="Думая о трудностях в своей работе, я:">
            <q:AnswersCollection>
                <q:Answer>стараюсь планировать заранее, прежде чем встретить трудности</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>считаю, что справлюсь с трудностями по мере их возникновения</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 112-->
        <q:Question 
            Text="Мне легко вступать в контакт с людьми во время различных общественных мероприятий:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 113-->
        <q:Question 
            Text="Когда требуется немного дипломатии и умения убедить людей что-либо сделать, обычно об этом просят меня:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 114-->
        <q:Question 
            Text="Интересно быть:">
            <q:AnswersCollection>
                <q:Answer>консультантам, помогающим молодым людям выбирать работу</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>руководителем технического предприятия</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 115-->
        <q:Question 
            Text="Если я уверен, что человек несправедлив или ведёт себя эгоистично, я указываю на это, даже если это ведёт к неприятностям:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 116-->
        <q:Question 
            Text="Иногда я говорю глупости ради шутки, чтобы удивить людей и посмотреть, что они на это скажут:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 117-->
        <q:Question 
            Text="Мне бы нравилась работать газетным критиком в разделе театра, кино, концертов:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 118-->
        <q:Question 
            Text="Когда приходится долго сидеть на собрании, у меня никогда не возникает желание что-нибудь рисовать или вертеть в руках:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 119-->
        <q:Question 
            Text="Если кто-нибудь говорит мне что-то неправильное, я скорее подумаю:">
            <q:AnswersCollection>
                <q:Answer>«он – лжец»</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>«по-видимому, он плохо информирован»</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 120-->
        <q:Question 
            Text="Я чувствую, что мне угрожает какое-то наказание, даже когда я ничего плохого не сделал:">
            <q:AnswersCollection>
                <q:Answer>часто</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>никогда</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 121-->
        <q:Question 
            Text="Мнение о том, что болезнь имеет как психические, так и физические причины, сильно преувеличено:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не знаю</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 122-->
        <q:Question 
            Text="Торжественность и величие традиционных церемоний следует сохранить:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 123-->
        <q:Question 
            Text="Мысль о том, что люди подумают, будто я веду себя необычно или странно, беспокоит меня:">
            <q:AnswersCollection>
                <q:Answer>очень</q:Answer>
                <q:Answer>немного</q:Answer>
                <q:Answer>совсем не беспокоит</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 124-->
        <q:Question 
            Text="Выполняя какое-либо дело, я бы предпочел работать:">
            <q:AnswersCollection>
                <q:Answer>в составе коллектива</q:Answer>
                <q:Answer>не могу выбрать</q:Answer>
                <q:Answer>самостоятельно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 125-->
        <q:Question 
            Text="У меня бывают периоды, когда мне трудно избавиться от жалости к себе:">
            <q:AnswersCollection>
                <q:Answer>часто</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>никогда</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 126-->
        <q:Question 
            Text="Часто я слишком быстро начинаю сердиться на людей:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 127-->
        <q:Question 
            Text="Я всегда могу без труда изменить свои старые привычки и не возвращаться к прежнему:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 128-->
        <q:Question 
            Text="Если бы зарплата была одинаковой, то я предпочел быть">
            <q:AnswersCollection>
                <q:Answer>адвокатом</q:Answer>
                <q:Answer>не могу выбрать</q:Answer>
                <q:Answer>пилотом или капитаном судна</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 129-->
        <q:Question 
            Text="«Лучшее» так относится к «наихудшее», как «медленное» относится к:">
            <q:AnswersCollection>
                <q:Answer>«быстрое»</q:Answer>
                <q:Answer>«лучшее»</q:Answer>
                <q:Answer>«быстрейшее»</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 130-->
        <q:Question 
            Text="Каким из приведенных ниже сочетаний следует продолжить буквенный ряд: РООООРРОООРРР....">
            <q:AnswersCollection>
                <q:Answer>ОРРР</q:Answer>
                <q:Answer>ООРР</q:Answer>
                <q:Answer>РООО</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 131-->
        <q:Question 
            Text="Иногда, когда приходит время осуществить то, что я планировал и ждал, я обнаруживаю, что уже пропало желание делать это:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 132-->
        <q:Question 
            Text="Большей частью я могу продолжать работать тщательно, не обращая внимание на шум, создаваемый другими:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 133-->
        <q:Question 
            Text="Иногда я говорю посторонним вещи, кажущиеся мне важными, независимо от того, спрашивают ли они об этом:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не могу сказать</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 134-->
        <q:Question 
            Text="Много свободного времени я провожу в разговорах с друзьями о прошлых развлечениях, от которых я получал удовольствие:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 135-->
        <q:Question 
            Text="Мне нравится устраивать какие-нибудь смелые, рискованные выходки «смеха ради»:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не могу сказать</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 136-->
        <q:Question 
            Text="Вид неубранной комнаты очень раздражает меня:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 137-->
        <q:Question 
            Text="Я считаю себя очень общительным, открытым человеком:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 138-->
        <q:Question 
            Text="В общении я:">
            <q:AnswersCollection>
                <q:Answer>свободно проявляю свои чувства</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>держу свои переживания «при себе»</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 139-->
        <q:Question 
            Text="Я люблю музыку:">
            <q:AnswersCollection>
                <q:Answer>легкую, живую</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>чувственную</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 140-->
        <q:Question 
            Text="Красота поэмы восхищает меня больше, чем красота хорошо сделанного оружия:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 141-->
        <q:Question 
            Text="Если мое удачное замечание остаётся незамеченным окружающими, то я:">
            <q:AnswersCollection>
                <q:Answer>смиряюсь с этим</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>даю людям возможность услышать его еще раз</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 142-->
        <q:Question 
            Text="Мне бы понравилось работать фотокорреспондентом:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 143-->
        <q:Question 
            Text="Hужно быть осторожным в общении с незнакомыми, так как можно, например, заразиться:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 144-->
        <q:Question 
            Text="Во время поездок за границу я бы скорее предпочёл быть под руководством экскурсовода, чем самому планировать маршрут:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 145-->
        <q:Question 
            Text="Меня справедливо считают упорным и трудолюбивым, но не слишком преуспевающим человеком:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 146-->
        <q:Question 
            Text="Если люди пользуются моим хорошим отношением в своих интересах, то я не возмущаюсь этим и вскоре об этом забываю:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 147-->
        <q:Question 
            Text="Если при обсуждении какого-либо вопроса среди участников возникает ожесточённый спор, то я предпочитаю:">
            <q:AnswersCollection>
                <q:Answer>увидеть, кто же «победил»</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>чтобы спор разрешился мирно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 148-->
        <q:Question 
            Text="Я предпочитаю планировать что-либо самостоятельно, без вмешательства и предложений со стороны других:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 149-->
        <q:Question 
            Text="Иногда чувство зависти влияет на мои действия:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 150-->
        <q:Question 
            Text="Я твёрдо верю, что начальник может быть не всегда прав, но он всегда имеет право быть начальником:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 151-->
        <q:Question 
            Text="Когда я думаю обо всём, что ещё предстоит сделать, у меня появляется чувство напряжённости:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 152-->
        <q:Question 
            Text="Когда зрители мне что-либо кричат во время игры, меня это не трогает:">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 153-->
        <q:Question 
            Text="Интереснее быть:">
            <q:AnswersCollection>
                <q:Answer>художником</q:Answer>
                <q:Answer>трудно выбрать</q:Answer>
                <q:Answer>организатором культурных развлечений</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 154-->
        <q:Question 
            Text="Какое из следующих слов не относится к двум другим?">
            <q:AnswersCollection>
                <q:Answer>«любые»</q:Answer>
                <q:Answer>«некоторые»</q:Answer>
                <q:Answer>«большинство»</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 155-->
        <q:Question 
            Text="«Пламя» так относится к «жар», как «роза» относится к:">
            <q:AnswersCollection>
                <q:Answer>«шип»</q:Answer>
                <q:Answer>«красивые лепестки»</q:Answer>
                <q:Answer>«аромат»</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 156-->
        <q:Question 
            Text="У меня бывают яркие сновидения, мешающие мне спать.">
            <q:AnswersCollection>
                <q:Answer>часто</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>практически никогда</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 157-->
        <q:Question 
            Text="Если на пути к успеху стоят серьёзные препятствия, я всё-таки предпочитаю рискнуть.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 158-->
        <q:Question 
            Text="Когда я нахожусь в группе людей, приступающих к какой-то работе, то само собой получается, что я оказываюсь во главе их.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 159-->
        <q:Question 
            Text="Мне больше нравится в одежде спокойная корректность, чем бросающаяся в глаза индивидуальность.">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 160-->
        <q:Question 
            Text="Мне больше нравится провести вечер за спокойным, любимым занятием, чем в оживленной компании.">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>
        
        <!--Вопрос 161-->
        <q:Question 
            Text="Я не обращаю внимания на доброжелательные советы других, даже когда эти советы могли бы быть полезными.">
            <q:AnswersCollection>
                <q:Answer>иногда</q:Answer>
                <q:Answer>почти никогда</q:Answer>
                <q:Answer>никогда</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 162-->
        <q:Question 
            Text="В своих поступках я всегда тщательно стараюсь придерживаться общепринятых правил поведения.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 163-->
        <q:Question 
            Text="Мне не очень нравится, когда смотрят, как я работаю.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 164-->
        <q:Question 
            Text="Иногда приходится применять силу, потому что не всегда возможно добиться результата с помощью убеждения.">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 165-->
        <q:Question 
            Text="В школе я предпочитал (или предпочитаю)">
            <q:AnswersCollection>
                <q:Answer>русский язык и литературу</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>математику и арифметику</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 166-->
        <q:Question 
            Text="Меня иногда огорчало, что обо мне за глаза отзывались неодобрительно без всяких к тому оснований">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не могу сказать</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 167-->
        <q:Question 
            Text="Разговор с простыми людьми, которые всегда придерживаются общепринятых правил и традиций:">
            <q:AnswersCollection>
                <q:Answer>часто вполне интересен и содержателен</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>раздражает меня, потому что ограничивается мелочами</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 168-->
        <q:Question 
            Text="Hекоторые вещи настолько раздражают меня, что я предпочитаю вообще не говорить на эти темы:">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 169-->
        <q:Question 
            Text="В воспитании важнее:">
            <q:AnswersCollection>
                <q:Answer>относиться к ребёнку с достаточной любовью</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>вырабатывать нужные привычки и отношение к жизни</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 170-->
        <q:Question 
            Text="Люди считают меня положительным, спокойным человеком, которого не трогают превратности судьбы.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 171-->
        <q:Question 
            Text="Я считаю, что общество должно руководствоваться разумом и отбросить старые привычки и изжившие себя традиции.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 172-->
        <q:Question 
            Text="Думаю, в современном мире важнее разрешить">
            <q:AnswersCollection>
                <q:Answer>вопросы нравственности</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>разногласия между странами мира</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 173-->
        <q:Question 
            Text="Я лучше усваиваю материал,">
            <q:AnswersCollection>
                <q:Answer>читая хорошо написанную книгу</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>участвуя в обсуждении вопроса</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 174-->
        <q:Question 
            Text="Я предпочитаю идти своим путём вместо того, чтобы действовать в соответствии с принятыми правилами.">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 175-->
        <q:Question 
            Text="Прежде чем выдвигать какой-нибудь аргумент, я предпочитаю подождать, пока не буду убеждён, что я прав.">
            <q:AnswersCollection>
                <q:Answer>всегда</q:Answer>
                <q:Answer>обычно</q:Answer>
                <q:Answer>только, если это целесообразно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 176-->
        <q:Question 
            Text="Мелочи иногда невыносимо действуют мне на нервы, хотя я и понимаю, что они несущественны.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 177-->
        <q:Question 
            Text="Под влиянием момента я редко говорю вещи, о которых потом очень сожалею.">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>не могу сказать</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 178-->
        <q:Question 
            Text="Если бы меня попросили участвовать в шефской деятельности, то я бы:">
            <q:AnswersCollection>
                <q:Answer>согласился</q:Answer>
                <q:Answer>не могу сказать</q:Answer>
                <q:Answer>вежливо сказал бы, что очень занят</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 179-->
        <q:Question 
            Text="Какое из следующих слов не относится к двум другим?">
            <q:AnswersCollection>
                <q:Answer>«широкий»</q:Answer>
                <q:Answer>«зигзагообразный»</q:Answer>
                <q:Answer>«прямой»</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 180-->
        <q:Question 
            Text="«Скоро» так относится к «никогда», как «близко» относится к:">
            <q:AnswersCollection>
                <q:Answer>«нигде»</q:Answer>
                <q:Answer>«далеко»</q:Answer>
                <q:Answer>«где-то»</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 181-->
        <q:Question 
            Text="Если я невольно нарушил правила поведения, находясь в обществе, то я вскоре забываю об этом.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>иногда</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 182-->
        <q:Question 
            Text="Меня считают человеком, которому приходят в голову хорошие идеи, когда нужно разрешить какую-либо проблему.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 183-->
        <q:Question 
            Text="Я способен лучше проявить себя:">
            <q:AnswersCollection>
                <q:Answer>в трудных ситуациях, когда нужно сохранить самообладание</q:Answer>
                <q:Answer>трудно сказать</q:Answer>
                <q:Answer>когда требуется умение ладить с людьми</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 184-->
        <q:Question 
            Text="Меня считают человеком, полным энтузиазма.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 185-->
        <q:Question 
            Text="Мне нравится работа, которая требует перемен, разнообразия, командировок, даже если она связана с некоторой опасностью.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 186-->
        <q:Question 
            Text="Я довольно требовательный человек и всегда настаиваю на том, чтобы всё делалось по возможности правильно.">
            <q:AnswersCollection>
                <q:Answer>верно</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>неверно</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 187-->
        <q:Question 
            Text="Мне нравится работа, требующая добросовестности, точных навыков и умений.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>нечто среднее</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 188-->
        <q:Question 
            Text="Я отношусь к типу энергичных людей, которые всегда заняты.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

        <!--Вопрос 189-->
        <q:Question 
            Text="Я уверен в том, что на все вопросы ответил как следует.">
            <q:AnswersCollection>
                <q:Answer>да</q:Answer>
                <q:Answer>не уверен</q:Answer>
                <q:Answer>нет</q:Answer>
            </q:AnswersCollection>
        </q:Question>

    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Тест_Лири.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Вам предлагается тест, содержащий 128 утверждений.
            Внимательно прочитайте каждое утверждение и решите: верно («ДА»)
            или неверно («НЕТ») оно по отношению к Вам.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после
            наведения курсора на соответствующий ответ. При необходимости Вы
            можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих», отвечайте искренне.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту».
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:Тест_Лири x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Тест Лири"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question Text="Другие думают о Вас благосклонно."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question Text=" Производите впечатление на окружающих."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text=" Умеете распоряжаться, приказывать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text=" Умеете настоять на своём."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text=" Обладаете чувством достоинства."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text=" Независимы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text=" Способны сами позаботиться о себе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text=" Можете проявить безразличие."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text=" Способны быть суровым."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text=" Строгий, но справедливый."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text=" Можете быть искренним."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text=" Критичны к другим."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text=" Любите поплакаться."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text=" Часто печальны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text=" Способны проявлять недоверие."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text=" Часто разочаровываетесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text=" Способны быть критичными к себе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text=" Способны признать свою неправоту."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text=" Охотно подчиняетесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text=" Уступчивый."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question Text=" Благодарный."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question Text=" Восхищающийся, склонны к подражанию."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question Text=" Уважительны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question Text=" Ищущий одобрения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question Text=" Способны к сотрудничеству, взаимопомощи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question Text=" Стремитесь ужиться с другими."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question Text=" Дружелюбны, доброжелательны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question Text=" Внимательны, ласковы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question Text=" Деликатны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question Text=" Ободряющий."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question Text=" Отзывчивы к призывам о помощи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question Text=" Бескорыстны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question Text=" Способны вызывать восхищение."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question Text=" Пользуетесь у других уважением."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question Text=" Обладаете талантом руководителя."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question Text=" Любите ответственность."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question Text=" Уверены в себе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question Text=" Самоуверенны, напористы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question Text=" Деловиты, практичны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question Text=" Любите соревноваться."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question Text=" Стойки и круты, где надо."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question Text=" Неумолимы, но беспристрастны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question Text=" Раздражительны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question Text=" Открыты, прямолинейны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question Text=" Не терпите, чтобы Вами командовали."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question Text=" Скептичны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question Text=" На Вас трудно произвести впечатление."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question Text=" Обидчивы, щепетильны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question Text=" Легко смущаетесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question Text=" Не уверены в себе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question Text=" Уступчивы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question Text=" Скромны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question Text=" Часто прибегаете к помощи других."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question Text=" Очень почитаете авторитеты."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question Text=" Охотно принимаете советы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question Text=" Доверчивы и стремитесь радовать других."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question Text=" Всегда любезны в обхождении."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question Text=" Дорожите мнением окружающих."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question Text=" Общительны, уживчивы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question Text=" Добросердечны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question Text=" Добрый, вселяющий уверенность."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question Text=" Нежный, мягкосердечный."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question Text=" Любите заботиться о других."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question Text=" Бескорыстный, щедрый."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question Text=" Любите давать советы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question Text=" Производите впечатление значительности."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question Text=" Начальственно-повелительный."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question Text=" Властный."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question Text=" Хвастливый."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question Text=" Надменный, самодовольный."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question Text=" Думаете только о себе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 72-->
        <q:Question Text=" Хитрый, расчётливый."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 73-->
        <q:Question Text=" Нетерпимы к ошибкам других."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 74-->
        <q:Question Text=" Своекорыстны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 75-->
        <q:Question Text=" Откровенны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 76-->
        <q:Question Text=" Часто недружелюбны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 77-->
        <q:Question Text=" Озлоблены."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 78-->
        <q:Question Text=" Жалобщик."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 79-->
        <q:Question Text=" Ревнивы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 80-->
        <q:Question Text=" Долго помните обиды."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 81-->
        <q:Question Text=" Склонны к самобичеванию."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 82-->
        <q:Question Text=" Застенчивы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 83-->
        <q:Question Text=" Безынициативны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 84-->
        <q:Question Text=" Кроткий."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 85-->
        <q:Question Text=" Зависимы, несамостоятельны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 86-->
        <q:Question Text=" Любите подчиняться."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 87-->
        <q:Question Text=" Предоставляете другим принимать решения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 88-->
        <q:Question Text=" Легко попадаете впросак."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 89-->
        <q:Question Text=" Легко поддаетесь влиянию друзей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 90-->
        <q:Question Text=" Готовы довериться любому."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 91-->
        <q:Question Text=" Благорасположены ко всем без разбора."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 92-->
        <q:Question Text=" Всем симпатизируете."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 93-->
        <q:Question Text=" Прощаете всё."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 94-->
        <q:Question Text=" Переполнены чрезмерным сочувствием."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 95-->
        <q:Question Text=" Великодушны, терпимы к недостаткам."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 96-->
        <q:Question Text=" Стремитесь покровительствовать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 97-->
        <q:Question Text=" Стремитесь к успеху."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 98-->
        <q:Question Text=" Ожидаете восхищения от каждого."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 99-->
        <q:Question Text=" Распоряжаетесь другими."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 100-->
        <q:Question Text=" Деспотичны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 101-->
        <q:Question Text=" Сноб (судите о людях по рангу и достатку, а не по личным качествам)."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 102-->
        <q:Question Text=" Тщеславны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 103-->
        <q:Question Text=" Эгоистичны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 104-->
        <q:Question Text=" Холодный, чёрствый."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 105-->
        <q:Question Text=" Язвительны, насмешливы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 106-->
        <q:Question Text=" Злы, жестоки."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 107-->
        <q:Question Text=" Часто гневливы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 108-->
        <q:Question Text=" Бесчувственны, равнодушны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 109-->
        <q:Question Text=" Злопамятны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 110-->
        <q:Question Text=" Проникнуты духом противоречия."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 111-->
        <q:Question Text=" Упрямы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 112-->
        <q:Question Text=" Недоверчивы, подозрительны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 113-->
        <q:Question Text=" Робки."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 114-->
        <q:Question Text=" Стыдливы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 115-->
        <q:Question Text=" Отличаетесь чрезмерной готовностью подчиняться."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 116-->
        <q:Question Text=" Мягкотелы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 117-->
        <q:Question Text=" Почти никогда и никому не возражаете."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 118-->
        <q:Question Text=" Навязчивы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 119-->
        <q:Question Text=" Любите, чтобы Вас опекали."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 120-->
        <q:Question Text=" Чрезмерно доверчивы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 121-->
        <q:Question Text=" Стремитесь снискать расположение каждого."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 122-->
        <q:Question Text=" Со всеми соглашаетесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 123-->
        <q:Question Text=" Всегда дружелюбны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 124-->
        <q:Question Text=" Всех любите."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 125-->
        <q:Question Text=" Слишком снисходительны к окружающим."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 126-->
        <q:Question Text=" Стараетесь утешить каждого."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 127-->
        <q:Question Text=" Заботитесь о других в ущерб себе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 128-->
        <q:Question Text=" Портите людей чрезмерной добротой."
Answers="{ StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Тест_Люшера.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys"
                    xmlns:data="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Lusher.Data">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Сейчас на экране Вы увидите восемь цветных прямоугольников. 
            Вы должны выбрать прямоугольник с самым приятным цветом, 
            не соотнося его ни с представлениями об одежде (идёт ли к лицу), 
            ни с обивкой мебели, ни с чем-либо другим, а только сообразуясь с тем,
            насколько этот цвет предпочитаем в сравнении с другими при данном выборе и в данный момент.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Далее Вы должны выбрать прямоугольник с наиболее приятным цветом из оставшихся и так каждый раз,
            пока все прямоугольники не будут отобраны.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            После минутного перерыва повторите заново процесс выбора цветных прямоугольников.
            Главное при этом - не стараться вспомнить первоначальный выбор.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Выбор цветных прямоугольников производится с помощью «мыши».
        </Paragraph>
    </FlowDocument>


    <k:Тест_Люшера x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Тест Люшера"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <q:Question>
            <q:AnswersCollection>
                <data:LusherAnswer ColorNumber="0" Color="#FFACAEAB"/>
                <data:LusherAnswer ColorNumber="1" Color="#FF143A6B"/>
                <data:LusherAnswer ColorNumber="2" Color="#FF03A284"/>
                <data:LusherAnswer ColorNumber="3" Color="#FFE33625"/>
                <data:LusherAnswer ColorNumber="4" Color="#FFF5DE04"/>
                <data:LusherAnswer ColorNumber="5" Color="#FFD4026D"/>
                <data:LusherAnswer ColorNumber="6" Color="#FF944A2D"/>
                <data:LusherAnswer ColorNumber="7" Color="#FF040205"/>
            </q:AnswersCollection>
        </q:Question>

        <q:Question>
            <q:AnswersCollection>
                <data:LusherAnswer ColorNumber="0" Color="#FFACAEAB"/>
                <data:LusherAnswer ColorNumber="1" Color="#FF143A6B"/>
                <data:LusherAnswer ColorNumber="2" Color="#FF03A284"/>
                <data:LusherAnswer ColorNumber="3" Color="#FFE33625"/>
                <data:LusherAnswer ColorNumber="4" Color="#FFF5DE04"/>
                <data:LusherAnswer ColorNumber="5" Color="#FFD4026D"/>
                <data:LusherAnswer ColorNumber="6" Color="#FF944A2D"/>
                <data:LusherAnswer ColorNumber="7" Color="#FF040205"/>
            </q:AnswersCollection>
        </q:Question>
    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Тест_словесных_ассоциации.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Перед Вами на экране будут появляться слова.
            Эти же слова дублируются через динамики.
            Ваша задача на каждое предъявленное слово ответить в микрофон собственным словом,
            которое у вас ассоциируется с ним и которое первым пришло Вам на ум.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы поняли инструкцию, нажмите на чёрную кнопку пульта».
        </Paragraph>
    </FlowDocument>

    <k:Тест_словесных_ассоциации x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Тест словесных ассоциаций"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question Text="Власть"/>
        <q:Question Text="Алкоголь"/>
        <q:Question Text="Коллеги"/>
        <q:Question Text="Дисциплина"/>
        <q:Question Text="Отдых"/>
        <q:Question Text="Убийство"/>
        <q:Question Text="Одиночество"/>
        <q:Question Text="Печаль"/>
        <q:Question Text="Рождение"/>
        <q:Question Text="Работа"/>
        <q:Question Text="Подарок"/>
        <q:Question Text="Тревога"/>
        <q:Question Text="Авария"/>
        <q:Question Text="Путешествие"/>
        <q:Question Text="Болезнь"/>
        <q:Question Text="Любовь"/>
        <q:Question Text="Мама"/>
        <q:Question Text="Возраст"/>
        <q:Question Text="Ненависть"/>
        <q:Question Text="Жильё"/>
        <q:Question Text="Мужчина"/>
        <q:Question Text="Эгоист"/>
        <q:Question Text="Насилие"/>
        <q:Question Text="Горе"/>
        <q:Question Text="Свобода"/>
        <q:Question Text="Соседи"/>
        <q:Question Text="Закон"/>
        <q:Question Text="Холод"/>
        <q:Question Text="Эротика"/>
        <q:Question Text="Зеркало"/>
        <q:Question Text="Здоровье"/>
        <q:Question Text="Слава"/>
        <q:Question Text="Слабость"/>
        <q:Question Text="Вера"/>
        <q:Question Text="Религия"/>
        <q:Question Text="Пища"/>
        <q:Question Text="Женщина"/>
        <q:Question Text="Автомобиль"/>
        <q:Question Text="Ум"/>
        <q:Question Text="Замысел"/>
        <q:Question Text="Спорт"/>
        <q:Question Text="Семья"/>
        <q:Question Text="Деньги"/>
        <q:Question Text="Судьба"/>
        <q:Question Text="Вода"/>
        <q:Question Text="Наркотики"/>
        <q:Question Text="Отец"/>
        <q:Question Text="Секс"/>
        <q:Question Text="Фрукты"/>
        <q:Question Text="Боль"/>
        <q:Question Text="Успех"/>
        <q:Question Text="Труп"/>
        <q:Question Text="Праздник"/>
        <q:Question Text="Ребёнок"/>
        <q:Question Text="Смерть"/>
        <q:Question Text="Бумага"/>
        <q:Question Text="Песок"/>
        <q:Question Text="Здание"/>
        <q:Question Text="День"/>
        <q:Question Text="Оружие"/>
    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Тест_Спилбергера.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Вам будут показаны последовательно 40 утверждений. Для каждого утверждения Вы должны выбрать один из четырёх возможных вариантов ответов, наиболее подходящий по Вашему мнению.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Для утверждений с 1 по 20 варианты ответов: НЕТ, СКОРЕЕ НЕТ, СКОРЕЕ ДА, ДА. Для утверждений с 21 по 40 варианты ответов: ПОЧТИ НИКОГДА, ИНОГДА, ЧАСТО, ПОЧТИ ВСЕГДА.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения указателя на соответствующий ответ.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Старайтесь отвечать быстро, долго не раздумывая, поскольку особенно важна первая реакция. При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад»
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Внимательно читайте утверждения. Старайтесь пользоваться всем диапазоном возможных вариантов ответов».
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers1_20" x:Shared="False">
        <q:Answer>Нет</q:Answer>
        <q:Answer>Скорее нет</q:Answer>
        <q:Answer>Скорее да</q:Answer>
        <q:Answer>Да</q:Answer>
    </q:AnswersCollection>

    <q:AnswersCollection x:Key="Answers21_40" x:Shared="False">
        <q:Answer>Почти никогда</q:Answer>
        <q:Answer>Иногда</q:Answer>
        <q:Answer>Часто</q:Answer>
        <q:Answer>Почти всегда</q:Answer>
    </q:AnswersCollection>

    <k:Тест_Спилбергера x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Тест Спилбергера"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question Text="Я спокоен."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question Text=" Мне ничто не угрожает."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text=" Я нахожусь в напряжении."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text=" Я испытываю сожаление."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text=" Я чувствую себя свободно."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text=" Я расстроен."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text=" Меня волнуют возможные неудачи."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text=" Я чувствую себя отдохнувшим."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text=" Я встревожен."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text=" Я испытываю чувство внутреннего удовлетворения."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text=" Я уверен в себе."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text=" Я нервничаю."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text=" Я не нахожу себе места."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text=" Я взвинчен."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text=" Я не чувствую скованности, напряжённости."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text=" Я доволен."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text=" Я озабочен."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text=" Я слишком возбуждён и мне не по себе."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text=" Мне радостно."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text=" Мне приятно."
Answers="{ StaticResource Answers1_20}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question Text=" Я испытываю удовольствие."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question Text=" Я очень быстро устаю."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question Text=" Я легко могу заплакать."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question Text=" Я хотел бы быть таким же счастливым, как и другие."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question Text=" Нередко я проигрываю из-за того, что недостаточно быстро принимаю решение."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question Text=" Обычно я чувствую себя бодрым."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question Text=" Я спокоен, хладнокровен и собран."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question Text=" Ожидаемые трудности обычно очень тревожат меня."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question Text=" Я слишком переживаю из-за пустяков."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question Text=" Я вполне счастлив."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question Text=" Я принимаю все слишком близко к сердцу."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question Text=" Мне не хватает уверенности в себе."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question Text=" Обычно я чувствую себя в безопасности."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question Text=" Я стараюсь избегать критических ситуаций и трудностей."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question Text=" У меня бывает хандра."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question Text=" Я доволен."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question Text=" Всякие пустяки отвлекают и волнуют меня."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question Text=" Я так сильно переживаю свои разочарования, что потом долго не могу о них забыть."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question Text=" Я уравновешенный человек."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question Text=" Меня охватывает сильное беспокойство, когда я думаю о своих делах и заботах."
Answers="{ StaticResource Answers21_40}">
        </q:Question>
    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Тест_Томаса.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">

    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Вам будут представлены пары утверждений, которые помогут определить некоторые особенности Вашего 
            поведения. Вам предлагается выбрать один из двух вариантов ответов, который в большей степени 
            соответствует Вашим взглядам, Вашему мнению о себе.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующий 
            ответ. После сделанного выбора Вам будет показана очередная пара утверждений. При необходимости 
            Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих»: важно объективно оценивать свои ощущения или 
            представления о самом себе. Будьте искренними. Над ответами долго не задумывайтесь.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту.
        </Paragraph>
    </FlowDocument>

    <k:Тест_Томаса x:Key="Keys" x:Shared="False" />

    <Style x:Key="AnswerStyle" TargetType="{x:Type TextBlock}">
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="Width" Value="600" />
        <Setter Property="Height" Value="100" />
        <Setter Property="FontSize" Value="22" />
        <Setter Property="FontWeight" Value="Bold" />
    </Style>

    <q:Questionnaire
        x:Key="Test"
        Title="Тест Томаса"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Иногда я предоставляю возможность другим взять на себя ответственность за решение спорного вопроса
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Чем обсуждать, в чём мы расходимся, я стараюсь обратить внимание на то, с чем мы оба согласны
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 2-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь найти компромиссное решение
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я пытаюсь уладить дело с учётом всех интересов другого и моих собственных
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Обычно я настойчиво стремлюсь добиться своего
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь успокоить другого и, главным образом, сохранить наши отношения
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь найти компромиссное решение
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Иногда я жертвую своими собственными интересами ради интересов другого человека
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Улаживая спорную ситуацию, я всё время стараюсь найти поддержку у другого
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь сделать всё, чтобы избежать бесполезной напряжённости
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я пытаюсь избежать неприятностей для себя
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь добиться своего
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь отложить решение спорного вопроса с тем, чтобы со временем решить его окончательно
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я считаю возможным в чём-то уступить, чтобы добиться другого
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Обычно я настойчиво стремлюсь добиться своего
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я первым делом стараюсь ясно определить то, в чём состоят все затронутые интересы
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Думаю, что не всегда стоит волноваться из-за каких-то возникающих разногласий
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я прилагаю усилия, чтобы добиться своего
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я твёрдо стремлюсь достичь своего
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я пытаюсь найти компромиссное решение
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Первым делом я стараюсь ясно определить, в чём состоят все затронутые спорные вопросы
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь успокоить другого и, главным образом, сохранить наши отношения
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Зачастую я избегаю занимать позицию, которая может вызвать споры
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я даю возможность другому в чём-то остаться при своём мнении, если он тоже идёт навстречу мне
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я предлагаю среднюю позицию
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я настаиваю, чтобы было сделано по-моему
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я сообщаю другому свою точку зрения и спрашиваю о его взглядах
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я пытаюсь показать другому логику и преимущества моих взглядов
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь успокоить другого и, главным образом, сохранить наши отношения
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь сделать так, чтобы избежать напряжённости
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь не задеть чувств другого
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я пытаюсь убедить другого в преимуществах моей позиции
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Обычно я настойчиво стараюсь добиться своего
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь сделать всё, чтобы избежать бесполезной напряжённости
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Если это сделает другого счастливым, дам ему возможность настоять на своём
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я даю возможность другому в чём-то остаться при своём мнении, если он также идёт мне навстречу
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Первым делом я стараюсь ясно определить то, в чём состоят все затронутые вопросы и интересы
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь отложить решение спорного вопроса с тем, чтобы со временем решить его окончательно
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я пытаюсь немедленно преодолеть наши разногласия
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь найти наилучшее сочетание выгод и потерь для обеих сторон
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 21-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Ведя переговоры, я стараюсь быть внимательным к желаниям другого
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я всегда склоняюсь к прямому обсуждению проблемы и их совместному решению
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 22-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я пытаюсь найти позицию, которая находится посередине между моей позицией и точкой зрения другого человека
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я отстаиваю свои желания
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 23-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Как правило, я озабочен тем, чтобы удовлетворить желания каждого из нас
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Иногда я предоставляю возможность другим взять на себя ответственность за решение спорного вопроса
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 24-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Если позиция другого кажется мне очень важной, я постараюсь пойти навстречу его желаниям
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь убедить другого прийти к компромиссу
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 25-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я пытаюсь показать другому логику и преимущества моих взглядов
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Ведя переговоры, я стараюсь быть внимательным к желаниям другого
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 26-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я предлагаю среднюю позицию
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я почти всегда озабочен тем, чтобы удовлетворить желания каждого из нас
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 27-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Зачастую я избегаю занимать позицию, которая может вызвать споры
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Если это сделает другого счастливым, я дам ему возможность настоять на своём
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 28-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Обычно я настойчиво стремлюсь добиться своего
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Улаживая ситуацию, я обычно стараюсь найти поддержку у другого
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 29-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я предлагаю среднюю позицию
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Думаю, что не всегда стоит волноваться из-за каких-то возникающих разногласий
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
        <!--Вопрос 30-->
        <q:Question Text="Выберите одно из двух утверждений">
            <q:Question.Answers>
                <q:AnswersCollection>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я стараюсь не задеть чувств другого
                        </TextBlock>
                    </q:Answer>
                    <q:Answer>
                        <TextBlock Style="{StaticResource AnswerStyle}">
                            Я всегда занимаю такую позицию в спорном вопросе, чтобы мы совместно с другим человеком могли добиться успеха
                        </TextBlock>
                    </q:Answer>
                </q:AnswersCollection>
            </q:Question.Answers>
        </q:Question>
    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Уровень_субъективного_контроля.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Вам предлагается тест, содержащий 44 утверждения. Внимательно
            прочитайте каждое утверждение и решите: согласны или не согласны Вы с
            ними. Оценивайте степень своего согласия или несогласия с помощью
            следующих ответов:
        </Paragraph>
        <List MarkerStyle="Circle" Margin="0">
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    согласен полностью
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    согласен частично
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    скорее согласен, чем не согласен
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    затрудняюсь ответить
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    скорее не согласен, чем согласен
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    не согласен частично
                </Paragraph>
            </ListItem>
            <ListItem Margin="0,10,0,5">
                <Paragraph>
                    не согласен полностью
                </Paragraph>
            </ListItem>
        </List>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после
            наведения курсора на соответствующий ответ. При необходимости Вы
            можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Помните, что нет ответов «хороших» или «плохих», отвечайте искренне.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вы хорошо поняли инструкцию, приступайте к тесту».
        </Paragraph>
    </FlowDocument>
    
    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>согласен полностью</q:Answer>
        <q:Answer>согласен частично</q:Answer>
        <q:Answer>скорее согласен, чем не согласен</q:Answer>
        <q:Answer>затрудняюсь ответить</q:Answer>
        <q:Answer>скорее не согласен, чем согласен</q:Answer>
        <q:Answer>не согласен частично</q:Answer>
        <q:Answer>не согласен полностью</q:Answer>
    </q:AnswersCollection>

    <k:Уровень_субъективного_контроля x:Key="Keys" x:Shared="False" />

    <q:Questionnaire
        x:Key="Test"
        Title="Уровень субъективного контроля"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question Text="Продвижение по службе больше зависит от удачного обстоятельства, чем от способностей и усилий человека."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question Text="Большинство разводов происходит оттого, что люди не захотели приспособиться друг к другу."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text="Болезнь – дело случая; если уж суждено заболеть, то ничего не поделаешь."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text="Люди оказываются одинокими из-за того, что сами не проявляют интереса и дружелюбия к окружающим."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text="Осуществление моих желаний часто зависит от везения."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text="Бесполезно предпринимать усилия для того, чтобы завоевать симпатию других людей."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text="Внешние обстоятельства — родители и благосостояние — влияют на семейное счастье не меньше, чем отношения супругов."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text="Я часто чувствую, что мало влияю на то, что происходит со мной."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text="Как правило, руководство оказывается более эффективным, когда полностью контролируются действия подчиненных, а не полагаются на их самостоятельность."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text="Мои отметки и школе чаще зависели от случайных обстоятельств (например, от настроения учителя), чем от моих собственных усилий."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text="Когда я строю планы, то я, в общем, верю, что смогу осуществить их."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text="То, что многим людям кажется удачей или везением, на самом деле является результатом долгих целенаправленных усилий."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text="Думаю, что правильный образ жизни может больше помочь здоровью, чем врачи и лекарства."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text="Если люди не подходят друг другу, то, как бы они ни старались, наладить семейную жизнь они все равно не смогут."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text="То хорошее, что я делаю, обычно бывает по достоинству оценено другими."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text="Дети вырастают такими, какими их воспитывают родители."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text="Думаю, что случаи или судьба не играют важной роли в моей жизни."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text="Я стараюсь не планировать далеко вперед, потому что многое зависит от того, как сложатся обстоятельства."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text="Мои отметки в школе больше всего зависели от моих усилий и степени подготовленности."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text="В семенных конфликтах я чаще чувствую вину за собой, чем за противоположной стороной."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question Text="Жизнь большинства людей зависит от стечения обстоятельств."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question Text="Я предпочитаю такое руководство, при котором можно самостоятельно определять, что и как делать."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question Text="Думаю, что мой образ жизни ни в коей мере не является причиной моей болезни или болезней."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question Text="Как правило, именно неудачное стечение обстоятельств мешает людям добиться успеха в своем деле."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question Text="В конце концов, за плохое управление организацией ответственны сами люди, которые в ней работают."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question Text="Я часто думаю, что ничего не могу изменить в сложившихся отношениях в семье."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question Text="Если я очень захочу, то смогу расположить к себе почти любого."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question Text="На подрастающее поколение влияет так много разных обстоятельств, что усилия родителей по воспитанию детей часто оказываются бесполезными."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question Text="То, что со мной случается, — это дело моих собственных рук."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question Text="Трудно бывает понять, почему руководители поступают так, а не иначе."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question Text="Человек, который не смог добиться успеха в своей работе, скорее всего не проявил достаточно усилий."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question Text="Чаще всего я могу добиться от членов моей семьи того, что я хочу."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question Text="В неприятностях и неудачах, которые были в моей жизни, чаще всего были виноваты другие люди, чем я сам."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question Text="Ребенка всегда можно уберечь от простуды, если за ним следить и правильно его одевать."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question Text="В сложных обстоятельствах я предпочитаю подождать, пока проблемы разрешатся сами собой."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question Text="Успех является результатом упорной работы и мало зависит от случая или везения."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question Text="Я чувствую, что от меня больше, чем от кого бы то ни было, зависит счастье моей семьи."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question Text="Мне всегда трудно было понять, почему я нравлюсь одним людям и не нравлюсь другим."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question Text="Я всегда предпочитаю принять решение и действовать самостоятельно, а не надеяться на помощь других людей или на судьбу."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question Text="К сожалению, заслуги человека остаются непризнанными, несмотря на все его старания."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question Text="В семейной жизни бывают такие ситуации, которые невозможно разрешить даже при самом сильном желании."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question Text="Способные люди, не сумевшие реализовать свои возможности, должны винить в этом только самих себя."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question Text="Многие мои успехи были возможны только благодаря помощи других людей."
                    Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question Text="Большинство неудач в моей жизни произошло от неумения, незнания или лени и мало зависело от везения или невезения."
                    Answers="{ StaticResource Answers}">
        </q:Question>
    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Уровень_тревожности_по_Тейлору.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Прочитайте внимательно каждое из приведённых ниже утверждений и нажмите кнопку "ДА",
            если утверждение относится к Вам, или нажмите "НЕТ", если оно к Вам не относится.
            В случае затруднений при выборе варианта ответа ориентируйтесь на частоту повторяемости
            подобных переживаний "Скорее ДА" или "Скорее НЕТ".
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения указателя на соответствующий ответ».
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:Уровень_тревожности_по_Тейлору x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Уровень тревожности по Тейлору"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">
        <!--Вопрос 1-->
        <q:Question Text="Обычно я спокоен и вывести меня из себя нелегко."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question Text=" Мои нервы расстроены не более, чем у других людей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text=" У меня редко бывают запоры."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text=" У меня редко бывают головные боли."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text=" Я редко устаю."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text=" Я почти всегда чувствую себя вполне счастливым."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text=" Я уверен в себе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text=" Практически я никогда не краснею."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text=" По сравнению с моими друзьями я считаю себя вполне смелым человеком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text=" Я краснею не чаще, чем другие."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text=" У меня редко бывают сердцебиение и одышка."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text=" Обычно мои руки и ноги достаточно тёплые."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text=" Я застенчив не более, чем другие."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text=" Мне не хватает уверенности в себе."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text=" Порой мне кажется, что я ни на что не годен."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text=" У меня бывают периоды такого беспокойства, что я не могу усидеть на месте."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text=" Мой желудок сильно беспокоит меня."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text=" У меня не хватает духа вынести все предстоящие трудности."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text=" Я хотел бы быть таким же счастливым, как другие."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text=" Мне кажется порой, что передо мной нагромождены такие трудности, которые мне не преодолеть."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question Text=" Мне нередко снятся кошмарные сны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question Text=" Я замечаю, что мои руки начинают дрожать, когда я пытаюсь что-либо сделать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question Text=" У меня чрезвычайно беспокойный и прерывистый сон."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question Text=" Меня весьма тревожат возможные неудачи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question Text=" Мне приходилось испытывать страх в тех случаях, когда я точно знал, что мне ничего не угрожает."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question Text=" Мне трудно сосредоточиться на работе или на каком-либо задании."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question Text=" Я работаю с большим напряжением."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question Text=" Я легко прихожу в замешательство."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question Text=" Почти всё время я испытываю тревогу из-за кого-нибудь или чего-нибудь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question Text=" Я склонен принимать всё слишком всерьез."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question Text=" Я часто плачу, у меня глаза &quot;на мокром месте&quot;."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question Text=" Меня нередко мучают приступы рвоты и тошноты."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question Text=" Раз в месяц у меня бывает расстройство стула (или чаще)."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question Text=" Я часто боюсь, что вот-вот покраснею."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question Text=" Мне очень трудно сосредоточиться на чём-либо."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question Text=" Моё материальное положение весьма беспокоит меня."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question Text=" Нередко я думаю о таких вещах, о которых ни с кем не хотелось бы говорить."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question Text=" У меня бывали периоды, когда тревога лишала меня сна."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question Text=" Временами, когда я нахожусь в замешательстве, у меня появляется сильная потливость и это чрезвычайно смущает меня."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question Text=" Даже в холодные дни я легко потею."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question Text=" Временами я становлюсь таким возбуждённым, что мне трудно заснуть."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question Text=" Я - человек легко возбудимый."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question Text=" Временами я чувствую себя совершенно бесполезным."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question Text=" Порой мне кажется, что моя нервная система расшатана и я вот-вот выйду из себя."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question Text=" Я часто ловлю себя на том, что меня что-то тревожит."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question Text=" Я гораздо чувствительнее, чем большинство людей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question Text=" Я почти всё время испытываю чувство голода."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question Text=" Иногда я расстраиваюсь из-за пустяков."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question Text=" Жизнь для меня всегда связана с необычным напряжением."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question Text=" Ожидание всегда нервирует меня."
Answers="{ StaticResource Answers}">
        </q:Question>


    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Ценностные_ориентации_Рокич.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys"
                    xmlns:data="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Rokich.Data">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            «Сейчас Вам будут предъявлены списки общечеловеческих ценностей (два списка по 18 в каждом).
            Ваша задача - ранжировать их по порядку значимости для Вас как принципов, которыми Вы руководствуетесь в Вашей жизни.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Внимательно изучите все утверждения и, выбрав то, которое для Вас наиболее значимо, поместите его на первое место.
            Это делается следующим образом.
            После того, как Вы определились со своим выбором,
            наведите указатель «мыши» на это утверждение и однократно щёлкните левой клавишей. 
            В столбце «Ранг ценности» появится выдвигающийся список с номерами (от 1 до 18).
            Для того, чтобы он открылся, однократно щёлкните на нём.
            В открывшемся списке номеров с помощью курсора выберите №1 и однократно щёлкните левой клавишей.
            Выбранное под №1 утверждение автоматически перемещается в верхнюю позицию списка после того,
            как Вы перейдёте к выбору ценности №2
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Выберите вторую по значимости для Вас ценность и выполните аналогичные действия,
            после чего она разместится в списке вслед за первой.
            Затем проделайте то же со всеми оставшимися утверждениями.
            Наименее важная ценность останется последней и займет 18 место.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Если Вам будет необходимо изменить ранг какой-то уже выбранной ценности, 
            то щёлкните на ней и из списка номеров выберите ячейку без номера (она находится в конце списка).
            После этого выберите тот номер, который соответствует рангу этой ценности.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Для завершения ранжирования ценностей первого списка, 
            после ввода числа 18 второй раз щёлкните левой клавишей на этом утверждении, а затем нажмите кнопку «Закончить»,
            и Вам будет предложено проделать аналогичную работу со вторым списком.
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Работайте не спеша, вдумчиво. Если в процессе работы Вы измените свое мнение,
            то можете исправить свои ответы, щёлкнув на соответствующем утверждении и списке номеров.
            Конечный результат должен отражать Вашу истинную позицию».
        </Paragraph>
    </FlowDocument>

    <k:Ценностные_ориентации_Рокич x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="Ценностные ориентации"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question>
            <q:AnswersCollection>
                <data:RokichAnswer Number="1">активная деятельная жизнь (полнота и эмоциональная насыщенность жизни)</data:RokichAnswer>
                <data:RokichAnswer Number="2">жизненная мудрость (зрелость суждений и здравый смысл, достигаемые жизненным опытом)</data:RokichAnswer>
                <data:RokichAnswer Number="3">здоровье (физическое и психическое)</data:RokichAnswer>
                <data:RokichAnswer Number="4">интересная работа</data:RokichAnswer>
                <data:RokichAnswer Number="5">красота природы и искусства (переживание прекрасного в природе и в искусстве)</data:RokichAnswer>
                <data:RokichAnswer Number="6">любовь (духовная и физическая близость с любимым человеком)</data:RokichAnswer>
                <data:RokichAnswer Number="7">материально обеспеченная жизнь (отсутствие материальных затруднений)</data:RokichAnswer>
                <data:RokichAnswer Number="8">наличие хороших и верных друзей</data:RokichAnswer>
                <data:RokichAnswer Number="9">общественное признание (уважение окружающих, коллектива, товарищей по работе)</data:RokichAnswer>
                <data:RokichAnswer Number="10">познание (возможность расширения своего образования, кругозора, общей культуры, интеллектуальное развитие)</data:RokichAnswer>
                <data:RokichAnswer Number="11">продуктивная жизнь (максимально полное использование своих возможностей, сил и способностей)</data:RokichAnswer>
                <data:RokichAnswer Number="12">развитие (работа над собой, постоянное физическое и духовное совершенствование)</data:RokichAnswer>
                <data:RokichAnswer Number="13">развлечения (приятное, необременительное времяпрепровождение, отсутствие обязанностей)</data:RokichAnswer>
                <data:RokichAnswer Number="14">свобода (самостоятельность, независимость в суждениях поступках)</data:RokichAnswer>
                <data:RokichAnswer Number="15">счастливая семейная жизнь</data:RokichAnswer>
                <data:RokichAnswer Number="16">счастье других (благосостояние, развитие и совершенствование других людей, всего народа, человечества в целом)</data:RokichAnswer>
                <data:RokichAnswer Number="17">творчество (возможность творческой деятельности)</data:RokichAnswer>
                <data:RokichAnswer Number="18">уверенность в себе (внутренняя гармония, свобода от внутренних противоречий, сомнений)</data:RokichAnswer>
            </q:AnswersCollection>
        </q:Question>
        
        <!--Вопрос 2-->
        <q:Question>
            <q:AnswersCollection>
                <data:RokichAnswer Number="1">аккуратность (чистоплотность), умение содержать в порядке вещи, порядок в делах</data:RokichAnswer>
                <data:RokichAnswer Number="2">воспитанность (хорошие манеры)</data:RokichAnswer>
                <data:RokichAnswer Number="3">высокие запросы (высокие требования к жизни и высокие притязания)</data:RokichAnswer>
                <data:RokichAnswer Number="4">жизнерадостность (чувство юмора)</data:RokichAnswer>
                <data:RokichAnswer Number="5">исполнительность (дисциплинированность)</data:RokichAnswer>
                <data:RokichAnswer Number="6">независимость (способность действовать самостоятельно, решительно)</data:RokichAnswer>
                <data:RokichAnswer Number="7">непримиримость к недостаткам в себе и других</data:RokichAnswer>
                <data:RokichAnswer Number="8">образованность (широта знаний, высокая общая культура)</data:RokichAnswer>
                <data:RokichAnswer Number="9">ответственность (чувство долга, умение держать свое слово)</data:RokichAnswer>
                <data:RokichAnswer Number="10">рационализм (умение здраво и логично мыслить, принимать обдуманные, рациональные решения)</data:RokichAnswer>
                <data:RokichAnswer Number="11">самоконтроль (сдержанность, самодисциплина)</data:RokichAnswer>
                <data:RokichAnswer Number="12">смелость в отстаиваниях своего мнения, взглядов</data:RokichAnswer>
                <data:RokichAnswer Number="13">твердая воля (умение настоять на своем, не отступать перед трудностями)</data:RokichAnswer>
                <data:RokichAnswer Number="14">терпимость (к взглядам и мнениям других, умение прощать другим их ошибки и заблуждения)</data:RokichAnswer>
                <data:RokichAnswer Number="15">широта взглядов (умение понять чужую точку зрения, уважать иные вкусы, обычаи, привычки)</data:RokichAnswer>
                <data:RokichAnswer Number="16">честность (правдивость, искренность)</data:RokichAnswer>
                <data:RokichAnswer Number="17">эффективность в делах (трудолюбие, продуктивность в работе)</data:RokichAnswer>
                <data:RokichAnswer Number="18">чуткость (заботливость)</data:RokichAnswer>
            </q:AnswersCollection>
        </q:Question>
    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Resources\Questionnaires\Шмишек_Леонгард.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:q="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data"
                    xmlns:k="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Data.Keys">
    <FlowDocument 
        x:Key="Instruction"
        x:Shared="False"
        FontSize="18">
        <Paragraph 
            TextAlignment="Center" 
            FontSize="24" 
            FontWeight="Bold">
            Инструкция к тесту
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            “Вам предлагается ответить на 97 вопросов, касающихся различных сторон Вашей личности.
            Прочитайте внимательно каждый из них и постарайтесь решить, соответствует или нет то,
            о чем спрашивается, каким-то особенностям Вашего поведения, отдельным поступкам,
            переживаниям, взглядам на жизнь и т.п. Выберите свой вариант ответа: «ДА» или «НЕТ».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Свой выбор производите нажатием на левую кнопку «мыши» после наведения курсора на соответствующий ответ.
            При необходимости Вы можете вернуться к предыдущему вопросу, нажав на кнопку «Назад».
        </Paragraph>
        <Paragraph 
            TextIndent="20">
            Не стоит долго задумываться над вопросами, постарайтесь как можно быстрее решить, какой из двух ответов,
            пусть даже относительно, но все-таки кажется Вам ближе к истине.
            Пожалуйста, помните, что ни один ответ не оценивается как хороший или плохой”.
        </Paragraph>
    </FlowDocument>

    <q:AnswersCollection x:Key="Answers" x:Shared="False">
        <q:Answer>Да</q:Answer>
        <q:Answer>Нет</q:Answer>
    </q:AnswersCollection>

    <k:Шмишек_Леонгард x:Key="Keys" x:Shared="False"/>

    <q:Questionnaire
        x:Key="Test"
        Title="ОПРОСНИК ЛЕОНГАРДА-ШМИШЕКА"
        Instruction="{StaticResource Instruction}"
        Keys="{StaticResource Keys}">

        <!--Вопрос 1-->
        <q:Question Text="Можно ли сказать, что Ваше настроение, как правило, является веселым и беззаботным."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 2-->
        <q:Question Text="  Восприимчивы ли Вы к обидам."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 3-->
        <q:Question Text="  Правда ли, что в некоторых ситуациях Вы быстро начинаете плакать."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 4-->
        <q:Question Text="  Возникает ли у Вас по окончании какой-либо работы сомнение в качестве ее исполнения и желание проверить, правильно ли Вы ее сделали."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 5-->
        <q:Question Text="  Считаете ли Вы себя более смелым, чем были в детском возрасте."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 6-->
        <q:Question Text="  Может ли Ваше настроение быстро меняться от глубокой радости до глубокой грусти, печали."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 7-->
        <q:Question Text="  Можно ли сказать, что в обществе, в компании Вы обычно являетесь центром внимания."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 8-->
        <q:Question Text="  Бывают ли дни, когда Вы без особых причин находитесь в угрюмом, раздражительном настроении и ни с кем не хотите общаться."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 9-->
        <q:Question Text="  Всегда ли Вы отвечаете на письма сразу после их прочтения."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 10-->
        <q:Question Text="  Серьезный ли Вы человек."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 11-->
        <q:Question Text="  Способны ли Вы так сильно увлечься чем-то, что все остальное перестает быть значимым для Вас."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 12-->
        <q:Question Text="  Можно ли сказать, что Вы предприимчивый человек."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 13-->
        <q:Question Text="  Быстро ли Вы забываете обиды."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 14-->
        <q:Question Text="  Мягкосердечный ли Вы человек."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 15-->
        <q:Question Text="  Когда Вы бросили письмо в почтовый ящик, то проверяете ли, чтобы оно не осталось висеть в прорези."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 16-->
        <q:Question Text="  Требует ли Ваше честолюбие того, чтобы в работе (в учебе) Вы были одним из первых."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 17-->
        <q:Question Text="  Испытывали ли Вы в детстве страх перед грозой или собаками."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 18-->
        <q:Question Text="  Бывает ли иногда, что Вы смеетесь над неприличными анекдотами, шутками."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 19-->
        <q:Question Text="  Есть ли среди Ваших знакомых люди, которые считают Вас &quot;педантичным&quot; человеком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 20-->
        <q:Question Text="  Сильно ли зависит Ваше настроение от внешних событий."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 21-->
        <q:Question Text="  Правда ли, что Вас любят все Ваши знакомые."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 22-->
        <q:Question Text="  Часто ли Вы находитесь во власти сильных внутренних порывов, побуждений, страстных стремлений."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 23-->
        <q:Question Text="  Часто ли Ваше настроение бывает подавленным."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 24-->
        <q:Question Text="  Случалось ли Вам рыдать, переживая сильное нервное потрясение."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 25-->
        <q:Question Text="  Трудно ли Вам долго сидеть на одном месте."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 26-->
        <q:Question Text="  Правда ли, что Вы всегда энергично отстаиваете свои интересы, если кто-то поступает с Вами несправедливо."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 27-->
        <q:Question Text="  Хвастливы ли Вы иногда."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 28-->
        <q:Question Text="  Смогли бы Вы в случае необходимости зарезать домашнее животное или птицу."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 29-->
        <q:Question Text="  Раздражает ли Вас косо висящая гардина или неровно постеленная скатерть настолько, что Вам хочется немедленно устранить все эти недостатки."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 30-->
        <q:Question Text="  Испытывали ли Вы в детстве страх, когда приходилось оставаться дома одному."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 31-->
        <q:Question Text="  Часто ли портится Ваше настроение без видимых причин."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 32-->
        <q:Question Text="  Всегда ли Вы старательно и добросовестно относитесь к своей деятельности, стремясь быть одним из первых в своем деле."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 33-->
        <q:Question Text="  Легко ли Вы можете разгневаться."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 34-->
        <q:Question Text="  Можете ли Вы быть иногда беззаботно веселым."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 35-->
        <q:Question Text="  Бывают ли у Вас периоды, когда Вы переполнены радостью, счастьем."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 36-->
        <q:Question Text="  Способны ли Вы исполнять роль распорядителя при проведении увеселительных мероприятий."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 37-->
        <q:Question Text="  Лгали ли Вы когда-нибудь в своей жизни."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 38-->
        <q:Question Text="  Высказываете ли Вы обычно прямо в глаза окружающим свое откровенное мнение по какому-либо вопросу."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 39-->
        <q:Question Text="  Можете ли Вы достаточно спокойно переносить вид крови."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 40-->
        <q:Question Text="  Охотно ли Вы занимаетесь деятельностью, которая требует большой ответственности."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 41-->
        <q:Question Text="  Склонны ли Вы заступаться за людей, по отношению которых допущена несправедливость."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 42-->
        <q:Question Text="  Беспокоит ли Вас необходимость спуститься в темный подвал, зайти в пустую темную комнату."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 43-->
        <q:Question Text="  Способны ли Вы выполнять кропотливую черновую работу также тщательно, как и любимое Вами дело."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 44-->
        <q:Question Text="  Являетесь ли Вы общительным человеком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 45-->
        <q:Question Text="  Охотно ли Вы в школе декламировали стихи."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 46-->
        <q:Question Text="  Случалось ли Вам в детстве убегать из дома."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 47-->
        <q:Question Text="  Правда ли, что Вы всегда без малейших колебаний уступаете место в автобусе престарелым людям."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 48-->
        <q:Question Text="  Часто ли жизнь кажется Вам тяжелой."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 49-->
        <q:Question Text="  Случалось ли Вам так расстраиваться из-за какой-либо ссоры или конфликта, что Вы чувствовали себя не в состоянии пойти на работу (учебу)."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 50-->
        <q:Question Text="  Можно ли сказать, что при неудачах Вы не теряете чувства юмора."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 51-->
        <q:Question Text="  Делаете ли Вы первый шаг к примирению, если Вас кто-то обидел."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 52-->
        <q:Question Text="  Любите ли Вы животных."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 53-->
        <q:Question Text="  Случалось ли Вам, уйдя из дома, возвращаться, чтобы проверить, все ли в порядке, не произошло ли чего-нибудь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 54-->
        <q:Question Text="  Беспокоят ли Вас иногда неопределенные мысли о том, что с Вами или с Вашими близкими случится какое-нибудь несчастье."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 55-->
        <q:Question Text="  Считаете ли Вы, что Ваше настроение сильно зависит от погоды."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 56-->
        <q:Question Text="  Трудно ли Вам выступать перед большой аудиторией слушателей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 57-->
        <q:Question Text="  Можете ли Вы выйти из себя и дать волю рукам, если Вас кто-либо очень рассердит."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 58-->
        <q:Question Text="  Правда ли, что Вы очень любите повеселиться в компании."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 59-->
        <q:Question Text="  Всегда ли Вы говорите то, что действительно думаете."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 60-->
        <q:Question Text="  Можете ли Вы под влиянием разочарования впасть в отчаяние, в депрессию."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 61-->
        <q:Question Text="  Нравится ли Вам работа организаторского характера."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 62-->
        <q:Question Text="  Упорно ли Вы стремитесь к своей цели, даже если на пути встречается много препятствий."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 63-->
        <q:Question Text="  Чувствовали ли Вы когда-нибудь удовлетворение, если с людьми, которые Вам неприятны, случались неприятности."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 64-->
        <q:Question Text="  Может ли трагический фильм взволновать Вас настолько, что на глазах выступят слезы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 65-->
        <q:Question Text="  Часто ли Вам мешают заснуть мысли о проблемах прошедшего или будущего дня."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 66-->
        <q:Question Text="  Свойственно ли Вам было в школьные годы пользоваться подсказками или списывать у товарищей домашние задания."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 67-->
        <q:Question Text="  Смогли бы Вы при необходимости пройти ночью через кладбище."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 68-->
        <q:Question Text="  Верно ли, что Вы без малейших колебаний вернули бы лишние деньги в кассу, если бы обнаружили, что получили слишком много."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 69-->
        <q:Question Text="  Следите ли Вы с большим вниманием за тем, чтобы в Вашем доме каждая вещь лежала на своем месте."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 70-->
        <q:Question Text="  Случалось ли, что, ложась спать в хорошем настроении, Вы просыпались утром в удрученном состоянии, которое сохранялось в течение нескольких часов."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 71-->
        <q:Question Text="  Легко ли Вы приспосабливаетесь к новой ситуации."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 72-->
        <q:Question Text="  Часто ли у Вас бывают головные боли."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 73-->
        <q:Question Text="  Часто ли Вы смеетесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 74-->
        <q:Question Text="  Можете ли Вы так вежливо и приветливо вести себя с человеком, который Вам не нравится, что никто никогда не догадается о Вашем действительном отношении."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 75-->
        <q:Question Text="  Можно ли Вас назвать энергичным, подвижным человеком."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 76-->
        <q:Question Text="  Правда ли, что Вы сильно страдаете, когда совершается несправедливость."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 77-->
        <q:Question Text="  Можно ли Вас назвать страстным любителем природы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 78-->
        <q:Question Text="  Есть ли у Вас привычка проверять перед сном или перед тем, как уйти из дома, выключен ли газ или свет, заперта ли дверь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 79-->
        <q:Question Text="  Пугливы ли Вы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 80-->
        <q:Question Text="  Меняется ли Ваше настроение под влиянием алкоголя."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 81-->
        <q:Question Text="  Охотно ли Вы участвовали в юности (или участвуете теперь) в кружках художественной самодеятельности, в театральном кружке."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 82-->
        <q:Question Text="  Бывает ли, что Вас иногда очень тянет уехать далеко от дома."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 83-->
        <q:Question Text="  Смотрите ли Вы на будущее немного пессимистично."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 84-->
        <q:Question Text="  Может ли Ваше настроение за короткий период измениться от высочайшей радости до глубокой тоски."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 85-->
        <q:Question Text="  Удается ли Вам при общении с людьми создавать у них определенное настроение."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 86-->
        <q:Question Text="  Правда ли, что обычно Вы долго храните чувство гнева, досады."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 87-->
        <q:Question Text="  Сильно ли Вы переживаете горести и неприятности других людей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 88-->
        <q:Question Text="  Можно ли сказать, что Вы всегда соглашаетесь с замечаниями в свой адрес, справедливость которых признаете."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 89-->
        <q:Question Text="  Была ли у Вас в школе привычка переписывать страницу в тетради, если Вы поставили на него кляксу или сделали ошибку."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 90-->
        <q:Question Text="  Можно ли сказать, что по отношению к окружающим Вы скорее осторожны и недоверчивы, нежели доверчивы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 91-->
        <q:Question Text="  Часто ли Вы видите страшные сны."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 92-->
        <q:Question Text="  Возникали ли у Вас иногда мысли против воли броситься из окна, под приближающийся поезд."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 93-->
        <q:Question Text="  Легко ли поднимается Ваше настроение в обществе веселых людей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 94-->
        <q:Question Text="  Правда ли, что Вы легко можете отвлечься от гнетущих Вас проблем, от тяжелых мыслей."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 95-->
        <q:Question Text="  Трудно ли Вам сдержать себя, если Вы разозлитесь."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 96-->
        <q:Question Text="  Действительно ли Вы в беседе скорее молчаливы, чем словоохотливы."
Answers="{ StaticResource Answers}">
        </q:Question>
        <!--Вопрос 97-->
        <q:Question Text="  Могли бы Вы, изображая кого-нибудь, с полным проникновением и перевоплощением войти в роль настолько, что на время позабыть о том, какой Вы на самом деле."
Answers="{ StaticResource Answers}">
        </q:Question>

    </q:Questionnaire>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\AccurateEye.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:01:20","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"_t_Tick","Type":null,"ID":"CallingMethod_1f67e302-c1b6-4e23-a778-9c042c7cf03c","ToolName":"CallingMethod","From":"00:00:23.1510000","To":"00:00:23.6610000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StartDraw","Type":null,"ID":"CallingMethod_d47d8d5c-74b7-4ad5-8901-445eff19a7e9","ToolName":"CallingMethod","From":"00:00:23.7190000","To":"00:00:23.9960000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.0500000","MethodName":"_timer_Tick","Type":null,"ID":"CallingMehtodByTimer_1b077d2a-563f-44bd-b153-dee1e0587e9b","ToolName":"CallingMehtodByTimer","From":"00:00:24.0540000","To":"00:00:29.3320000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StopDraw","Type":null,"ID":"CallingMethod_3561c129-c768-49f2-8723-34243e2e699a","ToolName":"CallingMethod","From":"00:00:29.4040000","To":"00:00:29.8320000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StartDraw","Type":null,"ID":"CallingMethod_817c11f4-d9cd-414e-8cdb-fff8bf305a04","ToolName":"CallingMethod","From":"00:00:37.2980000","To":"00:00:38.1310000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.0500000","MethodName":"_timer_Tick","Type":null,"ID":"CallingMehtodByTimer_f5d8f547-2362-4017-b47f-b5104703965e","ToolName":"CallingMehtodByTimer","From":"00:00:38.1780000","To":"00:00:40.1560000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StopDraw","Type":null,"ID":"CallingMethod_29c1a14e-0dad-4896-b188-b9c6ec6a3bac","ToolName":"CallingMethod","From":"00:00:40.2010000","To":"00:00:40.8260000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StartDraw","Type":null,"ID":"CallingMethod_9068a03b-01cf-4122-ad08-7744a606fe27","ToolName":"CallingMethod","From":"00:00:45.4720000","To":"00:00:46.1420000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.0500000","MethodName":"_timer_Tick","Type":null,"ID":"CallingMehtodByTimer_be3e774b-aced-4865-8fe5-368a6f8026cb","ToolName":"CallingMehtodByTimer","From":"00:00:46.2450000","To":"00:00:51.5120000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StopDraw","Type":null,"ID":"CallingMethod_f93fd3d9-ae81-497f-9ce5-1a75a356e5bb","ToolName":"CallingMethod","From":"00:00:51.5670000","To":"00:00:52.3060000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StartDraw","Type":null,"ID":"CallingMethod_63269568-1652-4207-96d7-7768ffa88e9c","ToolName":"CallingMethod","From":"00:00:52.3510000","To":"00:00:53.0870000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.0500000","MethodName":"_timer_Tick","Type":null,"ID":"CallingMehtodByTimer_a09c1019-da5d-4050-87bc-b81e975d9fa5","ToolName":"CallingMehtodByTimer","From":"00:00:53.1700000","To":"00:00:55.1460000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StopDraw","Type":null,"ID":"CallingMethod_ced06c1a-3b33-4289-b803-0ae71d8c7b06","ToolName":"CallingMethod","From":"00:00:55.1770000","To":"00:00:55.9690000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StartDraw","Type":null,"ID":"CallingMethod_343caaa9-3dd8-4a31-8d6e-244ad3fd4f34","ToolName":"CallingMethod","From":"00:00:56.0380000","To":"00:00:56.9510000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.0500000","MethodName":"_timer_Tick","Type":null,"ID":"CallingMehtodByTimer_cec3d627-139f-4e72-8a6e-33d7f06e803b","ToolName":"CallingMehtodByTimer","From":"00:00:56.9950000","To":"00:01:02.3270000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StopDraw","Type":null,"ID":"CallingMethod_4cd1be6a-a743-4578-91c4-6acffe5281a9","ToolName":"CallingMethod","From":"00:01:02.4160000","To":"00:01:02.9170000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_5bfdd887-3857-48c2-b0a1-1e58b4740aad","ToolName":"EndScenario","From":"00:01:10.7530000","To":"00:01:11.1790000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\tepping_One_Dab_5sec.mp4","Type":"Media","ID":"MediaPlayer_950093e1-f325-446c-ab9e-1a9efb7f9f01","ToolName":"MediaPlayer","From":"00:00:23.9980000","To":"00:00:29.3400000","Width":491.334383855796,"Height":317.939504656574,"SegmentType":0,"Position":"96.7293331331384,222.154281023767","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\tepping_One_Dab_2__6sec.mp4","Type":"Media","ID":"MediaPlayer_ba3e4b50-bd2f-4cfe-a637-1fa6e66e1c00","ToolName":"MediaPlayer","From":"00:00:37.9390000","To":"00:00:40.4270000","Width":502.69149476671146,"Height":312.46262881781695,"SegmentType":0,"Position":"87.3718642616104,341.610753107641","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\tepping_One_Dab_5sec.mp4","Type":"Media","ID":"MediaPlayer_bc11458e-bfe5-476e-9b0d-1fdaf4b449a6","ToolName":"MediaPlayer","From":"00:00:46.0430000","To":"00:00:51.5700000","Width":515.79225372721316,"Height":349.21074592014043,"SegmentType":0,"Position":"1112.08532374349,304.862636005317","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\tepping_One_Dab_2__6sec.mp4","Type":"Media","ID":"MediaPlayer_e220ae34-51b1-4fab-82e8-9ed49e4c054b","ToolName":"MediaPlayer","From":"00:00:52.8630000","To":"00:00:55.2000000","Width":487.93944009765789,"Height":326.77493899197412,"SegmentType":0,"Position":"368.07631016927,233.315267082247","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\tepping_One_Dab_5sec.mp4","Type":"Media","ID":"MediaPlayer_bece8dd4-eff6-4f5e-8afe-7272c8f16fb4","ToolName":"MediaPlayer","From":"00:00:57.1740000","To":"00:01:02.3750000","Width":494.94173272244279,"Height":329.22448087782328,"SegmentType":0,"Position":"1060.94873133029,244.863219472114","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами ломаная линия,","Type":"Text","ID":"TextTool_cd8c6743-c94c-45ed-9fe7-134cb31c7df1","ToolName":"TextTool","From":"00:00:00.2000000","To":"00:00:05.2000000","Width":486.08197298014545,"Height":50.181486030278549,"SegmentType":0,"Position":"639.885452604163,143.974226835937","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Её следует ЗАПОМНИТЬ и ВОСПРОИЗВЕСТИ ","Type":"Text","ID":"TextTool_8d0438fc-c0e8-4f1e-a1f3-2cf03a2800a3","ToolName":"TextTool","From":"00:00:05.2780000","To":"00:00:12.2610000","Width":748.03508013997509,"Height":50.181486030278549,"SegmentType":0,"Position":"511.908362083331,71.9871134179684","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"по памяти, когда линия исчезнет","Type":"Text","ID":"TextTool_c27794ad-6b66-4bab-a678-0b366446a200","ToolName":"TextTool","From":"00:00:05.3110000","To":"00:00:12.2940000","Width":552.07016027994985,"Height":60.1796962272186,"SegmentType":0,"Position":"607.891179973955,137.975300717773","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"начало линии","Type":"Text","ID":"TextTool_77f32e1c-4576-4ad4-94d2-7be71197a6d2","ToolName":"TextTool","From":"00:00:12.3600000","To":"00:00:15.3670000","Width":209.95883452962107,"Height":50.181486030278563,"SegmentType":0,"Position":"490.084836665042,231.958476569009","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"конец линии ","Type":"Text","ID":"TextTool_aa1861a1-654e-43bf-b8bf-8df9f224cfec","ToolName":"TextTool","From":"00:00:15.4340000","To":"00:00:18.3070000","Width":210.13137154460003,"Height":54.180770109054563,"SegmentType":0,"Position":"1061.80992291503,643.88473668294","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Коснитесь щупом площадки ","Type":"Text","ID":"TextTool_b59595f5-9fa9-4141-a06c-c812ed19b5e0","ToolName":"TextTool","From":"00:00:18.3750000","To":"00:00:23.3750000","Width":468.08519462565334,"Height":56.180412148442585,"SegmentType":0,"Position":"97.9824599300125,67.9878293391924","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"и удерживайте его на ней","Type":"Text","ID":"TextTool_1632aff6-f093-4e14-93d4-0cd6cf6bde47","ToolName":"TextTool","From":"00:00:18.4410000","To":"00:00:23.4410000","Width":464.08591054687747,"Height":50.181486030278549,"SegmentType":0,"Position":"89.9838917724605,139.974942757161","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"рисуется первый отрезок линии","Type":"Text","ID":"TextTool_26fcead3-5f29-4a47-aaa4-d7a5fab712b4","ToolName":"TextTool","From":"00:00:23.4850000","To":"00:00:28.4850000","Width":552.07016027994985,"Height":52.181128069666542,"SegmentType":0,"Position":"97.9824599300127,143.974226835937","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"приподнимите щуп, если посчитаете","Type":"Text","ID":"TextTool_6a7eaf87-3ef2-4db5-b742-2f1e31e40de3","ToolName":"TextTool","From":"00:00:28.5640000","To":"00:00:34.4770000","Width":616.0587055403663,"Height":56.180412148442585,"SegmentType":0,"Position":"101.981744008789,67.9878293391924","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"что точно воспроизвели первый отрезок","Type":"Text","ID":"TextTool_edec67a1-807a-41d8-ae51-3379e9633087","ToolName":"TextTool","From":"00:00:28.5970000","To":"00:00:34.5100000","Width":676.04796672200666,"Height":52.181128069666542,"SegmentType":0,"Position":"97.9824599300125,137.975300717773","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"снова коснитесь щупом площадки ","Type":"Text","ID":"TextTool_0171a50f-08cf-457c-a1dd-6242a2b9493a","ToolName":"TextTool","From":"00:00:34.6100000","To":"00:00:40.4900000","Width":602.06121126465007,"Height":62.179338266606578,"SegmentType":0,"Position":"87.9842497330726,679.878293391924","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"и удерживайте его на ней,","Type":"Text","ID":"TextTool_ed474054-def2-4177-9926-496cde207c10","ToolName":"TextTool","From":"00:00:34.6430000","To":"00:00:40.5230000","Width":456.08734238932527,"Height":54.180770109054606,"SegmentType":0,"Position":"87.9842497330724,759.863974967444","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"чтобы нарисовать второй отрезок","Type":"Text","ID":"TextTool_ca99096f-215d-411f-b0b6-d282cfd96a9b","ToolName":"TextTool","From":"00:00:34.6780000","To":"00:00:40.5230000","Width":606.0604953434264,"Height":52.181128069666556,"SegmentType":0,"Position":"89.9838917724603,835.850372464189","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"приподнимите щуп, если посчитаете","Type":"Text","ID":"TextTool_8a5fe8f3-2599-4147-9ac6-5d544351d92f","ToolName":"TextTool","From":"00:00:40.6240000","To":"00:00:45.6240000","Width":654.05190428873834,"Height":62.179338266606635,"SegmentType":0,"Position":"85.9846076936846,679.878293391924","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"что точно воспроизвели второй отрезок","Type":"Text","ID":"TextTool_af41a0a5-1a0c-4ee4-9112-0eed3b66c8a5","ToolName":"TextTool","From":"00:00:40.6570000","To":"00:00:45.6570000","Width":686.04617691894657,"Height":58.180054187830706,"SegmentType":0,"Position":"85.9846076936847,759.863974967444","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Действуйте аналогичным образом,","Type":"Text","ID":"TextTool_32fcca8e-9224-4417-b220-1a2e8a90f222","ToolName":"TextTool","From":"00:00:45.7690000","To":"00:00:54.4050000","Width":586.06407494954624,"Height":54.180770109054606,"SegmentType":0,"Position":"1107.80168982096,167.969931308592","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"чтобы воспроизвести всю ломаную линию","Type":"Text","ID":"TextTool_7d6c8bfa-de22-495e-9b59-954ba873db9d","ToolName":"TextTool","From":"00:00:46.0590000","To":"00:00:54.5390000","Width":662.05047244629077,"Height":52.18112806966667,"SegmentType":0,"Position":"1105.80204778157,237.957402687173","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Задание повторится 3 раза","Type":"Text","ID":"TextTool_c2f84849-a101-4a33-9c73-1b70b096303a","ToolName":"TextTool","From":"00:01:03.2390000","To":"00:01:06.4130000","Width":462.08626850748976,"Height":56.180412148442542,"SegmentType":0,"Position":"719.871134179684,891.840349567053","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_6d2d8add-69f5-4630-a315-83cc94411293","ToolName":"TextTool","From":"00:01:06.7140000","To":"00:01:10.2880000","Width":434.09127995605741,"Height":50.18148603027862,"SegmentType":0,"Position":"733.8686284554,893.839991606441","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_6143589e-d9b2-4822-9b50-be4f04a89f0d","ToolName":"TextTool","From":"00:01:06.9600000","To":"00:01:10.6010000","Width":192.13459319010792,"Height":52.181128069666556,"SegmentType":0,"Position":"857.846434897457,963.827462985021","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"OriginalPath","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"NewPath","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"startEl","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_894376ea-eb70-4122-884d-80063314b127","ToolName":"ColorAnimation","From":"00:00:12.3610000","To":"00:00:15.2340000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"endEl","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_84bf0300-a48e-42fd-9c23-b5be71ded745","ToolName":"ColorAnimation","From":"00:00:15.2590000","To":"00:00:18.2740000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\AccurateEye_M.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:01:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_6e16236d-d4e4-4525-a2a1-8a61de110701","ToolName":"EndScenario","From":"00:01:38.4780000","To":"00:01:39.2380000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"PreviewStart","Type":null,"ID":"CallingMethod_06ffa97f-b0b3-4a06-9f6d-620be5dd5527","ToolName":"CallingMethod","From":"00:00:24.1770000","To":"00:00:25.4610000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StartDraw","Type":null,"ID":"CallingMethod_243fc886-faec-49ba-b367-d2e030cc58ef","ToolName":"CallingMethod","From":"00:00:38.8050000","To":"00:00:39.6980000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.0500000","MethodName":"_timer_Tick","Type":null,"ID":"CallingMehtodByTimer_de34bce9-6886-42ba-998a-7b60b985ec38","ToolName":"CallingMehtodByTimer","From":"00:00:39.8100000","To":"00:00:44.8100000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StopDraw","Type":null,"ID":"CallingMethod_a30748b2-05ce-4655-95e6-5ff0ee8dbc18","ToolName":"CallingMethod","From":"00:00:44.8910000","To":"00:00:45.7840000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StartDraw","Type":null,"ID":"CallingMethod_a1b2a601-a752-49e0-9cd6-0610911d5e0b","ToolName":"CallingMethod","From":"00:00:55.6670000","To":"00:00:56.5050000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.0500000","MethodName":"_timer_Tick","Type":null,"ID":"CallingMehtodByTimer_bde767fc-ec2c-43a8-9484-e441008eee1a","ToolName":"CallingMehtodByTimer","From":"00:00:56.6170000","To":"00:00:58.3470000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StopDraw","Type":null,"ID":"CallingMethod_289579cc-7036-4cb7-8b50-23d31eb33a28","ToolName":"CallingMethod","From":"00:00:58.4590000","To":"00:00:59.4640000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StartDraw","Type":null,"ID":"CallingMethod_6ac5dbcb-6511-434f-a97c-902878cba2f0","ToolName":"CallingMethod","From":"00:01:05.6610000","To":"00:01:06.6670000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.0500000","MethodName":"_timer_Tick","Type":null,"ID":"CallingMehtodByTimer_ccfa2d62-4667-4970-b1da-814b36775c9c","ToolName":"CallingMehtodByTimer","From":"00:01:06.7220000","To":"00:01:09.1230000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StopDraw","Type":null,"ID":"CallingMethod_aca0da95-e7ba-40cd-9748-647735e0e902","ToolName":"CallingMethod","From":"00:01:09.2350000","To":"00:01:10.1840000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StartDraw","Type":null,"ID":"CallingMethod_7e1e20ba-3eea-49f1-8cef-0780f15fe039","ToolName":"CallingMethod","From":"00:01:13.8140000","To":"00:01:14.7070000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.0500000","MethodName":"_timer_Tick","Type":null,"ID":"CallingMehtodByTimer_aedbe172-8e7a-478a-8e31-9927c7ee0cf8","ToolName":"CallingMehtodByTimer","From":"00:01:14.7630000","To":"00:01:16.4380000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StopDraw","Type":null,"ID":"CallingMethod_71a3643a-b5f2-407f-88da-24b804a5eff6","ToolName":"CallingMethod","From":"00:01:16.5490000","To":"00:01:17.6660000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StartDraw","Type":null,"ID":"CallingMethod_0f2fddbd-6e5f-4659-a509-0dc97ab8c0c1","ToolName":"CallingMethod","From":"00:01:21.0160000","To":"00:01:21.9100000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.0500000","MethodName":"_timer_Tick","Type":null,"ID":"CallingMehtodByTimer_ae15924a-52dd-4ce0-908e-9993346c9b5b","ToolName":"CallingMehtodByTimer","From":"00:01:22.0210000","To":"00:01:23.9750000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StopDraw","Type":null,"ID":"CallingMethod_2593cfb4-9319-494d-a976-7328beb15b9a","ToolName":"CallingMethod","From":"00:01:24.0870000","To":"00:01:25.4270000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Начало","Type":"Text","ID":"TextTool_edd6fb9a-823c-4432-962f-2d6d8ddebb7a","ToolName":"TextTool","From":"00:00:01.5070000","To":"00:00:06.5070000","Width":100.78185596864465,"Height":52.947069506768457,"SegmentType":0,"Position":"552.034900049305,843.218144031355","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Вам следует запомнить и воспроизвести ","Type":"Text","ID":"TextTool_854ee039-bb8f-418c-9cd5-8859944fb4ae","ToolName":"TextTool","From":"00:00:01.6750000","To":"00:00:06.6750000","Width":608.330427076247,"Height":63.057598811700757,"SegmentType":0,"Position":"34.3757996367699,438.796971834062","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"показанную ломаную линию","Type":"Text","ID":"TextTool_3be1a8d6-3e86-41bd-9a86-e4d92abd1985","ToolName":"TextTool","From":"00:00:01.7310000","To":"00:00:06.7310000","Width":458.69459336324877,"Height":59.013387089727843,"SegmentType":0,"Position":"34.3757996367699,507.548571107602","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Каждый отрезок  линии  соответствует маркеру слева","Type":"Text","ID":"TextTool_28c60c08-1336-4b6b-b4fa-0a56dd5f4d25","ToolName":"TextTool","From":"00:00:07.3700000","To":"00:00:15.7450000","Width":748.289697869924,"Height":83.016869605377565,"SegmentType":0,"Position":"33.9418332511588,887.966260789245","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Это означает: УМЕНЬШИТЬ отрезок в 2 раза","Type":"Text","ID":"TextTool_82995e74-9e54-466f-8629-4d147ca278ae","ToolName":"TextTool","From":"00:00:17.4210000","To":"00:00:23.8970000","Width":640.68412085203056,"Height":59.013387089727843,"SegmentType":0,"Position":"32.3536937757833,899.837108138976","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Отсчет времени до начала рисования линии","Type":"Text","ID":"TextTool_ea09c2c1-dec2-410d-9cad-179126aa0786","ToolName":"TextTool","From":"00:00:25.7950000","To":"00:00:29.3130000","Width":543.62303952468051,"Height":52.947069506768344,"SegmentType":0,"Position":"1110.13611768157,986.787660161394","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Возьмите в руку щуп, коснитесь площадки пульта ","Type":"Text","ID":"TextTool_8733d4f7-eca5-4c63-8e96-777fd60fe38e","ToolName":"TextTool","From":"00:00:31.2670000","To":"00:00:38.5260000","Width":768.51075647978837,"Height":60.773705134526267,"SegmentType":0,"Position":"35.9639391121456,376.37347795967","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"и удерживайте в таком положении","Type":"Text","ID":"TextTool_ca193410-a814-46e4-9bef-e70c482fa37b","ToolName":"TextTool","From":"00:00:31.3790000","To":"00:00:38.6930000","Width":553.73356882961264,"Height":54.9691753677549,"SegmentType":0,"Position":"36.3979054977562,444.863289417022","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Отрезок начинает рисоваться","Type":"Text","ID":"TextTool_18f3d242-bbc3-4e03-a11d-28dbc607092e","ToolName":"TextTool","From":"00:00:38.8610000","To":"00:00:45.8400000","Width":460.71669922423513,"Height":44.858646062822572,"SegmentType":0,"Position":"38.4200113587428,382.178007726442","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Прервите контакт с площадкой, когда посчитаете, ","Type":"Text","ID":"TextTool_1ae7bde5-135b-4dd0-8c2c-09b8d42a1ae3","ToolName":"TextTool","From":"00:00:45.9520000","To":"00:00:52.9870000","Width":719.54624943050248,"Height":63.057598811700757,"SegmentType":0,"Position":"28.3094820538106,64.7073875515668","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"что точно воспроизвели длину этого отрезка","Type":"Text","ID":"TextTool_3fbbb957-5adc-43ac-978d-8ae881ac9b02","ToolName":"TextTool","From":"00:00:46.0080000","To":"00:00:53.0990000","Width":604.28621535427408,"Height":48.902857784795543,"SegmentType":0,"Position":"28.3094820538104,137.50319854708","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Для продолжения рисования линии, ","Type":"Text","ID":"TextTool_9b8aadf3-591a-4907-be80-dd2d00adef18","ToolName":"TextTool","From":"00:00:53.3220000","To":"00:01:00.0780000","Width":537.55672194172075,"Height":61.035492950714229,"SegmentType":0,"Position":"28.3094820538106,66.7294934125533","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"снова коснитесь площадки щупом","Type":"Text","ID":"TextTool_253a1f1d-f498-4a1e-a1f5-9ac12d95cc2a","ToolName":"TextTool","From":"00:00:53.4900000","To":"00:01:00.3020000","Width":497.11460472199161,"Height":56.9912812287414,"SegmentType":0,"Position":"30.331587914797,133.458986825107","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВНИМАНИЕ!","Type":"Text","ID":"TextTool_83c04362-ec74-4abb-9d03-3d77de202c0c","ToolName":"TextTool","From":"00:01:00.4690000","To":"00:01:05.4690000","Width":327.25771239912876,"Height":81.256551560579,"SegmentType":0,"Position":"36.3979054977562,384.200113587428","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Следующий отрезок следует воспроизвести ","Type":"Text","ID":"TextTool_a225b767-6ce7-44d1-8dbc-b3d36dd1d56e","ToolName":"TextTool","From":"00:01:05.5500000","To":"00:01:12.5290000","Width":630.57359154709786,"Height":56.991281228741514,"SegmentType":0,"Position":"34.3757996367701,475.194877331819","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"в 2 раза КОРОЧЕ исходного","Type":"Text","ID":"TextTool_67125809-0f6c-42f8-b3b3-96aec6222ddf","ToolName":"TextTool","From":"00:01:05.6620000","To":"00:01:12.8080000","Width":446.56195819732994,"Height":48.902857784795515,"SegmentType":0,"Position":"32.3536937757833,541.924370744372","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Этот отрезок тоже следует воспроизвести ","Type":"Text","ID":"TextTool_019202c3-0160-47bb-9857-1e0ac9418ca9","ToolName":"TextTool","From":"00:01:20.7370000","To":"00:01:27.6050000","Width":592.15358018835548,"Height":65.079704672687285,"SegmentType":0,"Position":"1267.86037483851,645.051769654682","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"в 2 раза КОРОЧЕ исходного","Type":"Text","ID":"TextTool_55613d8b-a237-4692-a815-ab3ea31f2ad5","ToolName":"TextTool","From":"00:01:20.9050000","To":"00:01:27.8280000","Width":420.27458200450604,"Height":54.969175367754929,"SegmentType":0,"Position":"1269.8824806995,717.847580650194","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Успехов!","Type":"Text","ID":"TextTool_aca3a297-c454-48b4-ae81-bc31873468a0","ToolName":"TextTool","From":"00:01:28.9450000","To":"00:01:31.9600000","Width":264.57243070854832,"Height":113.61024533636237,"SegmentType":0,"Position":"1393.23093821967,426.664336668144","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"A_OriginalLine","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"B_OriginalLine","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"C_OriginalLine","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"D_OriginalLine","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"E_OriginalLine","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"A_NewLine","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"B_NewLine","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"C_NewLine","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"D_NewLine","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"E_NewLine","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"A_Prop_CC","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_ecc2462e-5940-46e1-9945-50dec50a3ecd","ToolName":"ColorAnimation","From":"00:00:07.1470000","To":"00:00:08.9340000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"B_Prop_CC","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_a2ece48b-f523-4a89-8c9e-f95075cfa5d4","ToolName":"ColorAnimation","From":"00:00:08.9890000","To":"00:00:10.7200000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"C_Prop_CC","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_c0b8fdf7-014c-4468-9591-89071484f250","ToolName":"ColorAnimation","From":"00:00:10.7760000","To":"00:00:12.3950000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_907abc79-f0eb-419e-a291-28360dffa1af","ToolName":"ColorAnimation","From":"00:00:17.4760000","To":"00:00:23.8970000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"D_Prop_CC","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_5b169cf4-855a-448a-8df8-8e84ee6d6ddc","ToolName":"ColorAnimation","From":"00:00:12.3950000","To":"00:00:14.1260000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"E_Prop_CC","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_56cd055f-bffa-4532-8657-12877bb0e832","ToolName":"ColorAnimation","From":"00:00:14.1270000","To":"00:00:15.8570000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"startEl","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_956a8bcd-5de7-449d-b0e6-86941f5229a6","ToolName":"ColorAnimation","From":"00:00:01.5080000","To":"00:00:06.5330000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\AssesmentMethodOnVolumeAttentions.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Preview1State","Type":null,"ID":"CallingMethod_1e27a29c-62e0-4329-96ff-1d1cc1ba3701","ToolName":"CallingMethod","From":"00:00:06.0490000","To":"00:00:06.6630000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Pause1State","Type":null,"ID":"CallingMethod_9aa22f85-9c23-4dd7-918c-ec65b5c6cbb8","ToolName":"CallingMethod","From":"00:00:08.3490000","To":"00:00:08.8330000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Preview2State","Type":null,"ID":"CallingMethod_08d123e3-ac6b-474a-b4ae-87016e29f201","ToolName":"CallingMethod","From":"00:00:10.5650000","To":"00:00:10.9930000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Pause2State","Type":null,"ID":"CallingMethod_05cfbc86-c319-4f5e-b6cd-0a713e955665","ToolName":"CallingMethod","From":"00:00:13.0670000","To":"00:00:13.3550000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Start","Type":null,"ID":"CallingMethod_7497c3a2-d21f-4c39-b357-c5c820cb5615","ToolName":"CallingMethod","From":"00:00:03.2460000","To":"00:00:03.5340000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"CheckDot1","Type":null,"ID":"CallingMethod_a6b4b134-54b1-4eea-853f-eade94366656","ToolName":"CallingMethod","From":"00:00:16.0850000","To":"00:00:16.3930000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"CheckDot2","Type":null,"ID":"CallingMethod_ad66639b-b11b-40be-9340-f76ee94e41c9","ToolName":"CallingMethod","From":"00:00:19.1470000","To":"00:00:19.4590000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideMatrix","Type":null,"ID":"CallingMethod_c827cc93-075e-4d8d-8a65-209de627d719","ToolName":"CallingMethod","From":"00:00:24.5630000","To":"00:00:25.0810000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_9f72eaf3-e299-472c-8dda-1972ac8f209f","ToolName":"EndScenario","From":"00:00:31.4360000","To":"00:00:31.7360000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами матрица размером 4 х 4  ","Type":"Text","ID":"TextTool_0f57eecd-0a30-4b45-b0c8-5f75bb926f49","ToolName":"TextTool","From":"00:00:00.0840000","To":"00:00:03.0740000","Width":660.05083040690261,"Height":62.179338266606649,"SegmentType":0,"Position":"627.887600367836,231.958476569009","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"в некоторых ячейках имеются точки","Type":"Text","ID":"TextTool_bc12304f-d423-4809-b1df-055bb9a4c1dc","ToolName":"TextTool","From":"00:00:03.1250000","To":"00:00:06.0810000","Width":592.06300106771016,"Height":60.1796962272186,"SegmentType":0,"Position":"661.881515037432,231.958476569009","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАПОМНИТЕ расположение точек","Type":"Text","ID":"TextTool_a448063c-02d7-4f96-985b-26274a49dc5b","ToolName":"TextTool","From":"00:00:06.1480000","To":"00:00:09.0880000","Width":614.05906350097837,"Height":54.180770109054563,"SegmentType":0,"Position":"649.883662801104,233.958118608397","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"матрица будет показана 2 раза","Type":"Text","ID":"TextTool_fe3bbc08-61f1-4c4f-b298-611ceda2b585","ToolName":"TextTool","From":"00:00:09.1220000","To":"00:00:12.1280000","Width":544.07159212239787,"Height":64.178980305994614,"SegmentType":0,"Position":"685.877219510088,231.958476569009","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"после этого появится пустая матрица","Type":"Text","ID":"TextTool_f33d4162-ca93-4e79-bcc4-c3dbf0196aea","ToolName":"TextTool","From":"00:00:12.1620000","To":"00:00:15.0510000","Width":654.05190428873846,"Height":64.178980305994614,"SegmentType":0,"Position":"631.886884446612,229.958834529621","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"отметьте с помощью мыши щелчком ","Type":"Text","ID":"TextTool_4e0c486f-550b-4452-91b4-9b7b2cb663f1","ToolName":"TextTool","From":"00:00:15.0670000","To":"00:00:20.0670000","Width":698.04402915527464,"Height":52.181128069666556,"SegmentType":0,"Position":"609.890822013343,149.973152954101","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"левой клавиши те клетки, ","Type":"Text","ID":"TextTool_3fae470c-559a-4c46-b2f3-f081b2440cd8","ToolName":"TextTool","From":"00:00:15.0850000","To":"00:00:20.0850000","Width":490.08125705892155,"Height":52.181128069666542,"SegmentType":0,"Position":"707.873281943356,233.958118608397","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"на которых, по Вашему мнению, ","Type":"Text","ID":"TextTool_429bc430-b1e7-4a6f-aa5e-3fff7a65d382","ToolName":"TextTool","From":"00:00:20.1010000","To":"00:00:25.1010000","Width":610.05977942220227,"Height":64.178980305994614,"SegmentType":0,"Position":"661.881515037432,145.973868875325","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"находились точки","Type":"Text","ID":"TextTool_0c3b2437-5a86-43a0-b187-08d1002e476d","ToolName":"TextTool","From":"00:00:20.1350000","To":"00:00:25.1350000","Width":340.10810410482065,"Height":68.178264384770657,"SegmentType":0,"Position":"785.859321479488,227.959192490233","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"время принятия решения ограничено","Type":"Text","ID":"TextTool_24984d1b-9dda-410f-9a03-e56939e65ed7","ToolName":"TextTool","From":"00:00:25.1850000","To":"00:00:28.2090000","Width":660.05083040690283,"Height":64.178980305994628,"SegmentType":0,"Position":"617.889390170895,497.910867807615","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_f952b109-5a0a-450a-9ae2-70b15635990b","ToolName":"TextTool","From":"00:00:28.2640000","To":"00:00:31.2810000","Width":432.09163791666913,"Height":62.179338266606578,"SegmentType":0,"Position":"733.8686284554,411.92626011393","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_c40dd18c-8d8b-414b-af98-7f46661ed021","ToolName":"TextTool","From":"00:00:28.2860000","To":"00:00:31.3260000","Width":210.13137154459992,"Height":58.180054187830592,"SegmentType":0,"Position":"841.849298582353,505.909435965167","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\AssessmentOfPropensityToTakeRisks.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:50","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_7eda2503-92ca-438e-bbaf-b7ac16434cc5","ToolName":"EndScenario","From":"00:00:48.2380000","To":"00:00:49.0030000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Start","Type":null,"ID":"CallingMethod_ef332dc5-8822-4d4a-afee-c2e3cd0655ca","ToolName":"CallingMethod","From":"00:00:07.1150000","To":"00:00:07.5330000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowGreenCircle1","Type":null,"ID":"CallingMethod_292b88d8-2c6e-4262-9eac-b4f01c7f0367","ToolName":"CallingMethod","From":"00:00:07.5900000","To":"00:00:07.9520000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowRedCircle1","Type":null,"ID":"CallingMethod_1c4fc988-e92d-40ed-bdf9-12409101854b","ToolName":"CallingMethod","From":"00:00:07.9800000","To":"00:00:08.2870000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ChangeAcceleration100Percent","Type":null,"ID":"CallingMethod_13ecc591-41e3-4f24-92c0-d558d33fca54","ToolName":"CallingMethod","From":"00:00:29.6600000","To":"00:00:29.9940000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ChangeAcceleration0Percent","Type":null,"ID":"CallingMethod_9a604499-885a-4278-9cf8-d3f705176a3f","ToolName":"CallingMethod","From":"00:00:31.9800000","To":"00:00:32.3430000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowRedCircle2","Type":null,"ID":"CallingMethod_b8817eda-6404-4fd5-b550-e3aff9ebc2cb","ToolName":"CallingMethod","From":"00:00:32.3890000","To":"00:00:32.8160000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowGreenCircle2","Type":null,"ID":"CallingMethod_ea84d115-86d1-432d-9988-6d0c0851c8e3","ToolName":"CallingMethod","From":"00:00:33.2330000","To":"00:00:33.5950000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ChangeAcceleration100Percent","Type":null,"ID":"CallingMethod_aa5e85b5-acb3-405a-92d2-3961d601a8d4","ToolName":"CallingMethod","From":"00:00:33.6240000","To":"00:00:33.9860000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ChangeAcceleration0Percent","Type":null,"ID":"CallingMethod_7696864c-c30c-4cde-8cd1-c082aa19b50e","ToolName":"CallingMethod","From":"00:00:36.1100000","To":"00:00:36.5000000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowRedCircle3","Type":null,"ID":"CallingMethod_f86f26db-30cf-47fa-b461-463e33594739","ToolName":"CallingMethod","From":"00:00:36.5560000","To":"00:00:36.8910000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowGreenCircle3","Type":null,"ID":"CallingMethod_03b22a05-599a-4458-b115-f3a65fc15407","ToolName":"CallingMethod","From":"00:00:37.3900000","To":"00:00:37.7530000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ChangeAcceleration100Percent","Type":null,"ID":"CallingMethod_e40bffa1-0817-462d-b403-8b2ef8289486","ToolName":"CallingMethod","From":"00:00:37.7810000","To":"00:00:38.2000000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ChangeAcceleration0Percent","Type":null,"ID":"CallingMethod_8f1e260f-d965-47e4-b524-78f3ddb22eff","ToolName":"CallingMethod","From":"00:00:40.2660000","To":"00:00:40.6850000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"NextCircleOrReturnResult","Type":null,"ID":"CallingMethod_760efc9b-6ded-41be-9551-5b722596a69d","ToolName":"CallingMethod","From":"00:00:32.8340000","To":"00:00:33.1940000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"NextCircleOrReturnResult","Type":null,"ID":"CallingMethod_2aa118dd-e2df-4446-8258-26a46a1fe911","ToolName":"CallingMethod","From":"00:00:36.9440000","To":"00:00:37.3610000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Resistors down.mp4","Type":"Media","ID":"MediaPlayer_265d6d8b-3736-4a75-bc60-42a801b97c06","ToolName":"MediaPlayer","From":"00:00:13.5600000","To":"00:00:18.5600000","Width":844.01789803059944,"Height":426.1141894352246,"SegmentType":0,"Position":"529.905140437823,159.971363151041","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Resistors_UP_DOWN2.mp4","Type":"Media","ID":"MediaPlayer_ee86f9b7-dbf0-44d5-b2fc-97331a4a5301","ToolName":"MediaPlayer","From":"00:00:23.7440000","To":"00:00:28.7440000","Width":512.07731949218976,"Height":308.13530911133205,"SegmentType":0,"Position":"21.996062433268,407.926976035154","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами три круга, ","Type":"Text","ID":"TextTool_bf4ff315-bc21-45b0-8db1-d5f8229f26ff","ToolName":"TextTool","From":"00:00:00.3770000","To":"00:00:07.3020000","Width":413.92411235025838,"Height":49.9892611816405,"SegmentType":0,"Position":"36.1643039209032,28.1872134000702","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"по каждому из которых Вам предстоит ","Type":"Text","ID":"TextTool_a63e6280-4088-42f7-8935-ee471b3e4f1b","ToolName":"TextTool","From":"00:00:00.4180000","To":"00:00:07.2740000","Width":742.03615402181072,"Height":54.180770109054563,"SegmentType":0,"Position":"43.9921248665364,95.9828178906245","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БЫСТРО проводить зеленую точку","Type":"Text","ID":"TextTool_9d8d6342-1bab-43fc-8590-e280f6d51ed0","ToolName":"TextTool","From":"00:00:00.5850000","To":"00:00:07.3860000","Width":660.05083040690261,"Height":54.180770109054563,"SegmentType":0,"Position":"39.9928407877601,167.969931308593","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"и ТОЧНО останавливать её","Type":"Text","ID":"TextTool_de4762e7-ed6f-45df-a9e3-b849f1603b01","ToolName":"TextTool","From":"00:00:00.5850000","To":"00:00:07.4970000","Width":446.08913219238531,"Height":62.179338266606578,"SegmentType":0,"Position":"49.9910509847002,235.957760647785","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"место остановки окрашивается красным цветом","Type":"Text","ID":"TextTool_53fdc741-03c7-46fc-b8ce-46453d284305","ToolName":"TextTool","From":"00:00:00.7250000","To":"00:00:07.6370000","Width":686.0461769189468,"Height":68.178264384771182,"SegmentType":0,"Position":"25.9953465120441,817.853594109696","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Переведите рукоятки пульта в позицию «0»","Type":"Text","ID":"TextTool_2ee8b169-4cea-40da-a8b8-0659e0832a85","ToolName":"TextTool","From":"00:00:08.3710000","To":"00:00:15.3740000","Width":848.01718210937554,"Height":76.176832542322686,"SegmentType":0,"Position":"531.904782477211,45.9917669059242","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"во время выполнения теста используйте правую рукоятку, если Вы правша","Type":"Text","ID":"TextTool_1edf864b-1771-4aac-ae8a-8ecca83e93e5","ToolName":"TextTool","From":"00:00:08.3980000","To":"00:00:18.3980000","Width":1279.7691154052673,"Height":63.986755457356473,"SegmentType":0,"Position":"20.167167605799,918.027920927735","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"или левую, если левша","Type":"Text","ID":"TextTool_f762e2d4-a04a-4a7b-9221-9abe424fb4f1","ToolName":"TextTool","From":"00:00:08.5100000","To":"00:00:18.4430000","Width":430.09199587728091,"Height":60.179696227218415,"SegmentType":0,"Position":"21.9960624332682,985.82352541829","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Скорость движения точки возрастает при повороте ","Type":"Text","ID":"TextTool_f835165c-5588-4bd2-ae43-c66d93e3b4c6","ToolName":"TextTool","From":"00:00:18.8620000","To":"00:00:28.8620000","Width":1019.8156502848259,"Height":85.98281789062446,"SegmentType":0,"Position":"36.1643039209026,10.1904350455784","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"рукоятки пульта из положения «О» вперед  к позиции «1»","Type":"Text","ID":"TextTool_6dfd48a2-bb91-4151-9504-869d58148430","ToolName":"TextTool","From":"00:00:18.9730000","To":"00:00:28.9730000","Width":1031.8135025211541,"Height":67.984249733072488,"SegmentType":0,"Position":"30.1653778027389,90.1779064241588","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"для остановки точки на красной метке ","Type":"Text","ID":"TextTool_131d3e95-5615-490b-baa7-c34a1c99a1b7","ToolName":"TextTool","From":"00:00:21.2050000","To":"00:00:28.9620000","Width":696.04438711588659,"Height":84.175400699874729,"SegmentType":0,"Position":"27.9949885514322,145.973868875325","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"переводите рукоятку в позицию «0»","Type":"Text","ID":"TextTool_b0a5b550-571e-4b11-8deb-0bbf6ec846fb","ToolName":"TextTool","From":"00:00:21.5960000","To":"00:00:28.9900000","Width":604.060853304038,"Height":78.176474581710693,"SegmentType":0,"Position":"33.9939146695963,221.960266372069","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВАША ЗАДАЧА заключается в том, ","Type":"Text","ID":"TextTool_670d7ebc-1075-415d-aa91-374867dabc57","ToolName":"TextTool","From":"00:00:29.2130000","To":"00:00:39.2130000","Width":699.87292398274383,"Height":61.98711341796843,"SegmentType":0,"Position":"38.163945960291,24.1879293212943","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"чтобы КАК МОЖНО БЫСТРЕЕ провести ","Type":"Text","ID":"TextTool_14f29ca7-843c-4006-98ef-e5b81a7977d5","ToolName":"TextTool","From":"00:00:29.2970000","To":"00:00:39.3140000","Width":726.03901770670677,"Height":84.175400699874743,"SegmentType":0,"Position":"37.9931987483721,83.9849656542965","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"зелёную точку по кругу ","Type":"Text","ID":"TextTool_e26d2b85-f89e-4fd8-9720-758be1abd37f","ToolName":"TextTool","From":"00:00:29.5200000","To":"00:00:39.3690000","Width":512.07731949218964,"Height":60.179696227218585,"SegmentType":0,"Position":"35.9935567089842,163.970647229817","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"и ТОЧНО остановиться на красной метке","Type":"Text","ID":"TextTool_9fa1e9bb-c78e-4800-b293-edad39902d38","ToolName":"TextTool","From":"00:00:30.3850000","To":"00:00:39.4310000","Width":644.05369409179843,"Height":50.181486030278563,"SegmentType":0,"Position":"31.9942726302081,231.958476569009","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Действия повторите для каждого круга","Type":"Text","ID":"TextTool_50e65145-ff6a-44d2-b813-1ae02afbac73","ToolName":"TextTool","From":"00:00:39.6200000","To":"00:00:44.6200000","Width":630.05619981608243,"Height":62.179338266606578,"SegmentType":0,"Position":"43.9921248665362,29.9946305908202","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Задание повторится 3 раза","Type":"Text","ID":"TextTool_d2f0e189-a2c9-40ba-9ae3-92076d311e41","ToolName":"TextTool","From":"00:00:41.0160000","To":"00:00:44.5870000","Width":412.09521752278914,"Height":70.177906424158664,"SegmentType":0,"Position":"49.9910509847001,155.972079072265","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_d7f690c4-e40c-4c07-bc84-1e11be127eab","ToolName":"TextTool","From":"00:00:45.1450000","To":"00:00:47.6280000","Width":492.08089909830909,"Height":78.17647458171075,"SegmentType":0,"Position":"1359.75658678385,375.932703404946","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_f40a4851-4d3a-46d6-b05e-0821cae7c6a1","ToolName":"TextTool","From":"00:00:45.2010000","To":"00:00:47.6560000","Width":220.12958174154025,"Height":68.178264384770728,"SegmentType":0,"Position":"1491.73296138346,465.916595177407","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"el1","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_8b39dff1-c9f9-4da0-a37b-39536250b161","ToolName":"ColorAnimation","From":"00:00:00.5790000","To":"00:00:00.8880000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"el2","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_ae568c10-2c9c-493c-9b77-25166c3461be","ToolName":"ColorAnimation","From":"00:00:00.9040000","To":"00:00:01.2130000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"el3","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_cc364571-f1c2-4adf-a993-e06af11618fa","ToolName":"ColorAnimation","From":"00:00:01.2430000","To":"00:00:01.5670000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"elStatic1","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"elStatic2","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"elStatic3","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"elMove1","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"elMove2","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"elMove3","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\AttentionDistribution_1.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StartPart1","Type":null,"ID":"CallingMethod_331c4000-f716-4035-9f65-cca2b46b9d18","ToolName":"CallingMethod","From":"00:00:07.7930000","To":"00:00:08.3720000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"_timer_Tick__Interval_500ms","Type":null,"ID":"CallingMehtodByTimer_9d20ca3f-7d95-4292-a716-8e37fe03bc82","ToolName":"CallingMehtodByTimer","From":"00:00:08.3660000","To":"00:00:18.5870000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_8006aa1d-0b58-451d-bd0d-a389a45cd3e6","ToolName":"EndScenario","From":"00:00:27.2310000","To":"00:00:27.6440000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Blue_Button.mp4","Type":"Media","ID":"MediaPlayer_9184d628-fc3f-4a34-b5e4-27b632a5fda3","ToolName":"MediaPlayer","From":"00:00:16.7460000","To":"00:00:18.5120000","Width":572.06658067382989,"Height":354.12707601725623,"SegmentType":0,"Position":"49.9910509847004,301.94594794759","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Тест состоит из двух заданий","Type":"Text","ID":"TextTool_144b08e5-f0b0-4b28-bdfc-03464003e254","ToolName":"TextTool","From":"00:00:00.1360000","To":"00:00:03.1430000","Width":520.07588764974173,"Height":56.180412148442585,"SegmentType":0,"Position":"689.876503588864,211.962056175129","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАДАНИЕ №1","Type":"Text","ID":"TextTool_a69c6b23-07df-40a7-9a27-36c7354a4b26","ToolName":"TextTool","From":"00:00:03.2790000","To":"00:00:08.2790000","Width":265.94881163248522,"Height":54.180770109054592,"SegmentType":0,"Position":"818.026131124675,135.975658678385","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами 2 квадрата ","Type":"Text","ID":"TextTool_0a39582d-c8f9-4e42-970d-f9dbfe4fe413","ToolName":"TextTool","From":"00:00:03.3020000","To":"00:00:08.3020000","Width":464.08591054687781,"Height":74.1771905029347,"SegmentType":0,"Position":"715.871850100908,239.957044726561","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"В квадратах будут появляться фигуры ","Type":"Text","ID":"TextTool_1ef2ebd0-8946-4a43-9bbf-b2a4d6eb9a78","ToolName":"TextTool","From":"00:00:08.4560000","To":"00:00:11.4640000","Width":718.04044954915491,"Height":76.176832542322657,"SegmentType":0,"Position":"589.894401619463,125.977448481445","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Если фигуры одинаковые, БЫСТРО нажмите ","Type":"Text","ID":"TextTool_7eb17c32-f414-4c32-b276-ff99d8197a08","ToolName":"TextTool","From":"00:00:11.5780000","To":"00:00:18.5870000","Width":947.999284078776,"Height":69.9838917724605,"SegmentType":0,"Position":"55.9899771028643,130.170747211919","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Реагирование на разные фигуры в паре ","Type":"Text","ID":"TextTool_1c23a6c9-edd3-4997-be5e-bdb4e1f595ec","ToolName":"TextTool","From":"00:00:18.6770000","To":"00:00:23.6770000","Width":716.04080750976652,"Height":64.178980305994628,"SegmentType":0,"Position":"591.894043658852,703.87399786458","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЯВЛЯЕТСЯ ОШИБКОЙ","Type":"Text","ID":"TextTool_a5e24e4c-bc08-4fec-8bef-86f9cc4598b1","ToolName":"TextTool","From":"00:00:18.7230000","To":"00:00:23.7230000","Width":399.99999999999989,"Height":54.180770109054606,"SegmentType":0,"Position":"757.864332928056,787.858963518876","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_d9659f57-86dd-4a5d-9155-c3b0cac8f919","ToolName":"TextTool","From":"00:00:23.8550000","To":"00:00:26.8850000","Width":399.99999999999989,"Height":80.176116621098743,"SegmentType":0,"Position":"1373.75408105956,431.92268050781","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_c379dbdd-bd9f-480b-922f-54538649dc96","ToolName":"TextTool","From":"00:00:23.8550000","To":"00:00:26.8850000","Width":184.13602503255555,"Height":53.986755457356367,"SegmentType":0,"Position":"1477.73546710774,530.099155089521","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"синюю кнопку пульта","Type":"Text","ID":"TextTool_0a998592-b55a-4fd9-a2e5-d9a2cf41f192","ToolName":"TextTool","From":"00:00:11.5990000","To":"00:00:18.6090000","Width":399.99999999999994,"Height":64.178980305994628,"SegmentType":0,"Position":"55.9899771028645,213.961698214517","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\AttentionDistribution_2.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"StartPart2","Type":null,"ID":"CallingMethod_3e264e5e-689a-4763-b30a-e99fbebe6c95","ToolName":"CallingMethod","From":"00:00:03.1030000","To":"00:00:03.7720000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"_timer_Tick__Interval_500ms","Type":null,"ID":"CallingMehtodByTimer_ec883360-691a-4c4e-af54-c6de0ba2025f","ToolName":"CallingMehtodByTimer","From":"00:00:03.8150000","To":"00:00:15.7810000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_f20801f0-20a6-448e-9f2e-d5fb1d523ddd","ToolName":"EndScenario","From":"00:00:22.0490000","To":"00:00:22.5670000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\White_Button.mp4","Type":"Media","ID":"MediaPlayer_f0ac0e43-a1cc-4397-a4a2-31740e398603","ToolName":"MediaPlayer","From":"00:00:08.8430000","To":"00:00:10.2910000","Width":514.07696153157758,"Height":260.14390016601971,"SegmentType":0,"Position":"1305.76625172037,405.927333995766","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Blue_Button.mp4","Type":"Media","ID":"MediaPlayer_3c26a739-145e-4630-a712-ded506be3722","ToolName":"MediaPlayer","From":"00:00:13.9510000","To":"00:00:15.4850000","Width":504.07875133463756,"Height":264.14318424479569,"SegmentType":0,"Position":"93.9831758512364,399.928407877602","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАДАНИЕ №2","Type":"Text","ID":"TextTool_e629c082-c647-4e39-9ade-dc4e81734c2c","ToolName":"TextTool","From":"00:00:00.1020000","To":"00:00:03.1260000","Width":280.1188429231803,"Height":64.178980305994614,"SegmentType":0,"Position":"821.852878188472,187.966351702473","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Теперь в дополнение к фигурам вы услышите числа","Type":"Text","ID":"TextTool_551269ce-f04f-442d-8dc0-91debcdd3c01","ToolName":"TextTool","From":"00:00:03.2020000","To":"00:00:10.1910000","Width":947.99928407877621,"Height":68.178264384770614,"SegmentType":0,"Position":"873.84357121256,127.977090520833","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Если числа одинаковые, то БЫСТРО нажмите на ","Type":"Text","ID":"TextTool_568b258b-a3e4-4326-8146-c0eb56372a0b","ToolName":"TextTool","From":"00:00:03.2020000","To":"00:00:10.2160000","Width":856.01575026692751,"Height":60.1796962272186,"SegmentType":0,"Position":"965.82710502441,221.960266372069","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БЕЛУЮ кнопку ","Type":"Text","ID":"TextTool_6b146fbd-7602-4f9a-9554-8f1667106c9b","ToolName":"TextTool","From":"00:00:03.2270000","To":"00:00:10.2160000","Width":318.11204167155267,"Height":58.180054187830535,"SegmentType":0,"Position":"1509.72973973795,315.943442223306","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Если вы увидите одинаковые фигуры -  БЫСТРО ","Type":"Text","ID":"TextTool_0053aa9e-c1e6-423a-beca-e72f188f8d0e","ToolName":"TextTool","From":"00:00:10.4700000","To":"00:00:15.4700000","Width":854.0161082275398,"Height":66.178622345382621,"SegmentType":0,"Position":"95.9828178906243,217.960982293293","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"нажмите СИНЮЮ кнопку","Type":"Text","ID":"TextTool_11e826f2-8190-45a0-8fa5-cd97ac112a35","ToolName":"TextTool","From":"00:00:10.4950000","To":"00:00:15.4950000","Width":478.08340482259348,"Height":64.178980305994628,"SegmentType":0,"Position":"95.9828178906246,305.945232026366","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Неверный выбор кнопки СЧИТАЕТСЯ ОШИБКОЙ!","Type":"Text","ID":"TextTool_3e59d179-3b41-4dff-a7bc-c6859ed1aeed","ToolName":"TextTool","From":"00:00:15.9080000","To":"00:00:18.9070000","Width":836.01932987304781,"Height":68.178264384770614,"SegmentType":0,"Position":"531.904782477211,733.8686284554","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_840f9819-4ea9-4f0e-a902-2b77500c06c6","ToolName":"TextTool","From":"00:00:19.2630000","To":"00:00:21.8550000","Width":400.0,"Height":58.180054187830592,"SegmentType":0,"Position":"1373.75408105956,447.919816822915","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_56354f63-13e9-421a-a22f-da09fd268ba7","ToolName":"TextTool","From":"00:00:19.3140000","To":"00:00:21.8810000","Width":184.13602503255606,"Height":52.181128069666556,"SegmentType":0,"Position":"1485.73403526529,537.903708595375","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\ComplexMotorReaction.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:30","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_052a9c6f-b957-44d7-b286-79ceb32ebaae","ToolName":"EndScenario","From":"00:00:24.6780000","To":"00:00:25.0500000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Red_Button.mp4","Type":"Media","ID":"MediaPlayer_9cee61bb-279b-4596-a3ff-19b41404cc2e","ToolName":"MediaPlayer","From":"00:00:08.4170000","To":"00:00:09.8310000","Width":729.867554573564,"Height":395.92733399576616,"SegmentType":0,"Position":"82.156070826827,330.13316134766","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_019f4ed6-f2cc-44fd-890c-9ffcf7f55bb6","ToolName":"MediaPlayer","From":"00:00:13.9830000","To":"00:00:15.2620000","Width":730.03830178548355,"Height":396.11955884440408,"SegmentType":0,"Position":"1085.80562738769,333.940220577798","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowRedSignal","Type":null,"ID":"CallingMethod_cbb513f2-0495-44e2-bcbe-1757ff389e6a","ToolName":"CallingMethod","From":"00:00:08.1380000","To":"00:00:08.3900000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_28f1d7b3-2855-4224-9de4-7a2c504d080d","ToolName":"CallingMethod","From":"00:00:09.8300000","To":"00:00:10.1640000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowYellowSignal","Type":null,"ID":"CallingMethod_0ff54208-ba9f-4142-9125-1b3224350588","ToolName":"CallingMethod","From":"00:00:16.8060000","To":"00:00:17.1570000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_5020dcd0-ab86-47e3-aa13-7aa1a17ff9ee","ToolName":"CallingMethod","From":"00:00:18.4120000","To":"00:00:18.7460000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowGreenSignal","Type":null,"ID":"CallingMethod_80485bc3-7de0-4f28-b7dd-19a64954e18f","ToolName":"CallingMethod","From":"00:00:13.6250000","To":"00:00:13.9590000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_45135d3e-474f-4a25-bfd1-1f02145ffd3c","ToolName":"CallingMethod","From":"00:00:15.2780000","To":"00:00:15.6460000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами круг ","Type":"Text","ID":"TextTool_bb86cc76-a5d3-48fb-9d22-bf8c0a6f9dc1","ToolName":"TextTool","From":"00:00:00.0840000","To":"00:00:02.0970000","Width":312.1131155533883,"Height":50.181486030278563,"SegmentType":0,"Position":"795.857531676428,239.957044726561","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Он будет загораться ЗЕЛЕНЫМ или КРАСНЫМ цветом","Type":"Text","ID":"TextTool_6d637ae0-3592-47a2-ab10-3711179a3ab2","ToolName":"TextTool","From":"00:00:02.2150000","To":"00:00:05.2010000","Width":934.00178980306,"Height":48.181843990890528,"SegmentType":0,"Position":"477.914447413735,237.957402687173","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":22.0,"Text":"На красный сигнал КАК МОЖНО БЫСТРЕЕ ","Type":"Text","ID":"TextTool_9cc04502-6204-44e9-8a8b-ec1602b9ef56","ToolName":"TextTool","From":"00:00:05.2350000","To":"00:00:10.2350000","Width":730.038301785483,"Height":58.180054187830578,"SegmentType":0,"Position":"83.9849656542965,167.969931308593","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"реагируйте нажатием на КРАСНУЮ кнопку пульта","Type":"Text","ID":"TextTool_036ee106-940b-4218-9e05-723672ffce31","ToolName":"TextTool","From":"00:00:05.2510000","To":"00:00:10.2510000","Width":840.01861395182357,"Height":48.181843990890528,"SegmentType":0,"Position":"79.9856815755204,241.956686765949","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"На зеленый сигнал КАК МОЖНО БЫСТРЕЕ ","Type":"Text","ID":"TextTool_e3c82006-a6e9-476f-8155-c78d9631d565","ToolName":"TextTool","From":"00:00:10.3020000","To":"00:00:15.3020000","Width":692.045103037111,"Height":64.178980305994656,"SegmentType":0,"Position":"1129.79775225423,153.972437032877","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"реагируйте нажатием на ЗЕЛЁНУЮ кнопку пульта","Type":"Text","ID":"TextTool_d1935aeb-5aa3-41e0-aea7-84df1cd465d3","ToolName":"TextTool","From":"00:00:10.3360000","To":"00:00:15.3360000","Width":800.02577316406325,"Height":54.180770109054563,"SegmentType":0,"Position":"1023.81672416666,235.957760647785","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"На желтый сигнал реагировать не следует!","Type":"Text","ID":"TextTool_b7d2abf7-7c06-47ea-a972-9439d52413c3","ToolName":"TextTool","From":"00:00:15.3530000","To":"00:00:18.3720000","Width":738.03686994303507,"Height":64.178980305994628,"SegmentType":0,"Position":"583.895475501299,671.879725234372","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Неверный выбор кнопки  СЧИТАЕТСЯ ОШИБКОЙ!","Type":"Text","ID":"TextTool_783a6266-5f7c-4077-805e-ebfff714e47e","ToolName":"TextTool","From":"00:00:18.4060000","To":"00:00:21.4770000","Width":872.01288658203168,"Height":64.178980305994614,"SegmentType":0,"Position":"521.906572280271,767.862543124996","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_1f2d2386-c825-43ce-8a3b-3f0c88f9ac10","ToolName":"TextTool","From":"00:00:21.5270000","To":"00:00:24.5130000","Width":400.09736528646124,"Height":52.18112806966667,"SegmentType":0,"Position":"757.864332928056,677.878651352536","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_bc331f28-0b32-4301-bf39-abd478a5e4f9","ToolName":"TextTool","From":"00:00:21.5600000","To":"00:00:24.5810000","Width":198.13351930827196,"Height":54.180770109054563,"SegmentType":0,"Position":"857.846434897457,775.861111282548","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\complexMotorReaction_M_instruction1.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:30","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_b802ab8e-29c9-4325-b139-40a4563737d7","ToolName":"EndScenario","From":"00:00:20.5330000","To":"00:00:20.8820000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Red_Button.mp4","Type":"Media","ID":"MediaPlayer_b77eca27-c46b-416e-a705-4827ece3c40a","ToolName":"MediaPlayer","From":"00:00:10.2960000","To":"00:00:11.8320000","Width":711.87077621907235,"Height":361.93341932617034,"SegmentType":0,"Position":"602.06300106771,614.082330940758","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowRedSignal","Type":null,"ID":"CallingMethod_fc5dc8ad-c729-4e91-8a45-3696622c805d","ToolName":"CallingMethod","From":"00:00:10.0280000","To":"00:00:10.3950000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_41d6a5cd-1066-43a6-9c1b-90a73602a882","ToolName":"CallingMethod","From":"00:00:11.1180000","To":"00:00:11.4680000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowYellowSignal","Type":null,"ID":"CallingMethod_f3b5a45b-4a95-4c67-b612-09917f9e953c","ToolName":"CallingMethod","From":"00:00:14.5620000","To":"00:00:15.0120000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_f35d41d4-8fac-4d69-bad8-b1e1bd550b55","ToolName":"CallingMethod","From":"00:00:16.0530000","To":"00:00:16.4370000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Тест состоит из двух заданий","Type":"Text","ID":"TextTool_f17fc660-7437-40ee-a60f-e12e872aa357","ToolName":"TextTool","From":"00:00:00.1010000","To":"00:00:02.1740000","Width":476.08376278320554,"Height":58.180054187830578,"SegmentType":0,"Position":"709.872923982744,187.966351702473","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАДАНИЕ №1","Type":"Text","ID":"TextTool_ba131f1e-a97c-4f3a-870e-ca40f43c855f","ToolName":"TextTool","From":"00:00:02.2250000","To":"00:00:04.2810000","Width":234.12707601725617,"Height":46.182201951502506,"SegmentType":0,"Position":"823.852520227861,195.964919860025","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами круг ","Type":"Text","ID":"TextTool_a4833995-2b4b-4981-977a-62aad37298de","ToolName":"TextTool","From":"00:00:04.3310000","To":"00:00:06.3710000","Width":286.11776904134445,"Height":54.180770109054492,"SegmentType":0,"Position":"797.857173715816,191.965635781249","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Он будет загораться КРАСНЫМ цветом","Type":"Text","ID":"TextTool_9af96642-460d-4707-8c15-2222d2b6fee7","ToolName":"TextTool","From":"00:00:06.4050000","To":"00:00:09.4720000","Width":652.05226224935052,"Height":52.181128069666542,"SegmentType":0,"Position":"625.887958328447,189.965993741861","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"На красный сигнал КАК МОЖНО БЫСТРЕЕ ","Type":"Text","ID":"TextTool_47b2144e-83a4-446c-b384-b83ec267bb67","ToolName":"TextTool","From":"00:00:09.5220000","To":"00:00:14.5280000","Width":685.87542970702782,"Height":53.9885452604164,"SegmentType":0,"Position":"610.061569225262,264.144974047856","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"реагируйте нажатием на КРАСНУЮ кнопку ","Type":"Text","ID":"TextTool_31f526fa-8952-414f-8ef1-0d4b5a40274c","ToolName":"TextTool","From":"00:00:09.5400000","To":"00:00:14.5400000","Width":710.04188139160271,"Height":48.181843990890528,"SegmentType":0,"Position":"597.892969777015,335.939862617186","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"На ЖЕЛТЫЙ сигнал реагировать не следует!","Type":"Text","ID":"TextTool_a260c087-59f8-4327-8860-a83fc1608394","ToolName":"TextTool","From":"00:00:14.6120000","To":"00:00:17.3260000","Width":766.0318584944672,"Height":56.1804121484426,"SegmentType":0,"Position":"567.898339186195,399.928407877602","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_01ba4698-5060-4eaf-9273-f17b4e1e197e","ToolName":"TextTool","From":"00:00:17.3600000","To":"00:00:20.3760000","Width":418.09414364095312,"Height":58.180054187830578,"SegmentType":0,"Position":"753.86504884928,261.953107159829","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_34542fcc-f9ae-448d-886f-0b90901545ab","ToolName":"TextTool","From":"00:00:17.3590000","To":"00:00:20.3930000","Width":182.13638299316779,"Height":52.181128069666542,"SegmentType":0,"Position":"863.845361015621,333.940220577798","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\complexMotorReaction_M_instruction2.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:30","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_486deee6-31d0-45fe-be93-be002414fa0d","ToolName":"EndScenario","From":"00:00:26.5340000","To":"00:00:26.9000000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowGreenSignal","Type":null,"ID":"CallingMethod_a0d536b3-b60b-4afa-af93-a787874d48ee","ToolName":"CallingMethod","From":"00:00:15.4590000","To":"00:00:15.9100000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_e016c5f6-13a8-40de-b9de-9e2fff3acb47","ToolName":"CallingMethod","From":"00:00:12.1510000","To":"00:00:12.5350000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowRedSignal","Type":null,"ID":"CallingMethod_4dbd1790-f986-4bc3-a6f8-ad05484f747e","ToolName":"CallingMethod","From":"00:00:10.3050000","To":"00:00:10.6890000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_2efc45a8-3bc2-4e03-874f-4d25cedbbc27","ToolName":"CallingMethod","From":"00:00:17.1910000","To":"00:00:17.5580000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowYellowSignal","Type":null,"ID":"CallingMethod_fc388c0d-a7f8-414d-9d83-9c4c5658c002","ToolName":"CallingMethod","From":"00:00:18.5460000","To":"00:00:18.9460000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_8b7417cb-2b0a-4b56-88c6-9122797e2600","ToolName":"CallingMethod","From":"00:00:20.5210000","To":"00:00:20.9380000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_119b2427-1699-476e-a621-1f7a1a4f84f3","ToolName":"MediaPlayer","From":"00:00:15.8790000","To":"00:00:17.2810000","Width":731.867196612952,"Height":383.9294817594382,"SegmentType":0,"Position":"596.064074949547,618.081615019534","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Red_Button.mp4","Type":"Media","ID":"MediaPlayer_282f92f2-7b58-4bec-be31-0ccac85ba241","ToolName":"MediaPlayer","From":"00:00:10.6760000","To":"00:00:12.2120000","Width":730.0383017854831,"Height":384.12170660807647,"SegmentType":0,"Position":"599.892611816403,617.889390170895","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАДАНИЕ №2","Type":"Text","ID":"TextTool_065e896d-b6c1-47f5-aeb4-2aa0c7bf5798","ToolName":"TextTool","From":"00:00:00.0500000","To":"00:00:02.0280000","Width":260.12242252930025,"Height":52.181128069666542,"SegmentType":0,"Position":"807.855383912756,139.974942757161","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами круг ","Type":"Text","ID":"TextTool_6596e8cb-c4d9-4cb0-a6f7-c7363a0e806f","ToolName":"TextTool","From":"00:00:02.0450000","To":"00:00:04.0730000","Width":316.11239963216451,"Height":54.180770109054563,"SegmentType":0,"Position":"775.861111282548,211.962056175129","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Он будет загораться ЗЕЛЕНЫМ или КРАСНЫМ цветом","Type":"Text","ID":"TextTool_8226338c-bc55-465c-8693-43f9b6a97b91","ToolName":"TextTool","From":"00:00:04.1230000","To":"00:00:07.1900000","Width":912.005727369792,"Height":68.178264384770614,"SegmentType":0,"Position":"491.911941689451,203.963488017577","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"На красный сигнал КАК МОЖНО БЫСТРЕЕ ","Type":"Text","ID":"TextTool_32a5f3e8-c721-427e-8f2e-c6428bfdbdf3","ToolName":"TextTool","From":"00:00:07.2240000","To":"00:00:12.2240000","Width":722.03973362793079,"Height":56.180412148442585,"SegmentType":0,"Position":"595.893327737627,277.950243474934","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"реагируйте нажатием на КРАСНУЮ кнопку пульта","Type":"Text","ID":"TextTool_d9672fba-1909-40b1-9770-91254b157227","ToolName":"TextTool","From":"00:00:07.2400000","To":"00:00:12.2400000","Width":800.02577316406325,"Height":66.178622345382635,"SegmentType":0,"Position":"551.901202871091,341.93878873535","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"На зеленый сигнал КАК МОЖНО БЫСТРЕЕ ","Type":"Text","ID":"TextTool_feb8c031-aeb1-4dd8-b1aa-8dd152f42e19","ToolName":"TextTool","From":"00:00:12.2850000","To":"00:00:17.2850000","Width":720.04009158854285,"Height":56.180412148442585,"SegmentType":0,"Position":"591.894043658852,277.950243474934","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"реагируйте нажатием на ЗЕЛЁНУЮ кнопку пульта","Type":"Text","ID":"TextTool_61623e0c-eea2-4439-aedf-4e0c3c7fad10","ToolName":"TextTool","From":"00:00:12.3010000","To":"00:00:17.3010000","Width":830.02040375488343,"Height":52.181128069666542,"SegmentType":0,"Position":"537.903708595375,349.937356892902","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"На ЖЕЛТЫЙ сигнал реагировать не следует!","Type":"Text","ID":"TextTool_fca86d92-e1a8-4ed5-9b01-bd75c813d6f4","ToolName":"TextTool","From":"00:00:17.3290000","To":"00:00:20.4300000","Width":696.04438711588671,"Height":54.180770109054563,"SegmentType":0,"Position":"615.889748131507,345.938072814126","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Неверный выбор кнопки  СЧИТАЕТСЯ ОШИБКОЙ!","Type":"Text","ID":"TextTool_7e16d237-08d3-4808-8dfe-ee5e54799e31","ToolName":"TextTool","From":"00:00:20.4640000","To":"00:00:23.5140000","Width":792.02720500651128,"Height":60.1796962272186,"SegmentType":0,"Position":"559.899771028643,629.887242407224","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_373d161f-f394-4117-bb0a-b804c187267f","ToolName":"TextTool","From":"00:00:23.5310000","To":"00:00:26.4300000","Width":182.13638299316767,"Height":52.181128069666443,"SegmentType":0,"Position":"863.845361015621,707.873281943356","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_539336f7-4325-4185-ac74-cd115a8ec55b","ToolName":"TextTool","From":"00:00:23.5490000","To":"00:00:26.4010000","Width":374.10201877441693,"Height":46.182201951502506,"SegmentType":0,"Position":"763.86325904622,637.885810564776","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\concentrationAttention.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:01:00","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"FirstRing","Type":null,"ID":"CallingMethod_c771db09-92be-4e3a-9bb0-bf64e859401f","ToolName":"CallingMethod","From":"00:00:10.4930000","To":"00:00:11.4570000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"AllCorrectRings","Type":null,"ID":"CallingMethod_42d4fd1c-3a82-4aa1-824c-26c99299d76d","ToolName":"CallingMethod","From":"00:00:21.4160000","To":"00:00:22.3460000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_6dae4314-6fce-43dd-ad16-7df82a6a7e6e","ToolName":"EndScenario","From":"00:00:59.2360000","To":"00:00:59.8790000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Yellow_Button.mp4","Type":"Media","ID":"MediaPlayer_58170574-3f8d-4b63-95e4-6a4d5b2c1524","ToolName":"MediaPlayer","From":"00:00:36.7410000","To":"00:00:38.5720000","Width":423.92232254719863,"Height":241.95489696288939,"SegmentType":0,"Position":"1259.94523202637,240.1492695752","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Black_Button.mp4","Type":"Media","ID":"MediaPlayer_01276369-b972-4987-a05e-dd445ee3c5b0","ToolName":"MediaPlayer","From":"00:00:41.0860000","To":"00:00:42.8390000","Width":434.09127995605729,"Height":238.14783773275167,"SegmentType":0,"Position":"1253.77555869628,239.957044726561","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Red_Button.mp4","Type":"Media","ID":"MediaPlayer_d899f9be-bd11-48e2-b55c-436daf331d79","ToolName":"MediaPlayer","From":"00:00:45.7310000","To":"00:00:47.3110000","Width":438.09056403483277,"Height":234.14855365397557,"SegmentType":0,"Position":"1251.7759166569,241.956686765949","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"UpButton","Type":null,"ID":"CallingMethod_049e5b9c-22bf-4381-abf8-83a166c65c73","ToolName":"CallingMethod","From":"00:00:37.9760000","To":"00:00:38.5840000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"DownButton","Type":null,"ID":"CallingMethod_4e9abb72-8edd-47de-8d7c-10ca50c3fb94","ToolName":"CallingMethod","From":"00:00:42.2280000","To":"00:00:42.8360000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ClickButton","Type":null,"ID":"CallingMethod_4e600562-eb84-43b5-9f26-6e1baedc959b","ToolName":"CallingMethod","From":"00:00:46.9050000","To":"00:00:47.3620000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"AllCorrectClear","Type":null,"ID":"CallingMethod_39bcdd68-44d1-44f9-9ce6-d2d5ad15ab36","ToolName":"CallingMethod","From":"00:00:47.5540000","To":"00:00:48.0440000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами строки с колец, имеющих разрывы","Type":"Text","ID":"TextTool_bb8a5a3f-41d0-4a3d-87b9-09caedf200d5","ToolName":"TextTool","From":"00:00:00.1000000","To":"00:00:05.1000000","Width":682.04689284017047,"Height":49.987471378580409,"SegmentType":0,"Position":"555.900486949867,96.1768325423227","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Просматривайте верхнюю строку","Type":"Text","ID":"TextTool_2da8f2cf-e3f1-44c1-ad9b-5fbe056af76a","ToolName":"TextTool","From":"00:00:05.1340000","To":"00:00:10.1340000","Width":516.07660357096552,"Height":45.988187299804366,"SegmentType":0,"Position":"639.885452604163,98.1764745817107","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Используйте первое кольцо в строке как образец","Type":"Text","ID":"TextTool_04a8da88-77a2-4936-ab5c-00bed5082a92","ToolName":"TextTool","From":"00:00:10.1660000","To":"00:00:15.1660000","Width":648.05297817057431,"Height":56.180412148442571,"SegmentType":0,"Position":"571.897623264971,89.9838917724605","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"И сосчитайте, сколько таких же колец в строке, включая первое","Type":"Text","ID":"TextTool_0291f0cb-1a64-4bb7-ab39-9fd55e17d839","ToolName":"TextTool","From":"00:00:15.2000000","To":"00:00:22.2000000","Width":1001.989619142252,"Height":62.179338266606607,"SegmentType":0,"Position":"417.925186232094,89.9838917724605","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFF0000","FontSize":72.0,"Text":"использовать палец – нельзя!","Type":"Text","ID":"TextTool_1116a274-9efc-4e9f-929e-82776375bea8","ToolName":"TextTool","From":"00:00:22.2670000","To":"00:00:25.2670000","Width":470.08483666504117,"Height":58.180054187830578,"SegmentType":0,"Position":"695.875429707028,91.9835338118485","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Справа имеется столбец с числами","Type":"Text","ID":"TextTool_d2de4cc2-bf00-4931-809f-bc9e63a328f4","ToolName":"TextTool","From":"00:00:25.3330000","To":"00:00:28.3000000","Width":503.80884903319833,"Height":59.831042591141113,"SegmentType":0,"Position":"1219.95418104166,90.1779064241587","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Выберите посчитанное количество с помощью кнопок","Type":"Text","ID":"TextTool_97ed58a7-0c2c-48dc-8694-d221ab446051","ToolName":"TextTool","From":"00:00:28.3330000","To":"00:00:33.3330000","Width":882.01109677897171,"Height":58.180054187830578,"SegmentType":0,"Position":"845.848582661129,87.9842497330725","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"используйте ЖЕЛТУЮ кнопку для движения вверх","Type":"Text","ID":"TextTool_32a8a87c-f9d5-4bdd-9a8d-06a157a8f6db","ToolName":"TextTool","From":"00:00:33.3670000","To":"00:00:38.3670000","Width":778.02971073079493,"Height":58.180054187830578,"SegmentType":0,"Position":"947.830326669917,87.9842497330725","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"используйте ЧЕРНУЮ кнопку для движения вниз","Type":"Text","ID":"TextTool_f5635742-46a6-42b0-b417-4553484e2e1a","ToolName":"TextTool","From":"00:00:38.4000000","To":"00:00:42.4330000","Width":752.034364218751,"Height":54.180770109054563,"SegmentType":0,"Position":"975.82531522135,87.9842497330725","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"свой выбор подтвердите нажатием красной кнопки","Type":"Text","ID":"TextTool_a6702016-2d19-4a1b-a896-87377b730029","ToolName":"TextTool","From":"00:00:42.4670000","To":"00:00:47.4670000","Width":820.02219355794318,"Height":58.180054187830578,"SegmentType":0,"Position":"905.837843842769,85.9846076936845","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"При этом вверх поднимется новая строка","Type":"Text","ID":"TextTool_0f2f63c2-cc75-451d-a0d9-4b93f4ffa350","ToolName":"TextTool","From":"00:00:47.5000000","To":"00:00:50.9330000","Width":660.05083040690261,"Height":48.181843990890542,"SegmentType":0,"Position":"1069.80849107259,91.9835338118485","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Повторяйте указанные действия со всеми строками","Type":"Text","ID":"TextTool_ece3d6ce-817d-4511-95c0-4a71847cc859","ToolName":"TextTool","From":"00:00:50.9670000","To":"00:00:53.9000000","Width":884.01073881835964,"Height":52.181128069666542,"SegmentType":0,"Position":"483.913373531899,93.9831758512365","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFF0000","FontSize":72.0,"Text":"ВНИМАНИЕ: время на просмотр всех строк ограничено!","Type":"Text","ID":"TextTool_56bf4815-4860-4524-992f-664a0264a9bc","ToolName":"TextTool","From":"00:00:53.9670000","To":"00:00:56.8670000","Width":920.00429552734386,"Height":66.178622345382635,"SegmentType":0,"Position":"459.917669059242,893.839991606441","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_32d23fcf-18dc-45a1-9b97-c2c6f0a84a47","ToolName":"TextTool","From":"00:00:56.9330000","To":"00:00:59.1330000","Width":399.99999999999994,"Height":65.829968709305021,"SegmentType":0,"Position":"737.867912534176,894.034006258139","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_cd50f6ca-c05d-4796-949e-c9fe6a517b25","ToolName":"TextTool","From":"00:00:56.9000000","To":"00:00:59.2000000","Width":174.13781483561556,"Height":48.18184399089057,"SegmentType":0,"Position":"845.848582661129,965.827105024409","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\correctiveTestSample.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:50","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_a36e4f5b-ec21-4245-893e-23074b489da7","ToolName":"EndScenario","From":"00:00:48.9320000","To":"00:00:49.4680000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"FirstRing","Type":null,"ID":"CallingMethod_a72ca5ae-f67d-4a9a-ab14-d3b120c3fce8","ToolName":"CallingMethod","From":"00:00:12.6570000","To":"00:00:13.1140000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"AllCorrectRings","Type":null,"ID":"CallingMethod_b3421f72-9c89-4c41-a67d-8d349c95f062","ToolName":"CallingMethod","From":"00:00:18.3090000","To":"00:00:18.7770000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"AllCorrectClear","Type":null,"ID":"CallingMethod_6151d96e-c687-4fa2-b127-aaeff90f411c","ToolName":"CallingMethod","From":"00:00:38.4660000","To":"00:00:39.1300000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ClickButton","Type":null,"ID":"CallingMethod_4215e3bb-1ba5-44b3-ba11-9d438d1bec42","ToolName":"CallingMethod","From":"00:00:34.9500000","To":"00:00:35.3960000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами строки с буквами","Type":"Text","ID":"TextTool_064f2506-4090-43bc-bc33-7c74840af9ac","ToolName":"TextTool","From":"00:00:00.0840000","To":"00:00:05.0840000","Width":456.08734238932522,"Height":54.180770109054563,"SegmentType":0,"Position":"711.872566022132,69.9874713785804","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Просматривайте верхнюю строку","Type":"Text","ID":"TextTool_f81bbbc0-f363-45cd-817f-101bc6c6d236","ToolName":"TextTool","From":"00:00:05.1560000","To":"00:00:10.1560000","Width":526.07481376790565,"Height":58.180054187830578,"SegmentType":0,"Position":"673.87936727376,67.9878293391924","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Используйте первую букву в строке как образец","Type":"Text","ID":"TextTool_1e9d26fd-993e-46ac-ba2a-48bf5882b333","ToolName":"TextTool","From":"00:00:10.2010000","To":"00:00:15.2010000","Width":671.87614562825206,"Height":59.985681575520431,"SegmentType":0,"Position":"596.065864752606,66.1822019515025","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"И сосчитайте, сколько таких же букв в строке, включая первую","Type":"Text","ID":"TextTool_fb116294-1eb9-4747-80c0-cb883fafcfa7","ToolName":"TextTool","From":"00:00:15.2450000","To":"00:00:20.2450000","Width":959.99713631510417,"Height":58.180054187830578,"SegmentType":0,"Position":"453.918742941079,65.9881872998044","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"использовать палец – нельзя!","Type":"Text","ID":"TextTool_2cd4a53d-aed4-435a-93e6-31f5713a4017","ToolName":"TextTool","From":"00:00:20.2900000","To":"00:00:23.3000000","Width":400.09736528646096,"Height":48.181843990890528,"SegmentType":0,"Position":"739.867554573564,71.9871134179684","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Справа имеется столбец с числами","Type":"Text","ID":"TextTool_90fd12a6-4e4b-486f-b46f-6600cff8036b","ToolName":"TextTool","From":"00:00:23.3560000","To":"00:00:28.3560000","Width":606.060495343426,"Height":48.181843990890528,"SegmentType":0,"Position":"1109.80133186035,71.9871134179684","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"С помощью курсора мыши выберите нужное число ","Type":"Text","ID":"TextTool_38cf05e0-391c-455b-bfcc-763dc2f52784","ToolName":"TextTool","From":"00:00:28.4280000","To":"00:00:33.4280000","Width":955.8253152213498,"Height":52.18112806966667,"SegmentType":0,"Position":"808.027920927735,857.846434897457","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"и нажмите левую кнопку мыши","Type":"Text","ID":"TextTool_e0247cce-4acf-4de6-9f7c-cd09d6418e22","ToolName":"TextTool","From":"00:00:28.4840000","To":"00:00:33.4840000","Width":537.90012898925465,"Height":72.177548463546827,"SegmentType":0,"Position":"1221.95382308105,929.833548315425","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Вверх поднимется новая строка","Type":"Text","ID":"TextTool_c64ccb20-585e-48e5-9881-1ae24d3faf7f","ToolName":"TextTool","From":"00:00:33.5280000","To":"00:00:36.5110000","Width":521.90299267415094,"Height":58.180054187830592,"SegmentType":0,"Position":"574.069802319338,855.846792858069","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Повторяйте указанные действия со всеми строками","Type":"Text","ID":"TextTool_5347be7f-3786-4f8b-8649-58c2f277e9c4","ToolName":"TextTool","From":"00:00:36.5660000","To":"00:00:41.5660000","Width":870.01324454264363,"Height":60.1796962272186,"SegmentType":0,"Position":"401.92804991699,853.847150818681","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВНИМАНИЕ: время на просмотр всех строк ограничено!","Type":"Text","ID":"TextTool_f736d84d-d4f5-4e62-b671-23bb62617645","ToolName":"TextTool","From":"00:00:41.5830000","To":"00:00:45.5690000","Width":953.99821019694014,"Height":60.1796962272186,"SegmentType":0,"Position":"369.933777286782,853.847150818681","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ  ВНИМАТЕЛЬНЫ. ","Type":"Text","ID":"TextTool_390972ac-14dc-4942-bc8e-5546eaf128c5","ToolName":"TextTool","From":"00:00:45.6800000","To":"00:00:48.6620000","Width":396.09808120768486,"Height":46.1822019515025,"SegmentType":0,"Position":"645.884378722328,863.845361015621","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_86ab7875-53d2-4cd7-a0d9-e0253a1b37c1","ToolName":"TextTool","From":"00:00:45.7360000","To":"00:00:48.8020000","Width":176.13745687500372,"Height":54.180770109054563,"SegmentType":0,"Position":"757.864332928056,937.832116472977","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\emotionalStability.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:01:10","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ScenarioStart","Type":null,"ID":"CallingMethod_a03cf672-08c8-438d-b2c6-1cac46664cec","ToolName":"CallingMethod","From":"00:00:05.8350000","To":"00:00:06.9740000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_e6014d0f-0e96-408c-a21c-df7e1f86a879","ToolName":"EndScenario","From":"00:01:01.0140000","To":"00:01:01.8080000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ScenarioStop","Type":null,"ID":"CallingMethod_4d735de2-4c4b-4e19-80eb-105146c16b3b","ToolName":"CallingMethod","From":"00:00:53.2470000","To":"00:00:53.7990000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Blue_Button.mp4","Type":"Media","ID":"MediaPlayer_67aa5ae9-e511-4fd8-9668-eb9c32dd84b1","ToolName":"MediaPlayer","From":"00:00:29.4800000","To":"00:00:31.8290000","Width":595.89153793456717,"Height":323.94022057779807,"SegmentType":0,"Position":"32.1650198421272,352.129223780928","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\White_Button.mp4","Type":"Media","ID":"MediaPlayer_f23c0a0c-2e61-4266-8818-c1b23e513215","ToolName":"MediaPlayer","From":"00:00:36.7210000","To":"00:00:38.9620000","Width":577.89296977701849,"Height":321.94057853841,"SegmentType":0,"Position":"1261.94666386881,352.129223780928","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед вами прямоугольник","Type":"Text","ID":"TextTool_fa805269-2a06-4a9f-bf76-d60ebdc96166","ToolName":"TextTool","From":"00:00:00.3040000","To":"00:00:05.3420000","Width":655.88079911620787,"Height":67.9860395361327,"SegmentType":0,"Position":"656.053336131186,216.153565102543","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"В прямоугольнике будут меняться цифры от 1 до 9","Type":"Text","ID":"TextTool_0234a0d1-be61-4e56-8dbe-9ac560aa68bb","ToolName":"TextTool","From":"00:00:05.4610000","To":"00:00:10.4610000","Width":977.99391466959617,"Height":66.178622345382621,"SegmentType":0,"Position":"495.911225768227,215.961340253905","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда поток сменяющихся цифр прерывается ","Type":"Text","ID":"TextTool_405db2e8-02b9-4348-a7c5-232dcf17a4ce","ToolName":"TextTool","From":"00:00:10.5260000","To":"00:00:17.5690000","Width":864.01431842447971,"Height":66.178622345382635,"SegmentType":0,"Position":"553.900844910479,115.979238284505","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"два раза подряд красными вставками","Type":"Text","ID":"TextTool_5dbeb9a8-c422-4f34-8ca0-f7f395180d95","ToolName":"TextTool","From":"00:00:10.5660000","To":"00:00:17.6090000","Width":772.030784612631,"Height":62.179338266606621,"SegmentType":0,"Position":"603.89189589518,215.961340253905","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВАША ЗАДАЧА – заметить цифру, которая ","Type":"Text","ID":"TextTool_2c09572c-5243-4612-a928-f5f54b0ec558","ToolName":"TextTool","From":"00:00:17.6870000","To":"00:00:24.6920000","Width":770.03114257324307,"Height":66.178622345382635,"SegmentType":0,"Position":"601.892253855792,113.979596245117","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"появляется между красными вставками","Type":"Text","ID":"TextTool_6dbf4e94-7869-4897-b318-63cd24fe553b","ToolName":"TextTool","From":"00:00:17.7270000","To":"00:00:24.8110000","Width":720.04009158854285,"Height":62.179338266606621,"SegmentType":0,"Position":"629.887242407224,213.961698214517","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕ нажмите на СИНЮЮ ","Type":"Text","ID":"TextTool_c8487c6f-9711-4e1c-8df0-17c244832e9f","ToolName":"TextTool","From":"00:00:24.8500000","To":"00:00:31.8540000","Width":834.01968783365953,"Height":72.177548463546671,"SegmentType":0,"Position":"39.9928407877603,161.971005190429","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"кнопку, если число ЧЕТНОЕ","Type":"Text","ID":"TextTool_1dc06e27-ad20-4bfc-a9ed-abfeee7254a9","ToolName":"TextTool","From":"00:00:24.8900000","To":"00:00:31.8540000","Width":538.07266600423384,"Height":68.178264384770614,"SegmentType":0,"Position":"37.9931987483724,247.955612884113","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕ нажмите на БЕЛУЮ ","Type":"Text","ID":"TextTool_8f815f43-1e46-4ff2-a0f0-613c2ea8e607","ToolName":"TextTool","From":"00:00:31.9330000","To":"00:00:38.9770000","Width":788.02792092773518,"Height":72.177548463546671,"SegmentType":0,"Position":"1051.81171271809,159.971363151041","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"кнопку, если число НЕЧЕТНОЕ","Type":"Text","ID":"TextTool_bfc154db-a575-4c5b-b005-7180d7da7735","ToolName":"TextTool","From":"00:00:31.9720000","To":"00:00:39.0160000","Width":602.06121126465,"Height":68.178264384770614,"SegmentType":0,"Position":"1233.7791383024,247.955612884113","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"На определенном этапе теста вы услышите звуковую информацию","Type":"Text","ID":"TextTool_c0c69875-3240-4569-86e9-3251d2bf0019","ToolName":"TextTool","From":"00:00:39.1350000","To":"00:00:44.1350000","Width":1159.9613402539053,"Height":54.180770109054563,"SegmentType":0,"Position":"391.92983972005,119.978522363281","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"мешающего и оценивающего характера","Type":"Text","ID":"TextTool_73dfab94-b321-4cda-a417-a7c9d50bce2a","ToolName":"TextTool","From":"00:00:44.2400000","To":"00:00:49.2400000","Width":770.03114257324307,"Height":68.178264384770657,"SegmentType":0,"Position":"581.895833461912,213.961698214517","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Продолжайте действовать согласно инструкции","Type":"Text","ID":"TextTool_52ddc070-edb2-4f56-9a7e-7eb3dc993b58","ToolName":"TextTool","From":"00:00:49.3440000","To":"00:00:52.3520000","Width":834.01968783365953,"Height":60.1796962272186,"SegmentType":0,"Position":"549.901560831703,167.969931308593","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Неверный выбор кнопки","Type":"Text","ID":"TextTool_0c0bf2b1-7cc4-4591-aa3e-5a1e7a1b592e","ToolName":"TextTool","From":"00:00:52.4310000","To":"00:00:57.4310000","Width":482.08268890136958,"Height":72.177548463546671,"SegmentType":0,"Position":"731.868986416012,719.871134179684","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":" ЯВЛЯЕТСЯ ОШИБКОЙ!","Type":"Text","ID":"TextTool_b8128aab-8069-4f0c-b305-b9ede596c886","ToolName":"TextTool","From":"00:00:52.5100000","To":"00:00:57.5100000","Width":408.09593344401321,"Height":60.179696227218642,"SegmentType":0,"Position":"767.862543124996,803.85609983398","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_c638c4dc-6e43-42ff-b0c8-82370b086595","ToolName":"TextTool","From":"00:00:57.5750000","To":"00:01:00.5820000","Width":452.0880583105494,"Height":54.180770109054492,"SegmentType":0,"Position":"745.866480691728,727.869702337236","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_5a1b47b8-b5b0-415a-8590-2a0f2e65a006","ToolName":"TextTool","From":"00:00:57.5750000","To":"00:01:00.5820000","Width":214.13065562337602,"Height":60.179696227218642,"SegmentType":0,"Position":"863.845361015621,803.85609983398","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\estimationOfStabilityOfAttention.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:30","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"LearningTick_2000ms","Type":null,"ID":"CallingMethod_9c6978da-6d14-4723-8dee-b5337efa6e5d","ToolName":"CallingMethod","From":"00:00:10.1790000","To":"00:00:10.7520000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"LearningTick_2000ms","Type":null,"ID":"CallingMethod_eb2ea7d1-ff5c-45e1-88e5-75378b2269f7","ToolName":"CallingMethod","From":"00:00:12.8040000","To":"00:00:13.3090000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"LearningTick_2000ms","Type":null,"ID":"CallingMethod_3b3b62aa-5b45-4c36-af17-5d1d0031315a","ToolName":"CallingMethod","From":"00:00:15.0590000","To":"00:00:15.6650000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"LearningTick_2000ms","Type":null,"ID":"CallingMethod_fdfc246b-ea0c-459d-9c48-d96646fc0aac","ToolName":"CallingMethod","From":"00:00:17.4310000","To":"00:00:18.0030000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_af8308f7-d0ef-415b-bb2a-9b69d15cabe6","ToolName":"EndScenario","From":"00:00:28.5480000","To":"00:00:28.8560000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Blue_Button.mp4","Type":"Media","ID":"MediaPlayer_2626bf34-1d59-4ae1-a651-b995e76c7ab9","ToolName":"MediaPlayer","From":"00:00:10.1460000","To":"00:00:11.6940000","Width":569.896191422523,"Height":309.94272630208229,"SegmentType":0,"Position":"132.147121811528,396.121348647464","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\White_Button.mp4","Type":"Media","ID":"MediaPlayer_ba46bd0e-9118-47ba-96de-3ee0226f5196","ToolName":"MediaPlayer","From":"00:00:18.7270000","To":"00:00:20.2410000","Width":559.89798122558636,"Height":307.94308426269419,"SegmentType":0,"Position":"1171.96098229329,394.121706608076","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед вами квадрат","Type":"Text","ID":"TextTool_4e2017f7-c98a-43c4-a56f-fa7aa667f2fe","ToolName":"TextTool","From":"00:00:00.1520000","To":"00:00:05.1490000","Width":391.92804991698944,"Height":55.986397496744075,"SegmentType":0,"Position":"750.036511982423,242.150701417647","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"В квадрате будут появляться числа от 1 до 9","Type":"Text","ID":"TextTool_d9b962c2-2222-4169-83d3-5f3c3fafb39f","ToolName":"TextTool","From":"00:00:05.1650000","To":"00:00:10.1790000","Width":909.83533811848463,"Height":81.983533811848474,"SegmentType":0,"Position":"516.078393374026,226.151775299484","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕЕ ","Type":"Text","ID":"TextTool_c1e9c9c5-d859-4a6c-bd89-f2c2112d0882","ToolName":"TextTool","From":"00:00:10.1970000","To":"00:00:15.1970000","Width":476.08376278320549,"Height":58.180054187830578,"SegmentType":0,"Position":"117.978880323893,181.967425584309","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"нажмите на синюю кнопку, если число ЧЕТНОЕ","Type":"Text","ID":"TextTool_760bcead-d9e4-4868-b929-4798ace7db1f","ToolName":"TextTool","From":"00:00:10.2130000","To":"00:00:15.2130000","Width":912.00572736979188,"Height":72.177548463546671,"SegmentType":0,"Position":"125.977448481444,273.950959396157","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕЕ нажмите на белую кнопку,","Type":"Text","ID":"TextTool_176dd31f-856e-4050-8fc9-6a622c7b98fb","ToolName":"TextTool","From":"00:00:15.2270000","To":"00:00:20.2270000","Width":999.98997710286426,"Height":90.174326818038779,"SegmentType":0,"Position":"731.868986416012,163.970647229817","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"если число НЕЧЕТНОЕ","Type":"Text","ID":"TextTool_9dec0e0d-c076-4ef3-9ad7-85cf99b8df26","ToolName":"TextTool","From":"00:00:15.2610000","To":"00:00:20.2610000","Width":424.0930697591171,"Height":80.1761166210987,"SegmentType":0,"Position":"1303.76660968098,273.950959396157","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Неверный выбор кнопки ЯВЛЯЕТСЯ ОШИБКОЙ","Type":"Text","ID":"TextTool_0be047b5-6759-4d25-b80d-ecb8a783ce6a","ToolName":"TextTool","From":"00:00:20.3090000","To":"00:00:25.3090000","Width":973.99463059082018,"Height":76.176832542322671,"SegmentType":0,"Position":"475.914805374347,761.863617006832","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_4ffa1f10-5e1c-4f44-856b-ebbea89a3f27","ToolName":"TextTool","From":"00:00:25.3390000","To":"00:00:28.3510000","Width":416.09450160156536,"Height":64.178980305994514,"SegmentType":0,"Position":"741.867196612952,769.862185164384","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_880fd82d-1a38-446d-aee8-3006cd202912","ToolName":"TextTool","From":"00:00:25.3390000","To":"00:00:28.3850000","Width":196.13387726888422,"Height":58.180054187830592,"SegmentType":0,"Position":"847.848224700516,843.848940621741","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\estimationOfStabilityToMonotonistance.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:01:00","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Start","Type":null,"ID":"CallingMethod_13e312c2-9c07-49ea-869d-6875dd0dde4a","ToolName":"CallingMethod","From":"00:00:05.6310000","To":"00:00:06.9350000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_a1e78620-04e8-4012-8c26-8e83e99a0b8b","ToolName":"EndScenario","From":"00:00:33.4600000","To":"00:00:34.2230000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Stop","Type":null,"ID":"CallingMethod_0f84f4a6-23e7-4635-8ed5-9d951bb4938a","ToolName":"CallingMethod","From":"00:00:31.4730000","To":"00:00:33.1200000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_ed8435d6-e539-476a-9af8-71de76cc3a3f","ToolName":"MediaPlayer","From":"00:00:26.8120000","To":"00:00:30.0030000","Width":563.89726530435928,"Height":321.94057853841,"SegmentType":0,"Position":"672.05047244629,430.115263317061","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами окружность, состоящая из точек ","Type":"Text","ID":"TextTool_9119c949-f7e0-4724-80b8-6ba45f12192d","ToolName":"TextTool","From":"00:00:00.3050000","To":"00:00:05.3050000","Width":752.034364218751,"Height":56.1804121484426,"SegmentType":0,"Position":"27.9949885514322,31.9942726302082","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Зелёное пятно будет последовательно ","Type":"Text","ID":"TextTool_8904f160-7fed-440c-b449-474f525b16ee","ToolName":"TextTool","From":"00:00:05.6980000","To":"00:00:10.6980000","Width":590.063359028322,"Height":46.182201951502506,"SegmentType":0,"Position":"41.9924828271483,37.9931987483722","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"переходить с точки на точку","Type":"Text","ID":"TextTool_861dbc4b-62fd-47cf-8358-fe83cbfa5150","ToolName":"TextTool","From":"00:00:05.7320000","To":"00:00:10.7320000","Width":444.08949015299743,"Height":66.178622345382621,"SegmentType":0,"Position":"29.99463059082,107.980670126953","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда зелёное пятно будет совершать ","Type":"Text","ID":"TextTool_5c679a57-c354-476f-8ddb-ccdbaea93cd7","ToolName":"TextTool","From":"00:00:11.0910000","To":"00:00:16.0910000","Width":678.0476087613946,"Height":50.181486030278563,"SegmentType":0,"Position":"619.889032210284,391.92983972005","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ПЕРЕСКОК ЧЕРЕЗ ОДНУ ПОЗИЦИЮ","Type":"Text","ID":"TextTool_3011894a-fa12-4971-a0bb-a64b0e4040c0","ToolName":"TextTool","From":"00:00:11.1590000","To":"00:00:16.1590000","Width":622.05763165853011,"Height":56.180412148442542,"SegmentType":0,"Position":"649.883662801104,491.911941689451","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВНИМАТЕЛЬНО СЛЕДИТЕ ЗА ПЯТНОМ","Type":"Text","ID":"TextTool_fea93337-1978-40c0-bff3-86c1345c03d1","ToolName":"TextTool","From":"00:00:16.5170000","To":"00:00:19.5030000","Width":692.04510303711049,"Height":72.177548463546657,"SegmentType":0,"Position":"613.890106092119,385.930913601886","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Как только вы заметите такой перескок пятна","Type":"Text","ID":"TextTool_3e3a27ca-764b-4576-9ea2-17176c1cbc7d","ToolName":"TextTool","From":"00:00:19.7400000","To":"00:00:24.7400000","Width":712.04152343099065,"Height":58.180054187830478,"SegmentType":0,"Position":"601.892253855791,387.930555641274","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕЕ","Type":"Text","ID":"TextTool_0c696767-34b3-4ff0-b0f0-c952e418eb93","ToolName":"TextTool","From":"00:00:24.8950000","To":"00:00:29.8950000","Width":412.0952175227892,"Height":52.181128069666613,"SegmentType":0,"Position":"751.865406809892,255.954181041665","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":" нажмите зеленую кнопку пульта","Type":"Text","ID":"TextTool_88f25bcb-a5a1-4ccf-8602-f4fecdca5d74","ToolName":"TextTool","From":"00:00:24.9300000","To":"00:00:29.9300000","Width":576.065864752606,"Height":58.180054187830478,"SegmentType":0,"Position":"667.880441155596,333.940220577798","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_1f71fae7-8dc6-414d-9392-5aadeda78912","ToolName":"TextTool","From":"00:00:30.1530000","To":"00:00:33.1030000","Width":414.09485956217725,"Height":64.178980305994628,"SegmentType":0,"Position":"749.865764770504,427.923396429034","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_fbb7051a-baae-4d6f-be02-183eac3f935b","ToolName":"TextTool","From":"00:00:30.2210000","To":"00:00:33.1370000","Width":188.13530911133182,"Height":54.180770109054492,"SegmentType":0,"Position":"867.844645094397,517.907288201495","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\expressSampleVigilance.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:01:20","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Start","Type":null,"ID":"CallingMethod_c3a2277d-66bf-4f40-84e8-2a0e2895bafd","ToolName":"CallingMethod","From":"00:00:02.4830000","To":"00:00:05.2210000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_c8481cc4-d315-4ccc-a9d1-1ffa2658225a","ToolName":"EndScenario","From":"00:00:48.8520000","To":"00:00:50.0170000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Stop","Type":null,"ID":"CallingMethod_1594bb75-8212-45e4-8b88-7dd828d33257","ToolName":"CallingMethod","From":"00:00:47.9100000","To":"00:00:48.7220000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_4c17ac34-5896-4224-9da7-225ef2807ba6","ToolName":"MediaPlayer","From":"00:00:24.0670000","To":"00:00:26.0950000","Width":459.9158792561829,"Height":251.9531071598293,"SegmentType":0,"Position":"22.1668096451866,276.142826284184","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_607a09d2-3578-4d22-a73d-812872927f17","ToolName":"MediaPlayer","From":"00:00:39.8430000","To":"00:00:42.1090000","Width":454.08770034993728,"Height":242.14712181152765,"SegmentType":0,"Position":"23.9957044726561,281.94952755371","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами окружность","Type":"Text","ID":"TextTool_3c1a7e50-1085-4e81-85a4-7655a2754ffd","ToolName":"TextTool","From":"00:00:00.2240000","To":"00:00:05.2240000","Width":382.10058693196885,"Height":48.181843990890528,"SegmentType":0,"Position":"759.863974967444,273.950959396157","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Зелёное пятно будет последовательно переходить ","Type":"Text","ID":"TextTool_1c990134-02d7-476d-9e9b-a1dd9005c7ce","ToolName":"TextTool","From":"00:00:05.2890000","To":"00:00:10.2890000","Width":738.03686994303484,"Height":52.181128069666542,"SegmentType":0,"Position":"587.894759580075,369.933777286782","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"с точки на точку","Type":"Text","ID":"TextTool_ec9974d5-b0d6-41e3-87d4-72bd78858128","ToolName":"TextTool","From":"00:00:05.3780000","To":"00:00:10.3780000","Width":246.12492825358422,"Height":54.180770109054563,"SegmentType":0,"Position":"1075.80741719075,459.917669059242","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда зелёное пятно будет совершать ","Type":"Text","ID":"TextTool_20219f58-606a-4fd5-9fea-ef90a88a238f","ToolName":"TextTool","From":"00:00:10.4880000","To":"00:00:15.4880000","Width":652.05226224935052,"Height":48.181843990890528,"SegmentType":0,"Position":"627.887600367836,271.95131735677","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ПЕРЕСКОК через одну позицию","Type":"Text","ID":"TextTool_fe7c83a4-6f34-4bbf-8642-14c4b6727ce9","ToolName":"TextTool","From":"00:00:10.5770000","To":"00:00:15.5770000","Width":506.07839337402567,"Height":50.181486030278549,"SegmentType":0,"Position":"703.87399786458,371.93341932617","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВНИМАТЕЛЬНО СЛЕДИТЕ ЗА ПЯТНОМ","Type":"Text","ID":"TextTool_a9d7d6a0-ef20-4100-af33-ea7b80af32e8","ToolName":"TextTool","From":"00:00:15.6860000","To":"00:00:20.6860000","Width":594.062643107098,"Height":54.180770109054563,"SegmentType":0,"Position":"671.879725234372,271.95131735677","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Как только вы заметите такой ПЕРЕСКОК пятна","Type":"Text","ID":"TextTool_02f5d1bc-a382-4e90-89ac-2cc171606e45","ToolName":"TextTool","From":"00:00:20.8400000","To":"00:00:25.8400000","Width":714.0411654703787,"Height":66.178622345382635,"SegmentType":0,"Position":"27.994988551432,39.9928407877602","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕЕ ","Type":"Text","ID":"TextTool_60fe22e4-f7c6-4252-acef-59f32f8df42a","ToolName":"TextTool","From":"00:00:20.9300000","To":"00:00:25.9300000","Width":384.10022897135678,"Height":70.177906424158692,"SegmentType":0,"Position":"27.9949885514325,107.980670126953","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"нажмите зеленую кнопку пульта","Type":"Text","ID":"TextTool_05984870-db17-4f8b-93a4-01d6e62c4bd1","ToolName":"TextTool","From":"00:00:21.0640000","To":"00:00:26.0640000","Width":572.06658067382989,"Height":60.179696227218585,"SegmentType":0,"Position":"27.9949885514322,183.967067623697","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда в центре круга будет зажигаться жёлтый сигнал.","Type":"Text","ID":"TextTool_c9add647-e3f5-474e-a4ca-cd4b7d7a2037","ToolName":"TextTool","From":"00:00:26.2630000","To":"00:00:31.2630000","Width":810.02398336100373,"Height":57.986039536132409,"SegmentType":0,"Position":"547.901918792315,428.117411080733","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"это значит, что скоро ","Type":"Text","ID":"TextTool_cae97a7f-30ab-4a7a-88c2-c645268c3a83","ToolName":"TextTool","From":"00:00:31.4170000","To":"00:00:36.4170000","Width":354.10559838053689,"Height":46.182201951502513,"SegmentType":0,"Position":"775.861111282548,595.893327737627","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"последует ПЕРЕСКОК  зелёного пятна","Type":"Text","ID":"TextTool_c0317d86-90a3-4fcd-b0d2-09f4c68d02d3","ToolName":"TextTool","From":"00:00:31.5520000","To":"00:00:36.5520000","Width":606.06049534342617,"Height":50.18148603027862,"SegmentType":0,"Position":"649.883662801104,669.880083194984","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕЕ ","Type":"Text","ID":"TextTool_f5b0e889-437b-4ec1-9ac1-77ec9c000bf3","ToolName":"TextTool","From":"00:00:36.6620000","To":"00:00:41.6620000","Width":384.100228971357,"Height":58.180054187830592,"SegmentType":0,"Position":"25.9953465120441,45.9917669059243","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"нажмите зеленую кнопку пульта, ","Type":"Text","ID":"TextTool_1a586daa-47e7-4cca-b6f6-f497e1a6ba7a","ToolName":"TextTool","From":"00:00:36.7960000","To":"00:00:41.7960000","Width":532.07373988606969,"Height":50.181486030278521,"SegmentType":0,"Position":"27.9949885514322,117.978880323893","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"когда произойдет перескок","Type":"Text","ID":"TextTool_4b83752a-5513-454f-b87c-be66b5345fe2","ToolName":"TextTool","From":"00:00:37.0200000","To":"00:00:42.0200000","Width":446.08913219238531,"Height":54.180770109054549,"SegmentType":0,"Position":"29.9946305908202,185.966709663085","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Продолжительность теста – 4 мин","Type":"Text","ID":"TextTool_64c13a02-c079-4cc1-a680-ee4347ba9ffc","ToolName":"TextTool","From":"00:00:42.2180000","To":"00:00:45.4010000","Width":560.0687284375017,"Height":46.182201951502407,"SegmentType":0,"Position":"677.878651352536,673.87936727376","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_01e43931-a6da-44f6-bd3d-e4f2da1ff4d4","ToolName":"TextTool","From":"00:00:45.5350000","To":"00:00:48.3140000","Width":428.0923538378932,"Height":50.181486030278506,"SegmentType":0,"Position":"739.867554573564,593.893685698239","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_fcd7d85b-e8dd-4816-94e7-f12a6b3a1230","ToolName":"TextTool","From":"00:00:45.6690000","To":"00:00:48.5380000","Width":190.13495115071996,"Height":52.181128069666443,"SegmentType":0,"Position":"857.846434897457,669.880083194984","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\feelingTime.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:45","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_22be27e1-3239-4331-94a7-b11b2c5674e0","ToolName":"EndScenario","From":"00:00:22.8690000","To":"00:00:23.4340000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Red_Button.mp4","Type":"Media","ID":"MediaPlayer_5976d55e-ed28-41e0-854a-f42cd17afa3a","ToolName":"MediaPlayer","From":"00:00:17.2390000","To":"00:00:19.2870000","Width":679.87650358886413,"Height":383.92769195637834,"SegmentType":0,"Position":"610.061569225262,636.080183177086","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"На пульте 3 раза, через одинаковые интервалы ","Type":"Text","ID":"TextTool_ffb20c25-72ca-40df-beef-4b7d9f7339a6","ToolName":"TextTool","From":"00:00:00.0750000","To":"00:00:05.0750000","Width":690.04546099772267,"Height":56.180412148442585,"SegmentType":0,"Position":"607.891179973956,201.963845978189","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":70.064748201438874,"Text":"времени, будет загораться и гаснуть красная лампочка ","Type":"Text","ID":"TextTool_766a1d31-dee5-420e-8a1a-7efe64bd2d07","ToolName":"TextTool","From":"00:00:00.1490000","To":"00:00:05.1490000","Width":894.00894901529989,"Height":64.178980305994614,"SegmentType":0,"Position":"507.909078004555,283.949169593097","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАПОМНИТЕ ВРЕМЯ СВЕЧЕНИЯ лампочки. ","Type":"Text","ID":"TextTool_b6d80547-ce18-40b5-91b1-9db21e9cff4a","ToolName":"TextTool","From":"00:00:05.1990000","To":"00:00:09.0800000","Width":678.0476087613946,"Height":54.180770109054563,"SegmentType":0,"Position":"629.887242407224,201.963845978189","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Это - образец для повторения.","Type":"Text","ID":"TextTool_8fd85db8-ae9c-4aac-ab34-344748221538","ToolName":"TextTool","From":"00:00:05.2490000","To":"00:00:09.1540000","Width":476.08376278320532,"Height":48.181843990890513,"SegmentType":0,"Position":"715.871850100909,291.947737750649","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"В 4-й раз лампочка загорится и Вам следует самостоятельно ПОГАСИТЬ её, ","Type":"Text","ID":"TextTool_04691902-b244-476b-a0f3-cdc10bf098f4","ToolName":"TextTool","From":"00:00:09.2040000","To":"00:00:14.2040000","Width":1105.9710051904285,"Height":56.180412148442542,"SegmentType":0,"Position":"429.923038468423,201.963845978189","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"нажав на КРАСНУЮ кнопку тогда, ","Type":"Text","ID":"TextTool_b4902553-7b84-4527-8799-048286adf327","ToolName":"TextTool","From":"00:00:14.2530000","To":"00:00:19.2530000","Width":498.07982521647352,"Height":44.182559912114471,"SegmentType":0,"Position":"703.87399786458,291.94773775065","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"когда длительность свечения, по вашему мнению,","Type":"Text","ID":"TextTool_5c1e7d5e-d7de-4299-9193-683148b34702","ToolName":"TextTool","From":"00:00:14.3280000","To":"00:00:19.3280000","Width":812.02362540039132,"Height":48.181843990890528,"SegmentType":0,"Position":"547.901918792315,381.93162952311","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ. ","Type":"Text","ID":"TextTool_872881fd-cc92-486c-b85f-b09229e36b09","ToolName":"TextTool","From":"00:00:19.4780000","To":"00:00:22.4380000","Width":400.09736528646147,"Height":70.177906424158778,"SegmentType":0,"Position":"747.866122731116,451.919100901691","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":22.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_bda8205b-5793-44a2-801b-b2c9012977da","ToolName":"TextTool","From":"00:00:19.6030000","To":"00:00:22.6620000","Width":192.13459319010792,"Height":54.180770109054563,"SegmentType":0,"Position":"849.847866739905,547.901918792315","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"совпадет с образцом","Type":"Text","ID":"TextTool_7faddfcb-69a3-40c2-b8bb-4186ce15126f","ToolName":"TextTool","From":"00:00:14.2940000","To":"00:00:19.2940000","Width":356.10524041992483,"Height":62.179338266606621,"SegmentType":0,"Position":"771.861827203772,457.918027019855","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\game5.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:35","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Start","Type":null,"ID":"CallingMethod_c61c6570-32d7-4171-9d3b-ae44cdd9283b","ToolName":"CallingMethod","From":"00:00:10.3080000","To":"00:00:10.8320000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"PressNumber4","Type":null,"ID":"CallingMethod_3cbb25e4-c8da-48f2-be09-25189fea21ed","ToolName":"CallingMethod","From":"00:00:11.3080000","To":"00:00:12.1990000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"PressNumber5","Type":null,"ID":"CallingMethod_fb3c12f6-90e8-481d-b185-0587e6391f4d","ToolName":"CallingMethod","From":"00:00:12.3610000","To":"00:00:13.1380000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"PressNumber3","Type":null,"ID":"CallingMethod_6d7d8fe4-dc6b-44fb-986b-d6520daf2193","ToolName":"CallingMethod","From":"00:00:13.3060000","To":"00:00:13.9910000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"PressNumber4","Type":null,"ID":"CallingMethod_bedcaf92-e713-4ad2-8930-7421c683659b","ToolName":"CallingMethod","From":"00:00:14.1320000","To":"00:00:14.8400000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"PressNumber5","Type":null,"ID":"CallingMethod_99e5db42-995e-4b02-9455-e292f406f724","ToolName":"CallingMethod","From":"00:00:14.9660000","To":"00:00:15.7430000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"PressNumber3","Type":null,"ID":"CallingMethod_59b581b6-7977-4ba2-aeb5-14f8dee1b982","ToolName":"CallingMethod","From":"00:00:15.9040000","To":"00:00:16.5430000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"PressNumber2","Type":null,"ID":"CallingMethod_0d3458cc-d898-4b92-a5c6-e370baa302ec","ToolName":"CallingMethod","From":"00:00:16.7290000","To":"00:00:17.5690000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"PressNumber1","Type":null,"ID":"CallingMethod_4beba25c-c94b-4485-a4c6-2b368e568af4","ToolName":"CallingMethod","From":"00:00:17.8020000","To":"00:00:18.3960000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"PressNumber4","Type":null,"ID":"CallingMethod_dcae35e9-6bd8-4398-8dfe-ef67c0379f26","ToolName":"CallingMethod","From":"00:00:18.6000000","To":"00:00:19.3990000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"PressNumber5","Type":null,"ID":"CallingMethod_d440f459-427f-4062-8dc3-276c9a8b20b0","ToolName":"CallingMethod","From":"00:00:19.6500000","To":"00:00:20.4500000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_fe5dc26a-11aa-471e-baff-62cad1d86d87","ToolName":"EndScenario","From":"00:00:26.8150000","To":"00:00:27.2420000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"SetEtalon","Type":null,"ID":"CallingMethod_1c73d7c9-357e-4ac8-9ae8-a9a86775cffc","ToolName":"CallingMethod","From":"00:00:00.0980000","To":"00:00:00.5300000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами прямоугольник, в котором есть цифры от 1 до 5. ","Type":"Text","ID":"TextTool_4f04f887-a932-491e-9cf7-71298b010688","ToolName":"TextTool","From":"00:00:00.0780000","To":"00:00:05.0780000","Width":1059.9792382845049,"Height":80.1761166210987,"SegmentType":0,"Position":"419.924828271483,99.9821019694006","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Одна ячейка пустая.","Type":"Text","ID":"TextTool_f90f7e36-cb60-46b5-bebf-038577d13d08","ToolName":"TextTool","From":"00:00:00.1360000","To":"00:00:05.1360000","Width":388.09951305013294,"Height":52.181128069666542,"SegmentType":0,"Position":"759.863974967444,197.964561899413","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВАША ЗАДАЧА: расставить цифры согласно образцу","Type":"Text","ID":"TextTool_9a1e9516-1a67-420d-9120-a5d304fc1409","ToolName":"TextTool","From":"00:00:05.2060000","To":"00:00:10.2060000","Width":874.01252862141962,"Height":62.179338266606621,"SegmentType":0,"Position":"523.906214319659,189.965993741861","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перемещение цифры на пустое поле, находящееся ","Type":"Text","ID":"TextTool_c8995cbe-3009-4dbc-9147-e79216ef53b3","ToolName":"TextTool","From":"00:00:10.2960000","To":"00:00:15.2960000","Width":886.01038085774769,"Height":62.179338266606621,"SegmentType":0,"Position":"513.908004122719,107.980670126953","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"рядом с ней,  производится с помощью мыши. ","Type":"Text","ID":"TextTool_e1fda8cf-4389-4ff2-b931-52d31e7142f9","ToolName":"TextTool","From":"00:00:10.3340000","To":"00:00:15.3340000","Width":826.02111967610733,"Height":62.179338266606621,"SegmentType":0,"Position":"547.901918792315,191.965635781249","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Наводите курсор мыши на выбранную цифру и ","Type":"Text","ID":"TextTool_c4b96e61-be9b-427d-9198-7f3353dce712","ToolName":"TextTool","From":"00:00:15.3840000","To":"00:00:18.7770000","Width":822.02183559733146,"Height":68.178264384770657,"SegmentType":0,"Position":"547.901918792315,103.981386048177","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"нажимайте левую кнопку.","Type":"Text","ID":"TextTool_d4f27bef-056c-4dea-ae42-63b3b7306e22","ToolName":"TextTool","From":"00:00:15.4430000","To":"00:00:20.4430000","Width":496.08018317708559,"Height":52.181128069666542,"SegmentType":0,"Position":"703.87399786458,195.964919860025","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Старайтесь собрать образец за МИНИМАЛЬНОЕ ","Type":"Text","ID":"TextTool_63231258-374a-47ae-9ab2-a7c1808012ed","ToolName":"TextTool","From":"00:00:20.4740000","To":"00:00:23.5740000","Width":810.02398336100339,"Height":52.181128069666542,"SegmentType":0,"Position":"533.904424516599,803.856099833981","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КОЛИЧЕСТВО перемещений цифр.","Type":"Text","ID":"TextTool_15da20fe-fea4-4ccd-8df9-be4a480a9edd","ToolName":"TextTool","From":"00:00:20.5320000","To":"00:00:23.7100000","Width":608.06013738281456,"Height":54.180770109054492,"SegmentType":0,"Position":"643.884736682939,881.842139370113","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_9048f26a-357a-4edf-b142-09f0a5d57c58","ToolName":"TextTool","From":"00:00:23.7500000","To":"00:00:26.5380000","Width":404.09664936523711,"Height":62.179338266606621,"SegmentType":0,"Position":"741.867196612952,799.856815755204","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_1bec00bf-0c9b-4337-b9a0-753eb31de950","ToolName":"TextTool","From":"00:00:23.7880000","To":"00:00:26.6550000","Width":208.13172950521187,"Height":56.180412148442585,"SegmentType":0,"Position":"847.848224700517,881.842139370113","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\levelOfPerceptionOfSpeedAndDistance.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:35","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"NewIteration","Type":null,"ID":"CallingMethod_18d8ec90-a624-4ead-aabb-831f2898f96f","ToolName":"CallingMethod","From":"00:00:12.7730000","To":"00:00:13.2810000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"PressButton","Type":null,"ID":"CallingMethod_7df939a9-a82c-41ae-a436-c778974aec86","ToolName":"CallingMethod","From":"00:00:15.3160000","To":"00:00:15.8110000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_f9c530d9-9a30-4cd3-831c-498bcf4b06cb","ToolName":"EndScenario","From":"00:00:19.4870000","To":"00:00:19.8420000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Dispose","Type":null,"ID":"CallingMethod_a433b7b5-fcc7-4542-a3fe-1cc753394d41","ToolName":"CallingMethod","From":"00:00:15.8300000","To":"00:00:16.3010000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_75470154-d43c-4a2f-8e45-7b72b0cf926d","ToolName":"MediaPlayer","From":"00:00:13.3700000","To":"00:00:14.8020000","Width":511.90657228027374,"Height":307.94308426269333,"SegmentType":0,"Position":"694.046534879556,346.130297662765","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"- В верхней части будет появляться неподвижная ЖЕЛТАЯ точка","Type":"Text","ID":"TextTool_cb93f49d-3f0c-4be3-a33d-ab5b5b04b0cd","ToolName":"TextTool","From":"00:00:00.0580000","To":"00:00:05.0580000","Width":914.00536940918016,"Height":58.180054187830606,"SegmentType":0,"Position":"515.907646162107,45.9917669059242","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"По кругу будет  быстро перемещаться ЗЕЛЁНАЯ точка","Type":"Text","ID":"TextTool_b5c53c0b-a98d-4d90-90b0-c47688744089","ToolName":"TextTool","From":"00:00:05.1300000","To":"00:00:10.1300000","Width":878.01181270019561,"Height":44.182559912114513,"SegmentType":0,"Position":"533.904424516599,55.9899771028643","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВАША ЗАДАЧА – остановить подвижную зелёную точку на неподвижной желтой,","Type":"Text","ID":"TextTool_52dbe5af-bbed-47db-addf-c6628b948c88","ToolName":"TextTool","From":"00:00:10.1640000","To":"00:00:16.0720000","Width":1091.973510914713,"Height":57.986039536132296,"SegmentType":0,"Position":"467.916237216795,908.031500533855","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"своевременно нажав на ЗЕЛЁНУЮ кнопку","Type":"Text","ID":"TextTool_4ee7b489-a78c-4faf-ae72-84f196a716c4","ToolName":"TextTool","From":"00:00:10.2030000","To":"00:00:16.0330000","Width":646.05333613118637,"Height":48.181843990890457,"SegmentType":0,"Position":"693.87578766764,977.824957260738","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_4ae66744-c3f8-4841-96a5-e98dcdd32448","ToolName":"TextTool","From":"00:00:16.1100000","To":"00:00:19.1230000","Width":372.10237673502871,"Height":52.181128069666556,"SegmentType":0,"Position":"779.860395361325,365.934493208006","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_e88160bd-3925-4bbe-9a78-4d2cbf3b9613","ToolName":"TextTool","From":"00:00:16.1300000","To":"00:00:19.1230000","Width":162.13996259928774,"Height":46.1822019515025,"SegmentType":0,"Position":"883.841781409501,457.918027019854","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"elMove","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_61005741-8afc-4602-87b8-fcbafe91c2f1","ToolName":"ColorAnimation","From":"00:00:00.8330000","To":"00:00:01.8870000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"elStatic","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ColorSegmentScenarioModel, Updk7.Tests.Wpf","Color":"#FFFFFFFF","Type":null,"ID":"ColorAnimation_c07924a3-7e8f-40dd-b98e-a3f9ede0f04f","ToolName":"ColorAnimation","From":"00:00:00.8160000","To":"00:00:01.9140000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\reactionToAMovingObject.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:20","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Start","Type":null,"ID":"CallingMethod_f870f5ba-ed17-4602-afa1-5dd1d1aa20a8","ToolName":"CallingMethod","From":"00:00:00.5010000","To":"00:00:00.7230000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.0500000","MethodName":"Timer_Tick_20ms","Type":null,"ID":"CallingMehtodByTimer_a0ae0734-d480-4e9d-ae08-45afebf9bd04","ToolName":"CallingMehtodByTimer","From":"00:00:13.2730000","To":"00:00:15.6630000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Stop","Type":null,"ID":"CallingMethod_9120559f-bbdb-45fc-aece-576e93c2e3c6","ToolName":"CallingMethod","From":"00:00:16.4170000","To":"00:00:16.7510000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_26c1504c-5ff7-484a-b302-3f9181be515c","ToolName":"EndScenario","From":"00:00:18.9960000","To":"00:00:19.3200000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Timer_Tick_20ms","Type":null,"ID":"CallingMethod_769f977f-7b5e-4ca9-baa5-9a8c367a0bed","ToolName":"CallingMethod","From":"00:00:00.7350000","To":"00:00:00.9510000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_524f6270-7c69-475c-b24b-8fe37d866d42","ToolName":"MediaPlayer","From":"00:00:15.6620000","To":"00:00:16.3960000","Width":558.069086398114,"Height":310.13495115072,"SegmentType":0,"Position":"671.879725234371,637.885810564776","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами окружность","Type":"Text","ID":"TextTool_9edaee32-aa86-4445-a803-6a431a5745ab","ToolName":"TextTool","From":"00:00:00.0570000","To":"00:00:04.0160000","Width":398.09772324707308,"Height":46.182201951502506,"SegmentType":0,"Position":"749.865764770504,243.956328805337","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"В верхней части круга ","Type":"Text","ID":"TextTool_f28a566c-4a1e-44e2-9860-821152e51e9e","ToolName":"TextTool","From":"00:00:04.0500000","To":"00:00:07.4780000","Width":390.0991550895211,"Height":48.181843990890457,"SegmentType":0,"Position":"753.86504884928,243.956328805337","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"находится неподвижное зелёное пятно","Type":"Text","ID":"TextTool_b0de72f2-2fed-409f-850a-18c3a21d6695","ToolName":"TextTool","From":"00:00:04.0740000","To":"00:00:07.5480000","Width":646.05333613118648,"Height":58.180054187830578,"SegmentType":0,"Position":"627.887600367836,317.943084262694","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"По кругу будет быстро перемещаться ","Type":"Text","ID":"TextTool_14e81e18-7349-48da-a71e-784ed95c7afe","ToolName":"TextTool","From":"00:00:07.5830000","To":"00:00:11.2750000","Width":608.0601373828141,"Height":50.181486030278549,"SegmentType":0,"Position":"647.884020761716,321.94236834147","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"второе зелёное пятно ","Type":"Text","ID":"TextTool_8f2cc7a5-1a72-4991-b53c-48db8743e051","ToolName":"TextTool","From":"00:00:07.6170000","To":"00:00:11.3210000","Width":364.1038085774768,"Height":64.178980305994614,"SegmentType":0,"Position":"763.86325904622,391.92983972005","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВАША ЗАДАЧА – остановить подвижное пятно ","Type":"Text","ID":"TextTool_75f1f95f-2d95-48dc-8223-82b6d1e06555","ToolName":"TextTool","From":"00:00:11.3560000","To":"00:00:16.3560000","Width":738.036869943035,"Height":52.181128069666542,"SegmentType":0,"Position":"583.8954755013,395.929123798826","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"на неподвижном, своевременно нажав на ","Type":"Text","ID":"TextTool_b6952bd5-7165-47aa-b491-40354dfa9c28","ToolName":"TextTool","From":"00:00:11.3910000","To":"00:00:16.3910000","Width":622.05763165853034,"Height":50.181486030278549,"SegmentType":0,"Position":"647.884020761716,473.915163334959","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗЕЛЁНУЮ кнопку пульта","Type":"Text","ID":"TextTool_274323e4-9897-45eb-bc49-891b7f3bff11","ToolName":"TextTool","From":"00:00:11.4710000","To":"00:00:16.4710000","Width":450.08841627116124,"Height":50.181486030278549,"SegmentType":0,"Position":"731.868986416012,553.900844910479","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ. ","Type":"Text","ID":"TextTool_2fa63dff-bb7a-4a16-9ee3-cb1ce9b817b1","ToolName":"TextTool","From":"00:00:16.5140000","To":"00:00:18.7880000","Width":390.09915508952088,"Height":58.180054187830578,"SegmentType":0,"Position":"753.86504884928,467.916237216795","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_87ff8574-c95d-45c4-ae6f-69ded26330b3","ToolName":"TextTool","From":"00:00:16.5490000","To":"00:00:18.8460000","Width":196.13387726888379,"Height":50.181486030278549,"SegmentType":0,"Position":"847.848224700517,553.900844910479","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\readinessAssessmentControl.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:35","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"changeIndicator_800ms_or_1200ms","Type":null,"ID":"CallingMehtodByTimer_8de00465-3a63-4036-9afa-8bed82ac1345","ToolName":"CallingMehtodByTimer","From":"00:00:05.3030000","To":"00:00:15.3790000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_cfb5201a-1eb4-413d-a725-59c3ab0e25ab","ToolName":"EndScenario","From":"00:00:25.8950000","To":"00:00:26.7650000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_d4732658-118f-475b-9347-f0cfcaef2fdc","ToolName":"MediaPlayer","From":"00:00:15.8530000","To":"00:00:17.6240000","Width":708.042239352215,"Height":414.11633719889659,"SegmentType":0,"Position":"161.971005190429,321.94236834147","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Yellow_Button.mp4","Type":"Media","ID":"MediaPlayer_d49e8c9b-6b7d-446a-98eb-16356634ddb9","ToolName":"MediaPlayer","From":"00:00:17.8910000","To":"00:00:19.8680000","Width":662.05047244629031,"Height":418.11562127767269,"SegmentType":0,"Position":"643.88473668294,317.943084262694","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Red_Button.mp4","Type":"Media","ID":"MediaPlayer_cbfca227-39c9-463d-b797-a632373bf75f","ToolName":"MediaPlayer","From":"00:00:20.0940000","To":"00:00:22.0910000","Width":624.05727369791782,"Height":418.11562127767269,"SegmentType":0,"Position":"1143.79524652994,317.943084262694","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами 12 точек","Type":"Text","ID":"TextTool_d17a859d-8d0f-4479-923b-084a3ef4fba6","ToolName":"TextTool","From":"00:00:00.3140000","To":"00:00:05.2500000","Width":435.91838498046604,"Height":59.9856815755206,"SegmentType":0,"Position":"736.040807509767,214.155712866215","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"В каждой точке, по очереди, будут загораться цветные сигналы","Type":"Text","ID":"TextTool_e89a3d72-08b5-4c98-b798-3fd65e080705","ToolName":"TextTool","From":"00:00:05.3090000","To":"00:00:10.2940000","Width":1261.9430842626937,"Height":122.16859944824677,"SegmentType":0,"Position":"313.943800183918,317.943084262694","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда ДЛИТЕЛЬНОСТЬ  свечения  сигнала","Type":"Text","ID":"TextTool_21c19ec9-2510-4591-b8c2-0cc3814174d9","ToolName":"TextTool","From":"00:00:10.3170000","To":"00:00:15.3180000","Width":987.81958785155757,"Height":65.984607693683984,"SegmentType":0,"Position":"462.089848113609,426.117769041345","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Ваша задача: замечать УДЛИНЕННЫЕ сигналы","Type":"Text","ID":"TextTool_35b1dd1e-16d2-4886-95f0-8fb3941f948e","ToolName":"TextTool","From":"00:00:15.4650000","To":"00:00:22.5810000","Width":950.11652982958083,"Height":59.9856815755204,"SegmentType":0,"Position":"477.796843702318,794.051904288738","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_90e40b22-9b25-4dee-a6f9-061bad487413","ToolName":"TextTool","From":"00:00:22.8450000","To":"00:00:25.7150000","Width":904.00715921223991,"Height":140.16537780273922,"SegmentType":0,"Position":"513.908004122719,355.936283011066","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ","Type":"Text","ID":"TextTool_cc81c6e2-4e53-4a89-9782-f0bb21704b40","ToolName":"TextTool","From":"00:00:22.8740000","To":"00:00:25.7150000","Width":416.094501601565,"Height":124.16824148763499,"SegmentType":0,"Position":"755.864690888668,513.908004122719","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"НЕЗНАЧИТЕЛЬНО УВЕЛИЧИВАЕТСЯ.","Type":"Text","ID":"TextTool_6e46907b-e712-40b3-977c-9381ba9841e1","ToolName":"TextTool","From":"00:00:10.3540000","To":"00:00:15.3620000","Width":774.0304266520194,"Height":61.985323614908452,"SegmentType":0,"Position":"565.898697146807,576.090921995445","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"и  БЫСТРО нажимать кнопку,   соответствующего цвета.","Type":"Text","ID":"TextTool_f8b72be6-9be0-4000-beb0-e9efd46a8d8c","ToolName":"TextTool","From":"00:00:15.4810000","To":"00:00:22.5680000","Width":1107.9706472298176,"Height":86.175042739262608,"SegmentType":0,"Position":"397.928765838214,871.843929173173","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\readinessForEmergencyAction.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:01:15","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"Tick_1sec","Type":null,"ID":"CallingMehtodByTimer_f2be9918-c548-4961-b0db-a8bec0835407","ToolName":"CallingMehtodByTimer","From":"00:00:00.3760000","To":"00:00:22.1150000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Jump","Type":null,"ID":"CallingMethod_a2dfbf37-a762-42fe-ba2b-5ad37ddce4b2","ToolName":"CallingMethod","From":"00:00:22.1360000","To":"00:00:22.7640000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"Tick_1sec","Type":null,"ID":"CallingMehtodByTimer_b3f48d31-f70c-4937-9e40-cdc5fbe37947","ToolName":"CallingMehtodByTimer","From":"00:00:22.7840000","To":"00:00:42.9770000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Attention","Type":null,"ID":"CallingMethod_99512b13-06bb-42bf-91e8-b576a1d0efe0","ToolName":"CallingMethod","From":"00:00:35.2840000","To":"00:00:35.9980000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"AttentionHide","Type":null,"ID":"CallingMethod_cc9d2e26-ee92-42bb-b096-9eabc4f06ddd","ToolName":"CallingMethod","From":"00:00:39.4200000","To":"00:00:40.2600000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Jump","Type":null,"ID":"CallingMethod_57296c0f-10ef-4707-b407-e0bfd6f77dde","ToolName":"CallingMethod","From":"00:00:43.0460000","To":"00:00:43.5390000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"Tick_1sec","Type":null,"ID":"CallingMehtodByTimer_f5e0216b-6ac7-4a86-9dfd-04f35ca3359e","ToolName":"CallingMehtodByTimer","From":"00:00:43.6040000","To":"00:00:53.1350000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_1f0b7fad-93cb-410f-995d-9fa86019c754","ToolName":"EndScenario","From":"00:00:53.4570000","To":"00:00:54.5150000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_f0a5c551-d6b2-4273-8194-cafbc609d3e7","ToolName":"MediaPlayer","From":"00:00:22.6560000","To":"00:00:26.7290000","Width":501.90836208333116,"Height":293.9438001839178,"SegmentType":0,"Position":"32.1650198421265,172.163230039067","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_d420249f-8854-4f9c-84b1-947b865a4dce","ToolName":"MediaPlayer","From":"00:00:42.7670000","To":"00:00:46.8230000","Width":498.07982521647341,"Height":275.79238284504629,"SegmentType":0,"Position":"33.9939146695963,174.162872078455","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами окружность, состоящая из точек ","Type":"Text","ID":"TextTool_ebc63de4-3d93-4577-9ce8-dc9906746642","ToolName":"TextTool","From":"00:00:00.2090000","To":"00:00:05.2090000","Width":656.05154632812616,"Height":56.180412148442585,"SegmentType":0,"Position":"627.887600367835,367.934135247394","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Зелёное пятно будет последовательно переходить ","Type":"Text","ID":"TextTool_a74672af-4ee4-4df1-875c-fdd9295721f3","ToolName":"TextTool","From":"00:00:05.3100000","To":"00:00:10.3100000","Width":728.0386597460946,"Height":60.1796962272186,"SegmentType":0,"Position":"591.894043658851,433.922322547198","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"с точки на точку","Type":"Text","ID":"TextTool_b8c78c9c-755d-46ec-91e5-0f39451e1d44","ToolName":"TextTool","From":"00:00:05.3930000","To":"00:00:10.3930000","Width":268.12099068685211,"Height":52.181128069666542,"SegmentType":0,"Position":"1045.81278659993,501.910151886391","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда зелёное пятно будет совершать ","Type":"Text","ID":"TextTool_12970939-2b33-4798-bfa9-0bd063301fc5","ToolName":"TextTool","From":"00:00:10.4930000","To":"00:00:15.4930000","Width":600.06156922526191,"Height":52.181128069666542,"SegmentType":0,"Position":"651.883304840492,369.933777286782","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ПЕРЕСКОК ЧЕРЕЗ ОДНУ ПОЗИЦИЮ","Type":"Text","ID":"TextTool_681705d8-ad75-4c9c-bdc8-2df1a60e9802","ToolName":"TextTool","From":"00:00:10.6610000","To":"00:00:15.6610000","Width":508.07803541341355,"Height":52.181128069666542,"SegmentType":0,"Position":"699.874713785804,441.92089070475","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВНИМАТЕЛЬНО СЛЕДИТЕ ЗА ПЯТНОМ","Type":"Text","ID":"TextTool_75895e6f-08f9-47e9-bcfa-735070d90fc4","ToolName":"TextTool","From":"00:00:15.8030000","To":"00:00:20.8030000","Width":558.06908639811365,"Height":44.182559912114513,"SegmentType":0,"Position":"671.879725234372,373.933061365558","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Как только вы заметите такой ПЕРЕСКОК пятна","Type":"Text","ID":"TextTool_42709b90-9052-4322-b753-758f24f12a6c","ToolName":"TextTool","From":"00:00:20.9450000","To":"00:00:25.9450000","Width":674.04832468261827,"Height":50.18148603027862,"SegmentType":0,"Position":"37.9931987483723,45.9917669059242","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕЕ нажмите зеленую кнопку пульта","Type":"Text","ID":"TextTool_e1a0d2b8-0636-4f55-b2f5-5e11e25bd198","ToolName":"TextTool","From":"00:00:21.4050000","To":"00:00:26.7140000","Width":746.03543810058659,"Height":64.178980305994514,"SegmentType":0,"Position":"29.9946305908203,95.9828178906246","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда в центре круга будет зажигаться жёлтый сигнал.","Type":"Text","ID":"TextTool_d5d4c4f4-e164-4518-bf3f-ad0bdfaa7c59","ToolName":"TextTool","From":"00:00:29.1810000","To":"00:00:35.4770000","Width":794.026847045899,"Height":54.180770109054578,"SegmentType":0,"Position":"35.9935567089842,45.9917669059243","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"это значит, что скоро последует ПЕРЕСКОК  зелёного пятна","Type":"Text","ID":"TextTool_c63d2141-4d27-4c78-b820-ff34278424ed","ToolName":"TextTool","From":"00:00:36.6640000","To":"00:00:41.6640000","Width":780.029352770183,"Height":42.182917872726492,"SegmentType":0,"Position":"29.9946305908202,107.980670126953","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕЕ нажмите зеленую кнопку пульта,","Type":"Text","ID":"TextTool_d01f6ab1-e11e-45bc-a092-7d5aca0789c1","ToolName":"TextTool","From":"00:00:41.8060000","To":"00:00:46.8060000","Width":788.027920927735,"Height":42.182917872726492,"SegmentType":0,"Position":"35.9935567089842,51.9906930240883","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"когда заметите ПЕРЕСКОК","Type":"Text","ID":"TextTool_a0665162-2b64-4192-9416-d95b3dcc9fd2","ToolName":"TextTool","From":"00:00:41.8890000","To":"00:00:46.8890000","Width":420.09378568034106,"Height":44.182559912114513,"SegmentType":0,"Position":"27.9949885514322,105.981028087565","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Продолжительность теста – 1 час","Type":"Text","ID":"TextTool_59eef26f-c83a-4f9b-a6bb-64fa6e6e8bd4","ToolName":"TextTool","From":"00:00:47.0320000","To":"00:00:50.4180000","Width":468.08519462565346,"Height":56.180412148442542,"SegmentType":0,"Position":"719.871134179684,683.8775774707","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.  ","Type":"Text","ID":"TextTool_866384e2-552b-4427-9bb7-a4810de4a5c6","ToolName":"TextTool","From":"00:00:50.5020000","To":"00:00:52.8430000","Width":400.0973652864609,"Height":54.180770109054606,"SegmentType":0,"Position":"755.864690888668,585.895117540687","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_dbe3126b-7b9a-4314-9f4e-e180011512c1","ToolName":"TextTool","From":"00:00:50.5850000","To":"00:00:53.0520000","Width":158.14067852051164,"Height":54.180770109054606,"SegmentType":0,"Position":"871.843929173173,685.877219510088","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\readinessForEmergencyAction_2.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:01:15","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"Tick_1sec","Type":null,"ID":"CallingMehtodByTimer_f2be9918-c548-4961-b0db-a8bec0835407","ToolName":"CallingMehtodByTimer","From":"00:00:09.5740000","To":"00:00:28.6370000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Jump","Type":null,"ID":"CallingMethod_a2dfbf37-a762-42fe-ba2b-5ad37ddce4b2","ToolName":"CallingMethod","From":"00:00:28.6850000","To":"00:00:29.3130000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"Tick_1sec","Type":null,"ID":"CallingMehtodByTimer_b3f48d31-f70c-4937-9e40-cdc5fbe37947","ToolName":"CallingMehtodByTimer","From":"00:00:29.3480000","To":"00:00:44.7320000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Attention","Type":null,"ID":"CallingMethod_99512b13-06bb-42bf-91e8-b576a1d0efe0","ToolName":"CallingMethod","From":"00:00:35.6920000","To":"00:00:36.4050000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"AttentionHide","Type":null,"ID":"CallingMethod_cc9d2e26-ee92-42bb-b096-9eabc4f06ddd","ToolName":"CallingMethod","From":"00:00:41.7900000","To":"00:00:42.6300000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Jump","Type":null,"ID":"CallingMethod_57296c0f-10ef-4707-b407-e0bfd6f77dde","ToolName":"CallingMethod","From":"00:00:44.7870000","To":"00:00:45.2800000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"Tick_1sec","Type":null,"ID":"CallingMehtodByTimer_f5e0216b-6ac7-4a86-9dfd-04f35ca3359e","ToolName":"CallingMehtodByTimer","From":"00:00:45.3180000","To":"00:00:56.9330000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_1f0b7fad-93cb-410f-995d-9fa86019c754","ToolName":"EndScenario","From":"00:00:57.0780000","To":"00:00:59.0090000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_f0a5c551-d6b2-4273-8194-cafbc609d3e7","ToolName":"MediaPlayer","From":"00:00:29.3410000","To":"00:00:33.4140000","Width":489.91050984700183,"Height":275.94881163248556,"SegmentType":0,"Position":"24.1664516845748,296.139246678064","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Rings.mp4","Type":"Media","ID":"MediaPlayer_822b98b8-96f6-4a8b-8a97-580ebf8c2088","ToolName":"MediaPlayer","From":"00:00:00.6240000","To":"00:00:08.7790000","Width":667.87865135253458,"Height":365.9327034049461,"SegmentType":0,"Position":"26.1660937239628,294.139604638676","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_0188ee88-bbf8-49ec-89e9-ebc7cec242b2","ToolName":"MediaPlayer","From":"00:00:44.6490000","To":"00:00:48.7710000","Width":512.07731949218908,"Height":262.14354220540753,"SegmentType":0,"Position":"31.9942726302083,209.962414135741","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ПЕРЕД НАЧАЛОМ ТЕСТИРОВАНИЯ ","Type":"Text","ID":"TextTool_cddc09fb-1e16-48de-a0e9-e33c097856fd","ToolName":"TextTool","From":"00:00:00.2510000","To":"00:00:05.2510000","Width":502.0791092952494,"Height":48.181843990890528,"SegmentType":0,"Position":"29.9946305908202,17.9967783544921","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"НАДЕНЬТЕ КОЛЬЦА-ДАТЧИКИ НА ТУ РУКУ,","Type":"Text","ID":"TextTool_6d1f76a4-7e34-4ccb-b6cf-1f8b0b6c4494","ToolName":"TextTool","From":"00:00:00.4600000","To":"00:00:05.4600000","Width":678.04760876139414,"Height":46.182201951502478,"SegmentType":0,"Position":"29.9946305908202,79.9856815755204","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КОТОРОЙ ВЫ НЕ БУДЕТЕ ПОЛЬЗОВАТЬСЯ ","Type":"Text","ID":"TextTool_483eaf70-8b0f-4d98-a312-f128d606a4a4","ToolName":"TextTool","From":"00:00:00.6690000","To":"00:00:05.6690000","Width":662.05047244629,"Height":60.1796962272186,"SegmentType":0,"Position":"25.9953465120441,137.975300717773","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ДЛЯ НАЖАТИЯ НА КПОНКУ ПУЛЬТА","Type":"Text","ID":"TextTool_2f14657e-35d4-4768-a687-fc63f74c96cf","ToolName":"TextTool","From":"00:00:00.8780000","To":"00:00:05.8780000","Width":592.06300106770971,"Height":60.179696227218585,"SegmentType":0,"Position":"27.994988551432,205.963130056965","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"для правши – на левую руку,","Type":"Text","ID":"TextTool_bd8c8f4a-4b5c-43f3-aedf-eb707f1615c8","ToolName":"TextTool","From":"00:00:06.0200000","To":"00:00:09.0300000","Width":450.088416271161,"Height":56.180412148442585,"SegmentType":0,"Position":"27.994988551432,139.974942757161","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"для левши  - на правую","Type":"Text","ID":"TextTool_a9812278-7fb6-45c1-a557-1e26826b0d5c","ToolName":"TextTool","From":"00:00:06.1040000","To":"00:00:09.1970000","Width":394.09843916829675,"Height":48.181843990890528,"SegmentType":0,"Position":"29.9946305908202,213.961698214517","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами окружность","Type":"Text","ID":"TextTool_dae6fd33-7213-4109-80b0-0102fec0d029","ToolName":"TextTool","From":"00:00:09.2390000","To":"00:00:14.2390000","Width":380.10094489258074,"Height":46.182201951502492,"SegmentType":0,"Position":"759.863974967444,347.937714853514","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":71.510791366906489,"Text":"Зелёное пятно будет последовательно переходить ","Type":"Text","ID":"TextTool_dc0c7db8-0ca5-44fd-bc01-6daee12fcd34","ToolName":"TextTool","From":"00:00:14.2980000","To":"00:00:19.2980000","Width":720.04009158854274,"Height":64.178980305994742,"SegmentType":0,"Position":"593.893685698239,437.921606625974","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда зелёное пятно будет совершать ","Type":"Text","ID":"TextTool_61324a80-276c-425a-af24-6959486a6ab9","ToolName":"TextTool","From":"00:00:19.3560000","To":"00:00:24.3560000","Width":600.06156922526179,"Height":58.180054187830706,"SegmentType":0,"Position":"643.884736682939,341.93878873535","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ПЕРЕСКОК ЧЕРЕЗ ОДНУ ПОЗИЦИЮ","Type":"Text","ID":"TextTool_605d3be1-2ca3-44e4-8906-9d46e64ad418","ToolName":"TextTool","From":"00:00:19.6490000","To":"00:00:24.4820000","Width":592.06300106770971,"Height":64.178980305994628,"SegmentType":0,"Position":"661.881515037431,437.921606625975","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВНИМАТЕЛЬНО СЛЕДИТЕ ЗА ПЯТНОМ","Type":"Text","ID":"TextTool_02fa9fd7-6ea0-48e3-9c1b-2a6a5e833271","ToolName":"TextTool","From":"00:00:24.5410000","To":"00:00:29.5410000","Width":632.05584185547,"Height":60.179696227218642,"SegmentType":0,"Position":"635.886168525387,341.93878873535","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Как только вы заметите такой ПЕРЕСКОК пятна","Type":"Text","ID":"TextTool_077c3074-ae27-464c-9ebe-8a7fb2727bb5","ToolName":"TextTool","From":"00:00:24.7080000","To":"00:00:29.7080000","Width":724.03937566731861,"Height":52.181128069666556,"SegmentType":0,"Position":"587.894759580075,445.920174783526","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕЕ ","Type":"Text","ID":"TextTool_31ef865f-64b9-479f-ac39-c285228d6477","ToolName":"TextTool","From":"00:00:29.8910000","To":"00:00:32.9850000","Width":386.09987101074478,"Height":48.18184399089057,"SegmentType":0,"Position":"27.9949885514323,145.973868875325","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"нажмите зеленую кнопку пульта","Type":"Text","ID":"TextTool_7274f8c3-2cb8-467e-b440-f569145d774f","ToolName":"TextTool","From":"00:00:30.1000000","To":"00:00:33.2360000","Width":514.07696153157735,"Height":62.179338266606692,"SegmentType":0,"Position":"29.9946305908199,203.963488017577","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда в центре круга будет зажигаться жёлтый сигнал.","Type":"Text","ID":"TextTool_1bbb8cc8-a358-4864-ae07-a27b9dcb71f9","ToolName":"TextTool","From":"00:00:33.3610000","To":"00:00:38.3610000","Width":798.02613112467486,"Height":70.177906424158664,"SegmentType":0,"Position":"25.9953465120441,5.99892611816399","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":22.0,"Text":"это значит, что скоро последует ПЕРЕСКОК  зелёного пятна","Type":"Text","ID":"TextTool_f0ed0f8a-8436-47ac-95ec-02211fb55b8f","ToolName":"TextTool","From":"00:00:38.5040000","To":"00:00:43.5040000","Width":818.02255151855491,"Height":65.984607693684481,"SegmentType":0,"Position":"31.9942726302081,70.1814860302785","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕЕ нажмите зеленую кнопку пульта, ","Type":"Text","ID":"TextTool_1cb1a579-e235-430e-b5bd-70df1ff38130","ToolName":"TextTool","From":"00:00:43.6450000","To":"00:00:48.6450000","Width":854.01610822753912,"Height":74.177190502934664,"SegmentType":0,"Position":"27.9949885514322,67.9878293391924","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"когда заметите ПЕРЕСКОК","Type":"Text","ID":"TextTool_3a2f2808-1acc-4f86-99e7-ea2ced0c3824","ToolName":"TextTool","From":"00:00:43.7710000","To":"00:00:48.7710000","Width":424.09306975911704,"Height":62.179338266606592,"SegmentType":0,"Position":"29.9946305908201,137.975300717773","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Продолжительность теста – 2 часа","Type":"Text","ID":"TextTool_2c1df8cb-389a-4e78-93a3-0062e30b40ab","ToolName":"TextTool","From":"00:00:48.8710000","To":"00:00:53.8710000","Width":556.0694443587256,"Height":64.178980305994628,"SegmentType":0,"Position":"675.879009313147,625.887958328448","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.  ","Type":"Text","ID":"TextTool_3c8d6eb1-95cd-4434-85e8-21464990ac7a","ToolName":"TextTool","From":"00:00:53.9720000","To":"00:00:56.5640000","Width":396.09808120768491,"Height":50.18148603027862,"SegmentType":0,"Position":"757.864332928056,631.886884446612","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_ce5df392-c1a2-48e3-8b7e-17cfe7e432e9","ToolName":"TextTool","From":"00:00:54.0970000","To":"00:00:56.9400000","Width":180.13674095377985,"Height":60.179696227218528,"SegmentType":0,"Position":"861.845718976232,705.873639903968","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"с точки на точку","Type":"Text","ID":"TextTool_befc8feb-d3a4-497a-8d44-20ffd707e931","ToolName":"TextTool","From":"00:00:14.4640000","To":"00:00:19.2730000","Width":278.11920088379225,"Height":48.181843990890457,"SegmentType":0,"Position":"1029.81565028483,517.907288201495","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\simpleMotorableReaction.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:30","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowAttention","Type":null,"ID":"CallingMethod_34d64039-fc85-4c60-a53d-bad364dc0d97","ToolName":"CallingMethod","From":"00:00:10.7090000","To":"00:00:11.0410000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_afc5df56-65ef-421d-b683-ec390a7e3142","ToolName":"CallingMethod","From":"00:00:09.9740000","To":"00:00:10.3000000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowSignal","Type":null,"ID":"CallingMethod_c139c50c-6127-4407-855e-76b3a17974fb","ToolName":"CallingMethod","From":"00:00:07.9620000","To":"00:00:08.3220000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_29186bd6-de78-4d8b-a7f3-905f0cc3fafc","ToolName":"EndScenario","From":"00:00:16.4360000","To":"00:00:16.8660000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_b8376d97-51a6-4b8d-ae06-4341580e6c45","ToolName":"CallingMethod","From":"00:00:12.8140000","To":"00:00:13.1850000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Red_Button.mp4","Type":"Media","ID":"MediaPlayer_112245f2-01cc-41cb-804f-b083bc602ae7","ToolName":"MediaPlayer","From":"00:00:08.2850000","To":"00:00:10.0350000","Width":657.8804411555958,"Height":363.93306136555782,"SegmentType":0,"Position":"50.161798196619,390.122422529301","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами круг ","Type":"Text","ID":"TextTool_5aad4fc6-09d8-4614-9364-b0a228ce979e","ToolName":"TextTool","From":"00:00:00.0680000","To":"00:00:02.0600000","Width":320.11168371094061,"Height":52.181128069666542,"SegmentType":0,"Position":"791.858247597652,245.955970844725","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Он будет загораться КРАСНЫМ цветом","Type":"Text","ID":"TextTool_9be644fa-ffb3-4b90-9686-b75096c2b7f9","ToolName":"TextTool","From":"00:00:02.0760000","To":"00:00:05.0820000","Width":684.04653487955864,"Height":56.180412148442585,"SegmentType":0,"Position":"609.890822013344,245.955970844725","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"На красный сигнал КАК МОЖНО БЫСТРЕЕ ","Type":"Text","ID":"TextTool_a57e3346-6dbd-4f2e-96a6-91a45127738d","ToolName":"TextTool","From":"00:00:05.0990000","To":"00:00:10.0990000","Width":800.02577316406337,"Height":58.180054187830592,"SegmentType":0,"Position":"51.9906930240886,217.960982293293","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"реагируйте нажатием на КРАСНУЮ кнопку пульта","Type":"Text","ID":"TextTool_095253a2-9f1d-4ba4-880d-0b102c84ff50","ToolName":"TextTool","From":"00:00:05.1330000","To":"00:00:10.1330000","Width":852.01646618815164,"Height":56.1804121484426,"SegmentType":0,"Position":"49.9910509847008,303.945589986978","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"На желтый сигнал реагировать не следует!","Type":"Text","ID":"TextTool_b0a2a2e7-52f6-4843-a8f4-dac575f0ae5b","ToolName":"TextTool","From":"00:00:10.1470000","To":"00:00:13.1680000","Width":716.04080750976675,"Height":54.180770109054563,"SegmentType":0,"Position":"599.892611816403,695.875429707028","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ. ","Type":"Text","ID":"TextTool_38dd9187-d016-4c7d-9b5e-85e2fbe75f12","ToolName":"TextTool","From":"00:00:13.2020000","To":"00:00:16.2240000","Width":400.097365286461,"Height":54.180770109054563,"SegmentType":0,"Position":"751.865406809893,697.875071746416","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_205d0129-7d2b-496e-9e01-d8d74b1f245a","ToolName":"TextTool","From":"00:00:13.2360000","To":"00:00:16.2750000","Width":180.13674095377985,"Height":50.181486030278549,"SegmentType":0,"Position":"867.844645094397,793.85788963704","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\speedAlternationSkills.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:45","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideRects","Type":null,"ID":"CallingMethod_741dfdf0-0f19-4e46-8997-cc6364ebfc88","ToolName":"CallingMethod","From":"00:00:00.0260000","To":"00:00:00.4510000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"GreenRects","Type":null,"ID":"CallingMethod_ba4c4e8d-08f1-475e-9d46-260cd30d6d97","ToolName":"CallingMethod","From":"00:00:03.1210000","To":"00:00:03.5480000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideRects","Type":null,"ID":"CallingMethod_9f26cd0f-8cac-4e35-80ef-be2e87ece7f1","ToolName":"CallingMethod","From":"00:00:06.1140000","To":"00:00:06.5410000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"GreenRedRects","Type":null,"ID":"CallingMethod_4e9fc9ce-a961-4029-b9f9-8191e7e4e605","ToolName":"CallingMethod","From":"00:00:07.8580000","To":"00:00:08.2840000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideRects","Type":null,"ID":"CallingMethod_686e189b-8005-405e-9b96-8a22ef2dac10","ToolName":"CallingMethod","From":"00:00:10.3870000","To":"00:00:10.8620000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_fafe7f0b-8efa-4c03-9d05-82bb9aff6b89","ToolName":"EndScenario","From":"00:00:25.8410000","To":"00:00:26.6920000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"GreenRects","Type":null,"ID":"CallingMethod_c742bae0-320b-431b-92f1-6beff67c8af6","ToolName":"CallingMethod","From":"00:00:18.9000000","To":"00:00:19.4000000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideRects","Type":null,"ID":"CallingMethod_a1d3e96a-248e-4388-92f8-a683ee695dc9","ToolName":"CallingMethod","From":"00:00:21.6000000","To":"00:00:22.1000000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_cc5d1203-9b8c-4c85-a9a8-d50cf09ba20d","ToolName":"MediaPlayer","From":"00:00:03.6730000","To":"00:00:05.7870000","Width":545.90048694986672,"Height":307.94308426269379,"SegmentType":0,"Position":"38.1639459602912,358.128149899092","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Red_Button.mp4","Type":"Media","ID":"MediaPlayer_74a9e27c-c41e-4553-b2ca-fed9dee20842","ToolName":"MediaPlayer","From":"00:00:19.0840000","To":"00:00:21.7370000","Width":522.07552968912933,"Height":308.13530911133194,"SegmentType":0,"Position":"1317.7641039567,359.935567089842","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами в центре экрана появятся два квадрата.","Type":"Text","ID":"TextTool_b38c6435-253f-4b3b-9f80-44a29c8b8f8f","ToolName":"TextTool","From":"00:00:00.6790000","To":"00:00:02.8690000","Width":886.01038085774758,"Height":74.177190502934664,"SegmentType":0,"Position":"505.909435965167,235.957760647785","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Оба будут загораться зеленым цветом","Type":"Text","ID":"TextTool_1177eb45-ca89-4806-b6d5-db0ccc03fcf8","ToolName":"TextTool","From":"00:00:01.3340000","To":"00:00:02.9190000","Width":610.05977942220272,"Height":56.180412148442258,"SegmentType":0,"Position":"643.884736682939,309.944516105142","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFF6347","FontSize":72.0,"Text":"НЕОБХОДИМО КАК МОЖНО БЫСТРЕЕ","Type":"Text","ID":"TextTool_14bcdebd-361e-493b-9caf-741cc1b087a2","ToolName":"TextTool","From":"00:00:03.6040000","To":"00:00:05.7860000","Width":1053.9803121663408,"Height":147.96993130859295,"SegmentType":0,"Position":"45.9917669059239,110.174326818039","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FF7FFF00","FontSize":72.0,"Text":" НАЖАТЬ НА ЗЕЛЕНУЮ КНОПКУ","Type":"Text","ID":"TextTool_c7328f58-d8ea-4d4c-8448-7a9d0bcc508c","ToolName":"TextTool","From":"00:00:03.7480000","To":"00:00:05.9370000","Width":804.02505724283924,"Height":118.16931536947095,"SegmentType":0,"Position":"47.9914089453123,229.958834529621","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Загорание одного из квадратов красным означает смену кнопок","Type":"Text","ID":"TextTool_5fd9b470-7992-43bb-8d94-943db79b58de","ToolName":"TextTool","From":"00:00:07.1330000","To":"00:00:09.8860000","Width":1033.9838917724605,"Height":68.178264384770657,"SegmentType":0,"Position":"419.924828271483,235.957760647785","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFF6347","FontSize":72.0,"Text":"ВМЕСТО ЗЕЛЕНОЙ НУЖНО НАЖИМАТЬ НА КРАСНУЮ КНОПКУ","Type":"Text","ID":"TextTool_2e25e1a2-4b9e-4703-8a31-dcec9f59c93a","ToolName":"TextTool","From":"00:00:07.7080000","To":"00:00:10.3110000","Width":1211.9520332779939,"Height":74.177190502934664,"SegmentType":0,"Position":"325.941652420246,301.94594794759","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Далее, соответственно, наоборот","Type":"Text","ID":"TextTool_78dc2fb2-7d5c-4da7-89e0-e883d152457a","ToolName":"TextTool","From":"00:00:22.5630000","To":"00:00:23.5890000","Width":710.04188139160271,"Height":106.17146313314287,"SegmentType":0,"Position":"589.894401619463,283.949169593098","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УДАЧИ","Type":"Text","ID":"TextTool_d0f19b3b-c893-4010-a553-c63823121051","ToolName":"TextTool","From":"00:00:24.0640000","To":"00:00:25.5160000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"755.864690888668,417.925186232094","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFF6347","FontSize":72.0,"Text":"НЕЛЬЗЯ НАЖИМАТЬ НА КНОПКИ","Type":"Text","ID":"TextTool_7e63e15c-aeb6-4bcb-9613-f4eb3c9a21e9","ToolName":"TextTool","From":"00:00:11.4750000","To":"00:00:13.9250000","Width":842.0182559912115,"Height":84.175400699874743,"SegmentType":0,"Position":"521.906572280271,159.971363151041","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFF6347","FontSize":72.0,"Text":"ЕСЛИ ОДИН ИЗ КВАДРАТОВ - КРАСНЫЙ","Type":"Text","ID":"TextTool_0ef9a54e-fc55-41a4-a2c7-89eb876603e3","ToolName":"TextTool","From":"00:00:11.7000000","To":"00:00:16.7000000","Width":1061.9788803238926,"Height":78.1764745817107,"SegmentType":0,"Position":"445.920174783526,261.953107159829","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Далее снова зеленые квадраты","Type":"Text","ID":"TextTool_7cf7b340-9299-4911-9a4c-7dcd33540007","ToolName":"TextTool","From":"00:00:17.4250000","To":"00:00:18.9250000","Width":400.0,"Height":44.182559912114471,"SegmentType":0,"Position":"771.861827203772,737.867912534176","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFF6347","FontSize":72.0,"Text":"НАЖИМАЕМ УЖЕ КРАСНУЮ КНОПКУ","Type":"Text","ID":"TextTool_e643a5d1-30e5-4843-ab20-407f4893ce03","ToolName":"TextTool","From":"00:00:19.1750000","To":"00:00:21.6750000","Width":856.01575026692751,"Height":74.177190502934664,"SegmentType":0,"Position":"529.905140437823,809.855025952145","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\staticTremor.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:30","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_20084aaf-4490-4968-981d-d067289a9a29","ToolName":"EndScenario","From":"00:00:26.0150000","To":"00:00:26.5230000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Обратите внимание на светодиод в центре пульта","Type":"Text","ID":"TextTool_7d829dc9-686c-42fe-b81c-96d05f88f263","ToolName":"TextTool","From":"00:00:00.0670000","To":"00:00:03.0800000","Width":812.02362540039132,"Height":58.180054187830578,"SegmentType":0,"Position":"547.901918792315,231.958476569009","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Возьмите щуп в правую руку (если Вы левша – в левую) ","Type":"Text","ID":"TextTool_c791ac81-357e-4435-a0a9-df7b60b1b085","ToolName":"TextTool","From":"00:00:03.1310000","To":"00:00:10.1450000","Width":993.99105098470034,"Height":80.1761166210987,"SegmentType":0,"Position":"459.917669059242,221.960266372069","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"и медленно опустите наконечник щупа в измерительную ячейку пульта","Type":"Text","ID":"TextTool_4121f34d-d29f-4090-a336-0268ad4a21f8","ToolName":"TextTool","From":"00:00:03.1310000","To":"00:00:10.1790000","Width":1209.9523912386057,"Height":62.179338266606621,"SegmentType":0,"Position":"341.93878873535,331.94057853841","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Тестирование начинается автоматически, ","Type":"Text","ID":"TextTool_584a388c-7346-4492-96fd-a0149575f911","ToolName":"TextTool","From":"00:00:10.2460000","To":"00:00:17.0880000","Width":696.04438711588671,"Height":56.180412148442585,"SegmentType":0,"Position":"599.892611816403,233.958118608397","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"когда светодиод  загорится. ","Type":"Text","ID":"TextTool_48af7143-4435-4a70-ae0a-d8d5023b84d8","ToolName":"TextTool","From":"00:00:10.2790000","To":"00:00:17.0710000","Width":514.07696153157769,"Height":60.1796962272186,"SegmentType":0,"Position":"691.876145628252,329.940936499022","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Не вынимайте щуп  до конца теста ","Type":"Text","ID":"TextTool_643837a3-bb33-49b4-aaf5-78c86648a1e8","ToolName":"TextTool","From":"00:00:10.3630000","To":"00:00:17.1210000","Width":622.05763165853034,"Height":56.180412148442585,"SegmentType":0,"Position":"639.885452604164,429.923038468422","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"( когда светодиод автоматически погаснет).","Type":"Text","ID":"TextTool_fb72c15e-d8e8-4bb7-b58f-5cd2c447c7ca","ToolName":"TextTool","From":"00:00:10.4300000","To":"00:00:17.1380000","Width":712.04152343099088,"Height":54.180770109054563,"SegmentType":0,"Position":"589.894401619464,529.905140437823","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВАША ЗАДАЧА – удерживать щуп вертикально ","Type":"Text","ID":"TextTool_30722b7b-0972-4700-9055-4fa524cad0fb","ToolName":"TextTool","From":"00:00:17.2300000","To":"00:00:23.8120000","Width":784.02863684895908,"Height":48.181843990890528,"SegmentType":0,"Position":"561.899413068031,237.957402687173","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"В ЦЕНТРЕ отверстия измерительной ячейки. ","Type":"Text","ID":"TextTool_881a6f31-57c5-44cf-a4ac-1d3d916a8c30","ToolName":"TextTool","From":"00:00:17.2790000","To":"00:00:23.8120000","Width":766.031858494467,"Height":58.180054187830578,"SegmentType":0,"Position":"565.898697146807,333.940220577798","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Рука должна оставаться навесу ","Type":"Text","ID":"TextTool_af66e89b-f7a9-4f89-9ed6-783778bccb14","ToolName":"TextTool","From":"00:00:17.3130000","To":"00:00:23.8290000","Width":590.063359028322,"Height":56.180412148442585,"SegmentType":0,"Position":"653.88294687988,431.92268050781","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"НЕЛЬЗЯ ОПИРАТЬСЯ ЛОКТЕМ НА СТОЛ ","Type":"Text","ID":"TextTool_da6ec533-baf4-4b3d-8a42-0434d7a6d67c","ToolName":"TextTool","From":"00:00:17.3640000","To":"00:00:23.8940000","Width":648.05297817057442,"Height":50.181486030278549,"SegmentType":0,"Position":"621.888674249672,531.904782477211","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"или придерживать свободной рукой)","Type":"Text","ID":"TextTool_56be4b74-f4ae-471e-8bd8-326c1c4c13b8","ToolName":"TextTool","From":"00:00:17.2970000","To":"00:00:24.0310000","Width":632.05584185547025,"Height":56.180412148442585,"SegmentType":0,"Position":"633.886526486,615.889748131508","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.  ","Type":"Text","ID":"TextTool_bfdeea82-af97-4358-969a-2fce6d8f40b3","ToolName":"TextTool","From":"00:00:24.2650000","To":"00:00:25.7740000","Width":422.09342771972922,"Height":52.181128069666542,"SegmentType":0,"Position":"739.867554573564,431.92268050781","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_cad5404c-cb9c-41a9-98f4-ec428e15241c","ToolName":"TextTool","From":"00:00:24.3650000","To":"00:00:25.9420000","Width":196.13387726888379,"Height":56.180412148442585,"SegmentType":0,"Position":"851.847508779293,527.905498398435","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\StressEvaluationM_1.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"GreenSignal","Type":null,"ID":"CallingMethod_c7ce105a-223e-4e3f-9d1d-1a0bf508aebc","ToolName":"CallingMethod","From":"00:00:08.8000000","To":"00:00:09.3220000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideCircle","Type":null,"ID":"CallingMethod_519d5463-8aba-4c9f-b1ac-b23823982b5d","ToolName":"CallingMethod","From":"00:00:14.2600000","To":"00:00:14.6460000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_04c1d11c-f0ee-4dbd-9b08-619e15c11ad3","ToolName":"EndScenario","From":"00:00:16.8630000","To":"00:00:17.4000000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_7e1580ca-6fac-46f8-8f5e-f8b0e368f984","ToolName":"MediaPlayer","From":"00:00:11.4830000","To":"00:00:14.2490000","Width":706.86847590979482,"Height":335.66746172294143,"SegmentType":0,"Position":"83.625712450075,344.8781236302","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Тест состоит из четырех заданий","Type":"Text","ID":"TextTool_f07a36f7-54d4-4890-aed2-0457591cd930","ToolName":"TextTool","From":"00:00:00.0670000","To":"00:00:02.0670000","Width":548.07087620117386,"Height":54.180770109054549,"SegmentType":0,"Position":"677.878651352536,229.958834529621","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАДАНИЕ №1","Type":"Text","ID":"TextTool_d9656f34-725d-4fc2-a699-109c450a7dd2","ToolName":"TextTool","From":"00:00:02.1330000","To":"00:00:04.1330000","Width":248.12457029297218,"Height":52.181128069666556,"SegmentType":0,"Position":"823.852520227861,231.958476569009","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Круг в центре будет загораться ЗЕЛЕНЫМ цветом","Type":"Text","ID":"TextTool_78aa835a-3f34-436e-bc47-3e8c9e4ed465","ToolName":"TextTool","From":"00:00:04.2220000","To":"00:00:09.2220000","Width":806.02469928222729,"Height":54.180770109054563,"SegmentType":0,"Position":"555.900486949867,231.958476569009","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Реагируйте как можно быстрее нажатием на ЗЕЛЁНУЮ кнопку пульта","Type":"Text","ID":"TextTool_765db4d8-3ad3-4d14-9751-d92410d9f6ab","ToolName":"TextTool","From":"00:00:09.3110000","To":"00:00:14.3110000","Width":1093.9731529541009,"Height":54.180770109054563,"SegmentType":0,"Position":"83.9849656542965,229.958834529621","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ  ВНИМАТЕЛЬНЫ. ","Type":"Text","ID":"TextTool_ab995272-32d9-4a0e-a33c-c8d0bfb53592","ToolName":"TextTool","From":"00:00:14.3770000","To":"00:00:16.3560000","Width":430.09199587728165,"Height":60.179696227218642,"SegmentType":0,"Position":"737.867912534176,747.866122731116","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_107261e5-af2b-41ba-a115-c2c666bd606b","ToolName":"TextTool","From":"00:00:14.4000000","To":"00:00:16.4440000","Width":176.13745687500375,"Height":54.180770109054563,"SegmentType":0,"Position":"857.846434897457,837.850014503577","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\StressEvaluationM_2.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"RedSignal","Type":null,"ID":"CallingMethod_9c9e52d5-d0bb-401e-9e1f-82922333f47e","ToolName":"CallingMethod","From":"00:00:08.4290000","To":"00:00:08.9000000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideCircle","Type":null,"ID":"CallingMethod_850fdde6-c43e-4830-af08-a5a153ab5f86","ToolName":"CallingMethod","From":"00:00:17.2450000","To":"00:00:17.6940000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_34a9311f-37a5-4e03-87f8-96005cc9ae6a","ToolName":"EndScenario","From":"00:00:19.5610000","To":"00:00:20.1670000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Red_Button.mp4","Type":"Media","ID":"MediaPlayer_20296c11-4cfe-466b-97dc-a93d47a88038","ToolName":"MediaPlayer","From":"00:00:13.8790000","To":"00:00:17.1770000","Width":601.96205617512919,"Height":331.9745847965487,"SegmentType":0,"Position":"1155.96563578125,376.126718056644","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАДАНИЕ №2","Type":"Text","ID":"TextTool_6104732b-78b8-4eb5-9da1-5f022bf33466","ToolName":"TextTool","From":"00:00:00.1120000","To":"00:00:03.1080000","Width":242.12564417480814,"Height":50.181486030278549,"SegmentType":0,"Position":"835.850372464189,229.958834529621","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Теперь круг будет загораться КРАСНЫМ цветом","Type":"Text","ID":"TextTool_add3f8b6-7a89-4a3d-9da8-2aefd01e92d2","ToolName":"TextTool","From":"00:00:03.2200000","To":"00:00:10.0450000","Width":796.02648908528715,"Height":48.181843990890528,"SegmentType":0,"Position":"561.899413068032,229.958834529621","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Реагируйте как можно быстрее нажатием на КРАСНУЮ кнопку пульта","Type":"Text","ID":"TextTool_c590c8e1-2eb9-4156-86f5-03baa7a98de3","ToolName":"TextTool","From":"00:00:10.1120000","To":"00:00:17.1400000","Width":1103.9713631510413,"Height":54.180770109054563,"SegmentType":0,"Position":"691.876145628252,225.959550450845","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ  ВНИМАТЕЛЬНЫ. ","Type":"Text","ID":"TextTool_d5633790-c069-4fdd-beb0-2af63dcbbc6b","ToolName":"TextTool","From":"00:00:17.2070000","To":"00:00:19.2340000","Width":400.0,"Height":52.181128069666556,"SegmentType":0,"Position":"757.864332928056,765.862901085608","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_ea1be0e3-55a3-4684-8af2-9dbca2a1b5d7","ToolName":"TextTool","From":"00:00:17.2530000","To":"00:00:19.2570000","Width":170.13853075683983,"Height":48.18184399089057,"SegmentType":0,"Position":"869.844287133785,849.847866739905","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\StressEvaluationM_3.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"GreenSignal","Type":null,"ID":"CallingMethod_0b6516d9-8f91-472f-abe4-1b7368a51a73","ToolName":"CallingMethod","From":"00:00:07.7830000","To":"00:00:08.1900000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideCircle","Type":null,"ID":"CallingMethod_23b5cb51-b7af-4aa8-8c34-96c2345f0f98","ToolName":"CallingMethod","From":"00:00:14.4020000","To":"00:00:14.7880000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"RedSignal","Type":null,"ID":"CallingMethod_b331e007-d70a-405d-b4a8-b6176da2d9e7","ToolName":"CallingMethod","From":"00:00:16.6440000","To":"00:00:17.0520000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideCircle","Type":null,"ID":"CallingMethod_d3ab5413-c48a-4fee-9c4a-63ffd6ff9811","ToolName":"CallingMethod","From":"00:00:19.5200000","To":"00:00:19.9050000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_1e3f699d-aa62-4662-afb7-9bfe378ba115","ToolName":"EndScenario","From":"00:00:28.5350000","To":"00:00:29.1370000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_752fd650-e79b-4bf0-8bf8-fe7bb585bb7c","ToolName":"MediaPlayer","From":"00:00:10.8200000","To":"00:00:14.3540000","Width":604.06085330403869,"Height":350.1277919384803,"SegmentType":0,"Position":"83.984965654296,405.927333995766","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАДАНИЕ №3","Type":"Text","ID":"TextTool_6558c991-dfd0-42c2-8056-ff53775c5db4","ToolName":"TextTool","From":"00:00:00.0910000","To":"00:00:03.0870000","Width":264.12170660807635,"Height":52.1811280696665,"SegmentType":0,"Position":"819.853236149085,263.952749199218","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Теперь круг будет загораться  ЗЕЛЕНЫМ  или КРАСНЫМ  цветом","Type":"Text","ID":"TextTool_5a6db92b-93e4-4816-bf6e-145c65eb06ee","ToolName":"TextTool","From":"00:00:03.1560000","To":"00:00:08.1560000","Width":1145.9638459781895,"Height":66.178622345382635,"SegmentType":0,"Position":"379.931987483722,255.954181041665","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Реагируйте на зелёный сигнал как можно быстрее нажатием на ЗЕЛЁНУЮ кнопку пульта","Type":"Text","ID":"TextTool_6b564486-d786-4f44-8e30-332891eeedef","ToolName":"TextTool","From":"00:00:08.2100000","To":"00:00:15.0030000","Width":1331.9305556412742,"Height":77.982459930012567,"SegmentType":0,"Position":"81.9853236149088,250.1492695752","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Реагировать на красный сигнал не следует!","Type":"Text","ID":"TextTool_adf73839-0b4c-4fc3-960d-4292947b76fa","ToolName":"TextTool","From":"00:00:15.1170000","To":"00:00:20.1170000","Width":778.029710730795,"Height":60.1796962272186,"SegmentType":0,"Position":"555.900486949867,255.954181041665","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Реагирование на красный сигнал СЧИТАЕТСЯ ОШИБКОЙ!","Type":"Text","ID":"TextTool_6b2e1578-85d3-42d4-8ad3-5e75cb47cda9","ToolName":"TextTool","From":"00:00:20.1720000","To":"00:00:25.1720000","Width":892.00930697591173,"Height":48.181843990890528,"SegmentType":0,"Position":"507.909078004555,743.86683865234","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ  ВНИМАТЕЛЬНЫ. ","Type":"Text","ID":"TextTool_9619a9ad-5a2d-4e8a-804f-ce0d2219e073","ToolName":"TextTool","From":"00:00:25.2710000","To":"00:00:28.2220000","Width":394.0984391682972,"Height":56.180412148442542,"SegmentType":0,"Position":"755.864690888669,741.867196612952","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_66a32987-642a-4082-986b-d65ca5cd1be9","ToolName":"TextTool","From":"00:00:25.3400000","To":"00:00:28.3820000","Width":172.13817279622788,"Height":54.180770109054492,"SegmentType":0,"Position":"869.844287133785,837.850014503577","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\StressEvaluationM_4.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"GreenSignal","Type":null,"ID":"CallingMethod_60d7f96a-3946-4321-85e6-cbffb4e67929","ToolName":"CallingMethod","From":"00:00:09.2230000","To":"00:00:09.6100000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideCircle","Type":null,"ID":"CallingMethod_b7c172fa-be3d-43f6-86b3-91547b8ed6d0","ToolName":"CallingMethod","From":"00:00:13.1210000","To":"00:00:13.5310000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"RedSignal","Type":null,"ID":"CallingMethod_57d2d64e-1431-482c-9ea7-346ace9a8695","ToolName":"CallingMethod","From":"00:00:26.9330000","To":"00:00:27.3430000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideCircle","Type":null,"ID":"CallingMethod_9cc9fb65-9343-4cb2-9f93-f5e568af8ef6","ToolName":"CallingMethod","From":"00:00:29.9030000","To":"00:00:30.3120000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_baf88b72-e342-4234-b0b8-5827910328cc","ToolName":"EndScenario","From":"00:00:39.5550000","To":"00:00:39.9320000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_ff5634d0-ffa3-4f8c-be3d-ba77177bf6a5","ToolName":"MediaPlayer","From":"00:00:09.6130000","To":"00:00:13.1050000","Width":757.86254312499648,"Height":377.93055564127405,"SegmentType":0,"Position":"78.1567867480512,422.116695159509","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАДАНИЕ №4","Type":"Text","ID":"TextTool_ca9a53f2-947b-46a2-823d-a9e766a46147","ToolName":"TextTool","From":"00:00:00.1110000","To":"00:00:03.1130000","Width":242.12564417480814,"Height":56.180412148442585,"SegmentType":0,"Position":"829.851446346025,245.955970844725","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Теперь круг будет загораться ЗЕЛЕНЫМ цветом","Type":"Text","ID":"TextTool_0f95269a-e281-4514-b45a-50b030e60890","ToolName":"TextTool","From":"00:00:03.1570000","To":"00:00:08.1570000","Width":764.032216455079,"Height":58.180054187830578,"SegmentType":0,"Position":"573.897265304359,243.956328805337","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Реагируйте на зелёный сигнал как можно быстрее ","Type":"Text","ID":"TextTool_9431a912-d620-4b11-8395-2acd675020bd","ToolName":"TextTool","From":"00:00:08.2050000","To":"00:00:13.2050000","Width":796.02648908528715,"Height":52.181128069666542,"SegmentType":0,"Position":"75.9863974967445,243.956328805337","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"нажатием на ЗЕЛЁНУЮ кнопку пульта","Type":"Text","ID":"TextTool_6a85c1d7-5cf3-4874-92fe-eb8f395257b2","ToolName":"TextTool","From":"00:00:08.2710000","To":"00:00:13.2710000","Width":630.05619981608231,"Height":52.181128069666542,"SegmentType":0,"Position":"75.9863974967446,325.941652420246","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Скорость Вашей реакции будет сравниваться с ","Type":"Text","ID":"TextTool_541cefc5-efd6-408f-897c-b2af628c1db3","ToolName":"TextTool","From":"00:00:13.3410000","To":"00:00:19.1440000","Width":834.01968783365953,"Height":54.180770109054563,"SegmentType":0,"Position":"533.904424516599,669.880083194984","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"нормативом  профессиональной пригодности. ","Type":"Text","ID":"TextTool_c9d58119-a56e-4969-8dca-19ffaf28b737","ToolName":"TextTool","From":"00:00:13.3630000","To":"00:00:19.2110000","Width":780.02935277018321,"Height":60.1796962272186,"SegmentType":0,"Position":"561.899413068031,747.866122731116","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Если скорость реакции на отдельные сигналы ","Type":"Text","ID":"TextTool_e81a47e6-2f57-480e-b07d-6893e7f2a513","ToolName":"TextTool","From":"00:00:19.2550000","To":"00:00:25.2140000","Width":806.02469928222729,"Height":52.181128069666542,"SegmentType":0,"Position":"549.901560831703,669.880083194984","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"будет недопустимо замедляться, ","Type":"Text","ID":"TextTool_7ec3dc5a-2f14-409d-9d8e-c0f683f5d0b7","ToolName":"TextTool","From":"00:00:19.3000000","To":"00:00:25.2810000","Width":524.07517172851783,"Height":54.180770109054563,"SegmentType":0,"Position":"681.877935431312,751.865406809892","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Вам покажут красный сигнал – как предупреждение, ","Type":"Text","ID":"TextTool_4ea22ac4-9486-4ac4-9a31-2fd569482c70","ToolName":"TextTool","From":"00:00:25.3470000","To":"00:00:30.3470000","Width":878.01181270019572,"Height":48.181843990890528,"SegmentType":0,"Position":"503.909793925779,673.87936727376","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"На красный сигнал не реагируйте вообще.","Type":"Text","ID":"TextTool_dc7f79e6-5edb-473e-a28a-68806ec9795f","ToolName":"TextTool","From":"00:00:30.4160000","To":"00:00:33.4850000","Width":670.04904060384263,"Height":58.180054187830578,"SegmentType":0,"Position":"611.890464052731,665.880799116208","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Реагирование на красный сигнал СЧИТАЕТСЯ ОШИБКОЙ!","Type":"Text","ID":"TextTool_6fb0f923-926d-4e11-acf0-132fd5105988","ToolName":"TextTool","From":"00:00:33.5290000","To":"00:00:36.4870000","Width":874.01252862141962,"Height":60.1796962272186,"SegmentType":0,"Position":"515.907646162107,661.881515037432","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ  ВНИМАТЕЛЬНЫ. ","Type":"Text","ID":"TextTool_fd41db3b-ea5a-47eb-b63c-c9560f77f1cc","ToolName":"TextTool","From":"00:00:36.5090000","To":"00:00:39.4660000","Width":426.09271179850532,"Height":54.180770109054606,"SegmentType":0,"Position":"737.867912534176,669.880083194984","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_7c42438e-567f-4955-ba15-e9b26cf09756","ToolName":"TextTool","From":"00:00:36.5090000","To":"00:00:39.6220000","Width":178.13709891439169,"Height":50.181486030278549,"SegmentType":0,"Position":"859.846076936845,755.864690888668","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\SwitchAttention1_1.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"NumbersTask1","Type":null,"ID":"CallingMethod_9190159d-df82-4172-924d-78a7ffaaf434","ToolName":"CallingMethod","From":"00:00:14.0130000","To":"00:00:14.4160000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.2500000","MethodName":"instruction_Tick_250ms","Type":null,"ID":"CallingMehtodByTimer_81aa27e8-2d80-4f00-85ab-8c58014c33c5","ToolName":"CallingMehtodByTimer","From":"00:00:14.5660000","To":"00:00:22.6110000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_fbf4ac38-5d68-49fd-ad6d-de227d43f4a5","ToolName":"EndScenario","From":"00:00:23.1080000","To":"00:00:23.9530000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Тест состоит из четырех заданий","Type":"Text","ID":"TextTool_7f0e53cb-2160-4c26-bae0-a33c54d0bde2","ToolName":"TextTool","From":"00:00:00.5850000","To":"00:00:04.0250000","Width":651.88151503743177,"Height":73.984965654296488,"SegmentType":0,"Position":"644.055483894858,42.1847076757864","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАДАНИЕ №1","Type":"Text","ID":"TextTool_dc931f63-def2-41b6-af6d-07a9ca0acf1f","ToolName":"TextTool","From":"00:00:04.2280000","To":"00:00:09.2280000","Width":362.10416653808886,"Height":68.178264384770657,"SegmentType":0,"Position":"767.862543124996,11.9978522363281","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами таблица с числами","Type":"Text","ID":"TextTool_cdb7a663-4185-4d2e-9348-3d3c5dbe3a04","ToolName":"TextTool","From":"00:00:04.2290000","To":"00:00:09.2290000","Width":566.06765455566574,"Height":82.175758660486721,"SegmentType":0,"Position":"677.878651352536,71.9871134179684","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Отыщите и отметьте все ЧЕРНЫЕ числа ПОДРЯД от 1 до 25","Type":"Text","ID":"TextTool_8c9ecfb0-434a-409f-ab8e-fe03762ee918","ToolName":"TextTool","From":"00:00:10.3790000","To":"00:00:15.3790000","Width":940.0007159212239,"Height":86.175042739262722,"SegmentType":0,"Position":"491.911941689451,25.9953465120442","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Для выбора чисел воспользуйтесь мышью","Type":"Text","ID":"TextTool_3a7fe990-9ffe-452a-a807-82bb6b907cd9","ToolName":"TextTool","From":"00:00:15.4890000","To":"00:00:20.4890000","Width":846.01754006998749,"Height":62.179338266606621,"SegmentType":0,"Position":"517.907288201495,927.833906276037","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Наводите курсор на нужное число и нажимайте на левую кнопку","Type":"Text","ID":"TextTool_39159fe1-603d-4067-81c6-8f69a90a7dae","ToolName":"TextTool","From":"00:00:15.5120000","To":"00:00:20.5120000","Width":1165.9602663720691,"Height":65.984607693684438,"SegmentType":0,"Position":"379.931987483722,986.017540069988","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ","Type":"Text","ID":"TextTool_8850069d-bf3c-4e90-baf4-7cd6651a01b4","ToolName":"TextTool","From":"00:00:20.5760000","To":"00:00:22.5660000","Width":519.90335063476346,"Height":142.16501984212712,"SegmentType":0,"Position":"1375.92626011393,299.946305908202","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_1eeaaeb7-deef-49aa-bbf3-5551e71b6e82","ToolName":"TextTool","From":"00:00:20.7800000","To":"00:00:22.7700000","Width":253.85359410969659,"Height":74.177190502934536,"SegmentType":0,"Position":"1517.90084491048,423.924112350259","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\SwitchAttention1_2.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"NumbersTask2","Type":null,"ID":"CallingMethod_6ffb3080-6ab0-4f09-979f-e8274cf3eccd","ToolName":"CallingMethod","From":"00:00:00.6400000","To":"00:00:01.0640000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.2500000","MethodName":"instruction_Tick_250ms","Type":null,"ID":"CallingMehtodByTimer_71cd5c47-2bcc-420f-9aaa-76fd2cf539ef","ToolName":"CallingMehtodByTimer","From":"00:00:01.1270000","To":"00:00:08.3960000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_21c88482-5872-4fd6-bb37-69b0f64bda31","ToolName":"EndScenario","From":"00:00:11.7270000","To":"00:00:12.3510000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАДАНИЕ №2","Type":"Text","ID":"TextTool_0f0dd441-328d-4db4-a0a3-166c5e9ec13c","ToolName":"TextTool","From":"00:00:00.3820000","To":"00:00:07.3970000","Width":300.11526331706045,"Height":62.179338266606592,"SegmentType":0,"Position":"813.85431003092,31.9942726302082","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Отыщите и отметьте все КРАСНЫЕ числа в УБЫВАЮЩЕМ ПОРЯДКЕ","Type":"Text","ID":"TextTool_ebf113a6-c506-48fc-9b83-49bf2061b176","ToolName":"TextTool","From":"00:00:00.4280000","To":"00:00:07.4200000","Width":1251.9448740657535,"Height":57.986039536132424,"SegmentType":0,"Position":"339.939146695962,936.026489085287","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"от 24 до 1 аналогичным способом","Type":"Text","ID":"TextTool_af44d01d-87af-44b7-970a-70383e5457d1","ToolName":"TextTool","From":"00:00:00.4050000","To":"00:00:07.4200000","Width":636.05512593424669,"Height":54.180770109054492,"SegmentType":0,"Position":"631.886884446612,997.821377654618","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ","Type":"Text","ID":"TextTool_228ce64a-8d37-47ff-9328-85a026b8fb0f","ToolName":"TextTool","From":"00:00:08.4760000","To":"00:00:11.4220000","Width":484.08233094075786,"Height":81.98174400878861,"SegmentType":0,"Position":"1381.75264921712,382.125644174808","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_3c62f69a-c4fe-4858-8a11-3cacb43c200c","ToolName":"TextTool","From":"00:00:08.4760000","To":"00:00:11.4220000","Width":214.13065562337624,"Height":58.180054187830365,"SegmentType":0,"Position":"1503.73081361978,473.915163334959","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\SwitchAttention1_3.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.2500000","MethodName":"instruction_Tick_250ms","Type":null,"ID":"CallingMehtodByTimer_4aafd2a9-79e7-4bf8-b18a-d4a49ae8d327","ToolName":"CallingMehtodByTimer","From":"00:00:07.0370000","To":"00:00:20.0720000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"NumbersTask3_4","Type":null,"ID":"CallingMethod_26f862ec-44b2-4e56-8e30-549aa8fd84e9","ToolName":"CallingMethod","From":"00:00:06.5000000","To":"00:00:06.9700000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_b0599126-4275-42b2-8d45-1565febb6b12","ToolName":"EndScenario","From":"00:00:22.6340000","To":"00:00:23.1270000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Отыщите и отметьте все ЧЕРНЫЕ и КРАСНЫЕ ","Type":"Text","ID":"TextTool_59a0f4ab-4b4b-4a85-9b2d-6e4cd3abf837","ToolName":"TextTool","From":"00:00:02.3410000","To":"00:00:09.3200000","Width":786.02827888834781,"Height":68.178264384770657,"SegmentType":0,"Position":"561.899413068031,927.833906276037","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"числа, попеременно, в следующем порядке:","Type":"Text","ID":"TextTool_1c92b63e-e794-41bd-ba7b-698f1c211457","ToolName":"TextTool","From":"00:00:02.3190000","To":"00:00:09.3200000","Width":692.04510303711049,"Height":56.180412148442585,"SegmentType":0,"Position":"609.890822013344,993.822093575842","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАДАНИЕ №3","Type":"Text","ID":"TextTool_6e5e4dd2-3187-4b74-aa6c-890239c592e2","ToolName":"TextTool","From":"00:00:00.2230000","To":"00:00:02.2300000","Width":271.94952755370946,"Height":53.988545260416373,"SegmentType":0,"Position":"824.02326743978,34.1861395182343","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"1 – чёрное, 24 – красное;  2 – чёрное, 23 – красное;  ","Type":"Text","ID":"TextTool_ab216ff3-0f44-49b7-b551-bdd9bb34b85e","ToolName":"TextTool","From":"00:00:09.4980000","To":"00:00:18.9440000","Width":761.86182720377224,"Height":71.985323614908438,"SegmentType":0,"Position":"586.065864752606,924.026847045899","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"3 – чёрное, 22 – красное, и т.д.","Type":"Text","ID":"TextTool_703218e5-c2b9-4903-b3d5-1774eb9bef8d","ToolName":"TextTool","From":"00:00:09.5210000","To":"00:00:18.9220000","Width":399.99999999999994,"Height":55.988187299804338,"SegmentType":0,"Position":"758.035080139975,996.013960463868","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_2d0b3962-c1a6-4f79-8c02-f7253d86f54c","ToolName":"TextTool","From":"00:00:20.2780000","To":"00:00:22.2850000","Width":473.98496565429645,"Height":87.982459930012567,"SegmentType":0,"Position":"1389.92375438965,386.123138450524","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_0f4f89a4-caa4-44d1-8bbf-0e9a759bef6a","ToolName":"TextTool","From":"00:00:20.3890000","To":"00:00:22.3960000","Width":189.96241413574123,"Height":51.988903221028409,"SegmentType":0,"Position":"1529.89869714681,482.105956341149","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\SwitchAttention1_4.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.2500000","MethodName":"instruction_Tick_250ms","Type":null,"ID":"CallingMehtodByTimer_4aafd2a9-79e7-4bf8-b18a-d4a49ae8d327","ToolName":"CallingMehtodByTimer","From":"00:00:05.9690000","To":"00:00:19.0040000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"NumbersTask3_4","Type":null,"ID":"CallingMethod_26f862ec-44b2-4e56-8e30-549aa8fd84e9","ToolName":"CallingMethod","From":"00:00:04.0160000","To":"00:00:04.4860000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_b0599126-4275-42b2-8d45-1565febb6b12","ToolName":"EndScenario","From":"00:00:25.4590000","To":"00:00:25.9520000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ЗАДАНИЕ №4","Type":"Text","ID":"TextTool_f6d26997-d4c3-4041-a27e-c98790cc9ab5","ToolName":"TextTool","From":"00:00:00.2740000","To":"00:00:02.2400000","Width":268.12099068685222,"Height":60.1796962272186,"SegmentType":0,"Position":"827.851804306637,27.9949885514321","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Отыщите и отметьте все ЧЕРНЫЕ и КРАСНЫЕ числа, попеременно, в следующем порядке:","Type":"Text","ID":"TextTool_e53e1fba-fcc2-46f3-8067-5f3b14e04505","ToolName":"TextTool","From":"00:00:02.4460000","To":"00:00:09.4860000","Width":1231.9484536718737,"Height":66.178622345382635,"SegmentType":0,"Position":"341.93878873535,927.833906276037","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"1 – чёрное, 24 – красное;  2 – чёрное, 23 – красное; 3 – чёрное, 22 – красное, и т.д.","Type":"Text","ID":"TextTool_76727964-9411-4b2a-9cdd-579c024c0796","ToolName":"TextTool","From":"00:00:02.5140000","To":"00:00:09.5090000","Width":1147.9634880175772,"Height":57.986039536132424,"SegmentType":0,"Position":"385.930913601886,994.01610822754","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Выполнение задания будет сопровождаться сбивающими звуковыми помехами.","Type":"Text","ID":"TextTool_bc5661f2-1684-412f-bddb-4f6fc73054b7","ToolName":"TextTool","From":"00:00:09.8060000","To":"00:00:16.8000000","Width":1169.9595504508457,"Height":54.180770109054563,"SegmentType":0,"Position":"373.933061365558,937.832116472977","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Ваша задача - не отвлекаться на помехи, не останавливаться и довести задание до конца","Type":"Text","ID":"TextTool_3c1e4564-d794-4ba5-a4de-8a7ca3f03ed3","ToolName":"TextTool","From":"00:00:09.8290000","To":"00:00:16.8910000","Width":1485.9029926741509,"Height":60.179696227218642,"SegmentType":0,"Position":"219.960624332682,997.821377654618","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_406acd1f-2ebd-42a7-84b3-1854f0f00623","ToolName":"TextTool","From":"00:00:17.1890000","To":"00:00:19.1770000","Width":445.98997710286449,"Height":75.984607693684552,"SegmentType":0,"Position":"1405.92089070475,378.124570292972","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_fa8828e8-742c-46c8-90bf-322f47ad9c6a","ToolName":"TextTool","From":"00:00:17.2340000","To":"00:00:19.2230000","Width":176.13745687500375,"Height":62.179338266606621,"SegmentType":0,"Position":"1527.72651809244,489.912299650063","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\SwitchAttention2_1.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"NumbersTask1","Type":null,"ID":"CallingMethod_9190159d-df82-4172-924d-78a7ffaaf434","ToolName":"CallingMethod","From":"00:00:05.6470000","To":"00:00:06.0500000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.2500000","MethodName":"instruction_Tick_250ms","Type":null,"ID":"CallingMehtodByTimer_81aa27e8-2d80-4f00-85ab-8c58014c33c5","ToolName":"CallingMehtodByTimer","From":"00:00:07.0140000","To":"00:00:15.0590000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_fd134ea0-30cb-42d5-b483-4941a531a24b","ToolName":"EndScenario","From":"00:00:21.0640000","To":"00:00:21.7590000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами таблица с числами","Type":"Text","ID":"TextTool_7f0e53cb-2160-4c26-bae0-a33c54d0bde2","ToolName":"TextTool","From":"00:00:00.3360000","To":"00:00:02.8910000","Width":651.88151503743188,"Height":73.984965654296488,"SegmentType":0,"Position":"644.055483894858,42.1847076757864","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Отыщите и отметьте все черные числа подряд","Type":"Text","ID":"TextTool_2a8bc051-bb05-4f40-8465-7b50cd90e18b","ToolName":"TextTool","From":"00:00:03.3170000","To":"00:00:08.3170000","Width":730.03830178548287,"Height":58.180054187830578,"SegmentType":0,"Position":"583.8954755013,45.9917669059243","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"от 1 до 25","Type":"Text","ID":"TextTool_09d11489-6cbd-4ac3-8e02-f28893a6ede5","ToolName":"TextTool","From":"00:00:03.5410000","To":"00:00:08.5410000","Width":154.14139444173554,"Height":46.182201951502492,"SegmentType":0,"Position":"865.845003055009,117.978880323893","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"для выбора числа воспользуйтесь мышью","Type":"Text","ID":"TextTool_1b83003c-b10b-47fa-bc11-256ff731c665","ToolName":"TextTool","From":"00:00:08.6270000","To":"00:00:12.1040000","Width":640.05441001302233,"Height":52.181128069666542,"SegmentType":0,"Position":"655.882588919268,51.9906930240883","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УДАЧИ","Type":"Text","ID":"TextTool_29d361e4-133e-4bb8-ab63-8fd5d43fed4d","ToolName":"TextTool","From":"00:00:15.5070000","To":"00:00:20.5070000","Width":399.99999999999994,"Height":200.0,"SegmentType":0,"Position":"89.9838917724603,377.932345444334","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\SwitchAttention2_2.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"NumbersTask2","Type":null,"ID":"CallingMethod_6ffb3080-6ab0-4f09-979f-e8274cf3eccd","ToolName":"CallingMethod","From":"00:00:04.0800000","To":"00:00:04.5040000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.2500000","MethodName":"instruction_Tick_250ms","Type":null,"ID":"CallingMehtodByTimer_71cd5c47-2bcc-420f-9aaa-76fd2cf539ef","ToolName":"CallingMehtodByTimer","From":"00:00:05.0390000","To":"00:00:12.3080000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_21c88482-5872-4fd6-bb37-69b0f64bda31","ToolName":"EndScenario","From":"00:00:14.5150000","To":"00:00:15.1390000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Отыщите все красные числа","Type":"Text","ID":"TextTool_77cab4b6-a78e-49bf-a1b0-1672e95a4203","ToolName":"TextTool","From":"00:00:00.1780000","To":"00:00:05.1780000","Width":400.0,"Height":58.180054187830578,"SegmentType":0,"Position":"733.8686284554,41.9924828271482","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"от 48 до 2 (четные) в убывающем порядке","Type":"Text","ID":"TextTool_93d9ba9b-447f-4273-af56-c1a73b4a8b79","ToolName":"TextTool","From":"00:00:00.8870000","To":"00:00:05.2450000","Width":400.0,"Height":42.182917872726492,"SegmentType":0,"Position":"735.868270494788,105.981028087565","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Выбор производится мышью","Type":"Text","ID":"TextTool_c1f5fdd7-8bcb-48d2-b7c9-b75670fd5e51","ToolName":"TextTool","From":"00:00:04.9270000","To":"00:00:09.9270000","Width":400.0,"Height":46.182201951502506,"SegmentType":0,"Position":"737.867912534176,73.9867554573564","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УДАЧИ","Type":"Text","ID":"TextTool_4e3e3250-3d5e-444d-b0cd-019272a72cb4","ToolName":"TextTool","From":"00:00:12.7980000","To":"00:00:14.1140000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"97.9824599300125,375.932703404946","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\SwitchAttention2_3.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.2500000","MethodName":"instruction_Tick_250ms","Type":null,"ID":"CallingMehtodByTimer_4aafd2a9-79e7-4bf8-b18a-d4a49ae8d327","ToolName":"CallingMehtodByTimer","From":"00:00:03.1350000","To":"00:00:16.1700000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"NumbersTask3_4","Type":null,"ID":"CallingMethod_26f862ec-44b2-4e56-8e30-549aa8fd84e9","ToolName":"CallingMethod","From":"00:00:02.5760000","To":"00:00:03.0460000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_b0599126-4275-42b2-8d45-1565febb6b12","ToolName":"EndScenario","From":"00:00:18.2980000","To":"00:00:18.7910000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами снова таблица с числами","Type":"Text","ID":"TextTool_6cf489bb-6e81-4edb-ac32-7156cfcecb49","ToolName":"TextTool","From":"00:00:00.1120000","To":"00:00:02.1720000","Width":794.0268470458991,"Height":74.177190502934664,"SegmentType":0,"Position":"563.89905510742,29.9946305908201","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Вы должны отыскивать и регистрировать попеременно ","Type":"Text","ID":"TextTool_8838068b-8a29-4b09-bafc-02a33022a0be","ToolName":"TextTool","From":"00:00:02.8100000","To":"00:00:06.0430000","Width":1019.815650284826,"Height":59.987471378580381,"SegmentType":0,"Position":"436.092711798505,34.1861395182344","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"чёрные и красные числа в следующем порядке:","Type":"Text","ID":"TextTool_c8abcd47-f5ae-41c0-9039-09437e9c7c0b","ToolName":"TextTool","From":"00:00:06.2090000","To":"00:00:09.8560000","Width":860.0150343457035,"Height":90.174326818038779,"SegmentType":0,"Position":"533.904424516599,37.9931987483721","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"1-чёрное, 48-красное; 2-чёрное, 46-красное; 3-чёрное, 44-красное и т.д.","Type":"Text","ID":"TextTool_3f200599-55ba-4ea9-afb7-5f158acf6153","ToolName":"TextTool","From":"00:00:09.9670000","To":"00:00:15.4850000","Width":1149.9631300569654,"Height":64.178980305994614,"SegmentType":0,"Position":"377.932345444335,45.9917669059246","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УДАЧИ","Type":"Text","ID":"TextTool_39ab3d1e-649e-43c1-b6e6-b33c3205f382","ToolName":"TextTool","From":"00:00:16.2370000","To":"00:00:17.9840000","Width":399.99999999999994,"Height":200.0,"SegmentType":0,"Position":"75.9863974967442,411.92626011393","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\SwitchAttention2_4.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.2500000","MethodName":"instruction_Tick_250ms","Type":null,"ID":"CallingMehtodByTimer_4aafd2a9-79e7-4bf8-b18a-d4a49ae8d327","ToolName":"CallingMehtodByTimer","From":"00:00:03.1350000","To":"00:00:16.1700000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"NumbersTask3_4","Type":null,"ID":"CallingMethod_26f862ec-44b2-4e56-8e30-549aa8fd84e9","ToolName":"CallingMethod","From":"00:00:02.5760000","To":"00:00:03.0460000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_b0599126-4275-42b2-8d45-1565febb6b12","ToolName":"EndScenario","From":"00:00:25.4590000","To":"00:00:25.9520000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами снова таблица с числами","Type":"Text","ID":"TextTool_6cf489bb-6e81-4edb-ac32-7156cfcecb49","ToolName":"TextTool","From":"00:00:00.1120000","To":"00:00:02.1720000","Width":794.02684704589922,"Height":74.177190502934664,"SegmentType":0,"Position":"557.900128989256,29.9946305908202","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Вы должны отыскивать и регистрировать попеременно ","Type":"Text","ID":"TextTool_8838068b-8a29-4b09-bafc-02a33022a0be","ToolName":"TextTool","From":"00:00:02.4410000","To":"00:00:05.8230000","Width":1019.815650284826,"Height":59.987471378580381,"SegmentType":0,"Position":"448.090564034833,38.1854235970104","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"чёрные и красные числа в следующем порядке:","Type":"Text","ID":"TextTool_c8abcd47-f5ae-41c0-9039-09437e9c7c0b","ToolName":"TextTool","From":"00:00:05.9890000","To":"00:00:08.9010000","Width":860.01503434570361,"Height":90.174326818038779,"SegmentType":0,"Position":"539.903350634763,29.9946305908201","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"1-чёрное, 48-красное; 2-чёрное, 46-красное; 3-чёрное, 44-красное и т.д.","Type":"Text","ID":"TextTool_3f200599-55ba-4ea9-afb7-5f158acf6153","ToolName":"TextTool","From":"00:00:09.1280000","To":"00:00:12.2920000","Width":1149.9631300569654,"Height":64.178980305994614,"SegmentType":0,"Position":"395.929123798827,41.9924828271486","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УДАЧИ","Type":"Text","ID":"TextTool_39ab3d1e-649e-43c1-b6e6-b33c3205f382","ToolName":"TextTool","From":"00:00:23.4650000","To":"00:00:25.2120000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"69.9874713785802,381.93162952311","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Выполнение теста будет сопровождаться сбивающими звуковыми помехами","Type":"Text","ID":"TextTool_2df657ce-e37a-4dc6-a358-9744c5ea4bbc","ToolName":"TextTool","From":"00:00:12.6720000","To":"00:00:17.6720000","Width":1019.9863974967443,"Height":60.1796962272186,"SegmentType":0,"Position":"429.923038468422,49.9910509847003","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Не отвлекайтесь на помехи, не останавливайтесь, и продолжайте работу","Type":"Text","ID":"TextTool_b727458c-dbea-4d4e-9b09-2421d3fcba56","ToolName":"TextTool","From":"00:00:18.1820000","To":"00:00:23.1820000","Width":979.99355670898422,"Height":41.988903221028238,"SegmentType":0,"Position":"467.916237216795,952.023625400392","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\tepping310.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:35","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_6eb018c8-9f49-4688-80ea-3e5b9306c1b9","ToolName":"EndScenario","From":"00:00:32.6100000","To":"00:00:33.0670000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Tepping.mp4","Type":"Media","ID":"MediaPlayer_bb530d82-2cd2-4929-91c1-36b3e6c206cc","ToolName":"MediaPlayer","From":"00:00:22.2660000","To":"00:00:27.2660000","Width":654.05190428873857,"Height":332.13101358398814,"SegmentType":0,"Position":"623.88831628906,497.910867807614","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Обратите внимание на лампочку пульта","Type":"Text","ID":"TextTool_a7e0dc6b-566a-4759-90be-b8957f566fe0","ToolName":"TextTool","From":"00:00:00.0990000","To":"00:00:05.0990000","Width":632.05584185547059,"Height":56.180412148442542,"SegmentType":0,"Position":"643.88473668294,177.968141505533","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Тестирование начинается при загорании красной лампочки","Type":"Text","ID":"TextTool_a0f88b20-c67c-47cf-9f27-464eab6dbec9","ToolName":"TextTool","From":"00:00:05.1300000","To":"00:00:10.1300000","Width":934.00178980306,"Height":54.180770109054563,"SegmentType":0,"Position":"489.912299650063,283.949169593098","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Возьмите щуп в удобную для Вас руку и держите его вертикально","Type":"Text","ID":"TextTool_a1ca8fde-2c6e-441a-9cde-0cd5be6cc314","ToolName":"TextTool","From":"00:00:10.1600000","To":"00:00:15.1600000","Width":947.99928407877621,"Height":50.181486030278549,"SegmentType":0,"Position":"479.914089453123,391.92983972005","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВАША ЗАДАЧА - как можно чаще стучать ","Type":"Text","ID":"TextTool_7c4ffc29-cc89-471f-9b0e-478814e075a2","ToolName":"TextTool","From":"00:00:15.2120000","To":"00:00:22.0570000","Width":628.05655777669438,"Height":54.180770109054563,"SegmentType":0,"Position":"641.885094643552,177.968141505533","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"щупом по металлической пластине от момента ","Type":"Text","ID":"TextTool_029686a1-478e-434e-97d1-bb26d8837d3b","ToolName":"TextTool","From":"00:00:15.2700000","To":"00:00:22.1360000","Width":758.033290336915,"Height":44.182559912114513,"SegmentType":0,"Position":"573.897265304359,285.948811632486","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"загорания красной лампочки до момента её гашения","Type":"Text","ID":"TextTool_ef158c65-3a29-4523-ab07-c2a715eea463","ToolName":"TextTool","From":"00:00:15.3300000","To":"00:00:22.1960000","Width":836.01932987304747,"Height":54.180770109054549,"SegmentType":0,"Position":"543.902634713539,387.930555641274","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"После небольшого перерыва повторите те же  ","Type":"Text","ID":"TextTool_a3048008-e3b3-4b0e-a47b-9daf25915e61","ToolName":"TextTool","From":"00:00:22.2550000","To":"00:00:27.2550000","Width":744.035796061199,"Height":56.180412148442585,"SegmentType":0,"Position":"589.894401619464,177.968141505533","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"действия, когда лампочка загорится снова.","Type":"Text","ID":"TextTool_7596854f-ec08-4130-9c1d-6c904d48de93","ToolName":"TextTool","From":"00:00:22.3140000","To":"00:00:27.3140000","Width":696.04438711588671,"Height":56.180412148442585,"SegmentType":0,"Position":"607.891179973955,279.949885514322","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Всего таких циклов будет 6.","Type":"Text","ID":"TextTool_24e882ea-1a97-4cf7-9e64-d56e265a7927","ToolName":"TextTool","From":"00:00:27.3840000","To":"00:00:30.3640000","Width":422.09342771972922,"Height":50.181486030278563,"SegmentType":0,"Position":"727.869702337236,619.889032210283","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_27c6e41c-5e0e-4eb6-9b99-971eaddedbaf","ToolName":"TextTool","From":"00:00:30.4430000","To":"00:00:32.5340000","Width":166.13924667806361,"Height":50.181486030278506,"SegmentType":0,"Position":"857.846434897457,619.889032210284","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\teppingTest.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:25","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_2911a12f-87e7-4270-999c-cea336e90100","ToolName":"EndScenario","From":"00:00:16.4410000","To":"00:00:16.9490000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Tepping.mp4","Type":"Media","ID":"MediaPlayer_420da6a3-af0f-4c39-a183-174b7a9047be","ToolName":"MediaPlayer","From":"00:00:08.9260000","To":"00:00:16.0740000","Width":673.87757747069975,"Height":355.93449320800596,"SegmentType":0,"Position":"640.056199816082,136.167883527023","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Возьмите щуп в удобную для Вас руку.","Type":"Text","ID":"TextTool_e31cc43f-c124-400d-b8a8-211685834859","ToolName":"TextTool","From":"00:00:00.1270000","To":"00:00:02.2280000","Width":742.03615402181083,"Height":102.17217905436678,"SegmentType":0,"Position":"611.890464052732,209.962414135741","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"После того, как загорится красный светодиод на пульте","Type":"Text","ID":"TextTool_3956b77a-4042-41ce-bb35-d3cbba101457","ToolName":"TextTool","From":"00:00:02.3540000","To":"00:00:04.2160000","Width":824.0214776367194,"Height":104.17182109375484,"SegmentType":0,"Position":"567.898339186195,203.963488017577","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"как можно чаще стучите щюпом по пластине","Type":"Text","ID":"TextTool_ca8f5f2a-eaf8-4f28-8eb9-5ef73756fd98","ToolName":"TextTool","From":"00:00:04.0190000","To":"00:00:06.5280000","Width":698.04402915527464,"Height":76.176832542322686,"SegmentType":0,"Position":"627.887600367835,303.945589986978","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"пока красный светодиод не погаснет","Type":"Text","ID":"TextTool_60285202-9b0d-4196-afd3-d442802f058b","ToolName":"TextTool","From":"00:00:06.3170000","To":"00:00:08.8270000","Width":596.062285146486,"Height":74.177190502934664,"SegmentType":0,"Position":"685.877219510088,387.930555641274","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УДАЧИ","Type":"Text","ID":"TextTool_b6ec28a2-9fd3-454b-a102-3e059c4179a0","ToolName":"TextTool","From":"00:00:12.9580000","To":"00:00:16.0890000","Width":542.07195008300982,"Height":230.14926957519958,"SegmentType":0,"Position":"695.875429707028,551.901202871091","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\testForMotorableCoherence.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:01:20","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowRedRects1","Type":null,"ID":"CallingMethod_da18c8c6-1042-4c19-aaff-b3e537baccec","ToolName":"CallingMethod","From":"00:00:24.7080000","To":"00:00:25.6060000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_d7f62d6b-8d27-4c4c-8fe5-1e37a63e5918","ToolName":"EndScenario","From":"00:01:06.6970000","To":"00:01:08.1800000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"MoveGreenRects","Type":null,"ID":"CallingMethod_7cb02dd7-3978-4f6c-aaeb-9c6b9a5da233","ToolName":"CallingMethod","From":"00:00:30.9880000","To":"00:00:32.0670000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowRedRects2","Type":null,"ID":"CallingMethod_2d644182-77b0-4d19-a00d-d818c70f586a","ToolName":"CallingMethod","From":"00:00:55.4500000","To":"00:00:56.7200000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Resistors down.mp4","Type":"Media","ID":"MediaPlayer_3c439986-cc29-462c-896a-38761e46b0ca","ToolName":"MediaPlayer","From":"00:00:01.0780000","To":"00:00:06.2020000","Width":814.02326743977926,"Height":368.12457029297241,"SegmentType":0,"Position":"549.901560831703,155.972079072265","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед началом тестирования необходимо отклонить рукоятки на пульте в позицию «0».","Type":"Text","ID":"TextTool_811e426d-9411-495e-bfd4-4042610c37ad","ToolName":"TextTool","From":"00:00:00.8990000","To":"00:00:06.1120000","Width":1241.9466638688134,"Height":94.1736108968148,"SegmentType":0,"Position":"327.941294459634,59.9892611816404","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами экран, поделенный на 2 части","Type":"Text","ID":"TextTool_6f848a4b-99c8-448d-bab8-50bb1747e7ea","ToolName":"TextTool","From":"00:00:07.3260000","To":"00:00:12.3260000","Width":886.01038085774769,"Height":64.178980305994642,"SegmentType":0,"Position":"519.906930240883,79.9856815755204","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Внизу экрана в двух частях будут гореть зелёные квадраты","Type":"Text","ID":"TextTool_83c5024d-b8a4-4474-b5f0-3afb4ff6d4af","ToolName":"TextTool","From":"00:00:13.1690000","To":"00:00:18.1690000","Width":831.84750877929264,"Height":71.983533811848588,"SegmentType":0,"Position":"536.076603570966,930.027562967123","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"В этих двух частях будут появляться красные квадраты","Type":"Text","ID":"TextTool_33fb0d7e-c79e-4c23-88db-5f64d54bacdb","ToolName":"TextTool","From":"00:00:18.8760000","To":"00:00:23.8760000","Width":852.01646618815164,"Height":142.16501984212704,"SegmentType":0,"Position":"529.905140437823,641.885094643552","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"При появлении красных квадратов,","Type":"Text","ID":"TextTool_e6cf43dd-f4a6-45d3-9166-473be2f5dce0","ToolName":"TextTool","From":"00:00:24.4950000","To":"00:00:29.4950000","Width":684.04653487955875,"Height":58.180054187830706,"SegmentType":0,"Position":"611.890464052732,307.944874065754","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"действуя одновременно двумя рукоятками,","Type":"Text","ID":"TextTool_1414b328-a770-4a19-a67c-ec8fe6411245","ToolName":"TextTool","From":"00:00:27.9550000","To":"00:00:32.9550000","Width":672.04868264322977,"Height":64.178980305994571,"SegmentType":0,"Position":"617.889390170896,385.930913601886","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БЫСТРО наводить зелёные квадраты на красные квадраты.","Type":"Text","ID":"TextTool_5dfa73a9-4d9d-4f54-a8ac-5525d16a9a49","ToolName":"TextTool","From":"00:00:31.9100000","To":"00:00:41.9100000","Width":895.837843842769,"Height":63.986755457356367,"SegmentType":0,"Position":"508.079825216473,460.109893907881","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":" Когда зелёные квадраты будут одновременно наведены на красные,","Type":"Text","ID":"TextTool_6fe5f51d-5149-410e-a3be-6aac4c16a9f7","ToolName":"TextTool","From":"00:00:42.4270000","To":"00:00:49.3480000","Width":1025.8145764029896,"Height":51.988903221028352,"SegmentType":0,"Position":"438.092353837893,304.137814835616","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"удержите их в таком положении 2 секунды.","Type":"Text","ID":"TextTool_8f65521d-17aa-42e5-a0b5-d391e618e20f","ToolName":"TextTool","From":"00:00:48.3150000","To":"00:00:53.3150000","Width":792.02720500651094,"Height":90.174326818038779,"SegmentType":0,"Position":"551.901202871091,377.932345444334","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"затем красные квадраты появятся в других местах,","Type":"Text","ID":"TextTool_e98e36e4-6d0f-4a36-98ce-1a42b2b01833","ToolName":"TextTool","From":"00:00:52.8050000","To":"00:00:59.7750000","Width":793.85609983398035,"Height":67.986039536132239,"SegmentType":0,"Position":"560.070518240562,462.109535947269","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Вы должны выполнить те же действия.","Type":"Text","ID":"TextTool_7d5437df-d9dc-4a2d-85f1-9f8b186b819d","ToolName":"TextTool","From":"00:00:57.1240000","To":"00:01:02.1240000","Width":632.05584185547025,"Height":78.176474581710693,"SegmentType":0,"Position":"637.885810564776,513.908004122719","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УДАЧИ","Type":"Text","ID":"TextTool_b89cddb3-15dc-4164-b19f-48c08c12b6ca","ToolName":"TextTool","From":"00:01:03.1460000","To":"00:01:06.2470000","Width":399.99999999999983,"Height":200.0,"SegmentType":0,"Position":"753.86504884928,411.92626011393","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\testForMotorableCoherenceM.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:01:20","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowRedRects1","Type":null,"ID":"CallingMethod_da18c8c6-1042-4c19-aaff-b3e537baccec","ToolName":"CallingMethod","From":"00:00:24.7080000","To":"00:00:25.6060000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_d7f62d6b-8d27-4c4c-8fe5-1e37a63e5918","ToolName":"EndScenario","From":"00:01:18.2980000","To":"00:01:19.7810000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"MoveGreenRects","Type":null,"ID":"CallingMethod_7cb02dd7-3978-4f6c-aaeb-9c6b9a5da233","ToolName":"CallingMethod","From":"00:00:30.9880000","To":"00:00:32.0670000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowRedRects2","Type":null,"ID":"CallingMethod_2d644182-77b0-4d19-a00d-d818c70f586a","ToolName":"CallingMethod","From":"00:00:55.4500000","To":"00:00:56.7200000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"ShowRedSignal","Type":null,"ID":"CallingMethod_8b2d6823-55ff-4b4e-944b-7626678e8573","ToolName":"CallingMethod","From":"00:01:07.4580000","To":"00:01:08.3540000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_df05ff7e-aa17-4753-9a44-b4af0b9b8056","ToolName":"CallingMethod","From":"00:01:10.5490000","To":"00:01:11.3100000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Resistors down.mp4","Type":"Media","ID":"MediaPlayer_3c439986-cc29-462c-896a-38761e46b0ca","ToolName":"MediaPlayer","From":"00:00:01.0780000","To":"00:00:06.2020000","Width":814.02326743977926,"Height":368.12457029297241,"SegmentType":0,"Position":"549.901560831703,155.972079072265","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Red_Button.mp4","Type":"Media","ID":"MediaPlayer_c489f4f7-e717-400f-a662-d05b870a3aa7","ToolName":"MediaPlayer","From":"00:01:07.5480000","To":"00:01:10.5940000","Width":641.88330484049163,"Height":339.9373568929019,"SegmentType":0,"Position":"630.057989619142,594.085910546878","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед началом тестирования необходимо отклонить рукоятки на пульте в позицию «0».","Type":"Text","ID":"TextTool_811e426d-9411-495e-bfd4-4042610c37ad","ToolName":"TextTool","From":"00:00:00.8990000","To":"00:00:06.1120000","Width":1241.9466638688134,"Height":94.1736108968148,"SegmentType":0,"Position":"327.941294459634,59.9892611816404","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами экран, поделенный на 2 части","Type":"Text","ID":"TextTool_6f848a4b-99c8-448d-bab8-50bb1747e7ea","ToolName":"TextTool","From":"00:00:07.3260000","To":"00:00:12.3260000","Width":886.01038085774769,"Height":64.178980305994642,"SegmentType":0,"Position":"519.906930240883,79.9856815755204","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Внизу экрана в двух частях будут гореть зелёные квадраты","Type":"Text","ID":"TextTool_83c5024d-b8a4-4474-b5f0-3afb4ff6d4af","ToolName":"TextTool","From":"00:00:13.1690000","To":"00:00:18.1690000","Width":831.84750877929264,"Height":71.983533811848588,"SegmentType":0,"Position":"536.076603570966,930.027562967123","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"В этих двух частях будут появляться красные квадраты","Type":"Text","ID":"TextTool_33fb0d7e-c79e-4c23-88db-5f64d54bacdb","ToolName":"TextTool","From":"00:00:18.8760000","To":"00:00:23.8760000","Width":852.01646618815164,"Height":142.16501984212704,"SegmentType":0,"Position":"529.905140437823,641.885094643552","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"При появлении красных квадратов,","Type":"Text","ID":"TextTool_e6cf43dd-f4a6-45d3-9166-473be2f5dce0","ToolName":"TextTool","From":"00:00:24.4950000","To":"00:00:29.4950000","Width":684.04653487955875,"Height":58.180054187830706,"SegmentType":0,"Position":"611.890464052732,307.944874065754","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"действуя одновременно двумя рукоятками,","Type":"Text","ID":"TextTool_1414b328-a770-4a19-a67c-ec8fe6411245","ToolName":"TextTool","From":"00:00:27.9550000","To":"00:00:32.9550000","Width":672.04868264322977,"Height":64.178980305994571,"SegmentType":0,"Position":"617.889390170896,385.930913601886","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БЫСТРО наводить зелёные квадраты на красные квадраты.","Type":"Text","ID":"TextTool_5dfa73a9-4d9d-4f54-a8ac-5525d16a9a49","ToolName":"TextTool","From":"00:00:31.9100000","To":"00:00:41.9100000","Width":895.837843842769,"Height":63.986755457356367,"SegmentType":0,"Position":"508.079825216473,460.109893907881","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":" Когда зелёные квадраты будут одновременно наведены на красные,","Type":"Text","ID":"TextTool_6fe5f51d-5149-410e-a3be-6aac4c16a9f7","ToolName":"TextTool","From":"00:00:42.4270000","To":"00:00:49.3480000","Width":1025.8145764029896,"Height":51.988903221028352,"SegmentType":0,"Position":"438.092353837893,304.137814835616","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"удержите их в таком положении 2 секунды.","Type":"Text","ID":"TextTool_8f65521d-17aa-42e5-a0b5-d391e618e20f","ToolName":"TextTool","From":"00:00:48.3150000","To":"00:00:53.3150000","Width":792.02720500651094,"Height":90.174326818038779,"SegmentType":0,"Position":"551.901202871091,377.932345444334","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"затем красные квадраты появятся в других местах,","Type":"Text","ID":"TextTool_e98e36e4-6d0f-4a36-98ce-1a42b2b01833","ToolName":"TextTool","From":"00:00:52.8050000","To":"00:00:59.7750000","Width":793.85609983398035,"Height":67.986039536132239,"SegmentType":0,"Position":"560.070518240562,462.109535947269","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Вы должны выполнить те же действия.","Type":"Text","ID":"TextTool_7d5437df-d9dc-4a2d-85f1-9f8b186b819d","ToolName":"TextTool","From":"00:00:57.1240000","To":"00:01:02.1240000","Width":632.05584185547025,"Height":78.176474581710693,"SegmentType":0,"Position":"637.885810564776,513.908004122719","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УДАЧИ","Type":"Text","ID":"TextTool_b89cddb3-15dc-4164-b19f-48c08c12b6ca","ToolName":"TextTool","From":"00:01:15.0610000","To":"00:01:18.1620000","Width":399.99999999999983,"Height":200.0,"SegmentType":0,"Position":"753.86504884928,411.92626011393","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда в центре экрана будет загораться зеленый или красный сигнал","Type":"Text","ID":"TextTool_1d8ac8c7-80cf-41b8-868f-580be9e23b2c","ToolName":"TextTool","From":"00:01:02.8440000","To":"00:01:06.7860000","Width":961.99677835449234,"Height":87.980670126952589,"SegmentType":0,"Position":"467.916237216795,380.12600213542","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFF6347","FontSize":72.0,"Text":"РЕАГИРУЙТЕ КАК МОЖНО БЫСТРЕЕ, ","Type":"Text","ID":"TextTool_c22ea9ce-82da-46ca-9b17-4d224092c3de","ToolName":"TextTool","From":"00:01:07.2340000","To":"00:01:11.0410000","Width":983.9928407877602,"Height":108.17110517253087,"SegmentType":0,"Position":"459.917669059242,275.950601435546","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFF6347","FontSize":72.0,"Text":"НАЖАТИЕМ КНОПКИ СООТВЕТСТВУЮЩЕГО ЦВЕТА","Type":"Text","ID":"TextTool_aa9c8456-f61c-4132-bee4-fb47121c5656","ToolName":"TextTool","From":"00:01:07.9960000","To":"00:01:11.3550000","Width":842.01825599121128,"Height":76.176832542322643,"SegmentType":0,"Position":"535.904066555987,363.934851168618","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFF6347","FontSize":72.0,"Text":"Неверный выбор кнопки оценивается как ошибка!","Type":"Text","ID":"TextTool_cfa3178b-1c83-4312-86d8-baede9cc5818","ToolName":"TextTool","From":"00:01:11.6240000","To":"00:01:14.4900000","Width":999.98997710286437,"Height":132.16680964518702,"SegmentType":0,"Position":"453.918742941079,611.890464052731","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\tremor3.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:01:00","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_04e5721b-180b-4dea-a023-dfb68534f078","ToolName":"EndScenario","From":"00:00:58.5450000","To":"00:00:59.2520000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Tremor.mp4","Type":"Media","ID":"MediaPlayer_78a7ee3a-558a-4526-b4ed-3f3897b60e55","ToolName":"MediaPlayer","From":"00:00:22.7060000","To":"00:00:53.7340000","Width":955.82710502440921,"Height":503.90621431965906,"SegmentType":0,"Position":"478.085194625654,22.1900770849663","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Обратите внимание на светодиод в центре пульта","Type":"Text","ID":"TextTool_e7ab77bb-bc25-4576-a4a6-8497ed285845","ToolName":"TextTool","From":"00:00:00.1330000","To":"00:00:05.1330000","Width":850.01682414876359,"Height":66.178622345382564,"SegmentType":0,"Position":"521.906572280271,563.899055107419","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Тестирование начинается, когда он  загорится","Type":"Text","ID":"TextTool_fd747d42-5fdc-440f-91f2-f4a26822ad35","ToolName":"TextTool","From":"00:00:05.1750000","To":"00:00:08.1470000","Width":738.03686994303484,"Height":58.180054187830592,"SegmentType":0,"Position":"575.896907343747,643.88473668294","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Возьмите щуп в правую руку (если Вы левша – в левую) ","Type":"Text","ID":"TextTool_9c3de961-efc9-4c85-b3ef-804f847cf91d","ToolName":"TextTool","From":"00:00:08.2140000","To":"00:00:15.1920000","Width":900.00787513346393,"Height":50.181486030278549,"SegmentType":0,"Position":"493.911583728839,571.897623264971","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВАША ЗАДАЧА – опустить и удерживать вертикально металлический наконечник щупа ","Type":"Text","ID":"TextTool_0b5e4fe5-4f41-44c6-b940-6d5d3a801a3c","ToolName":"TextTool","From":"00:00:15.2920000","To":"00:00:22.2370000","Width":1287.9384307747384,"Height":56.180412148442542,"SegmentType":0,"Position":"313.943800183918,569.897981225583","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"в центрах отверстий измерительной ячейки. ","Type":"Text","ID":"TextTool_1417a3c4-24c4-440d-8123-74192220a7f2","ToolName":"TextTool","From":"00:00:15.3930000","To":"00:00:22.3040000","Width":730.038301785483,"Height":52.181128069666542,"SegmentType":0,"Position":"581.895833461911,649.883662801104","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Начинайте с самого большого отверстия (№1).","Type":"Text","ID":"TextTool_50c5d1ec-60e3-4dbc-85d7-969b8e71d734","ToolName":"TextTool","From":"00:00:22.3710000","To":"00:00:25.3760000","Width":712.04152343099088,"Height":58.180054187830578,"SegmentType":0,"Position":"585.895117540687,565.898697146807","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Рука должна оставаться навесу ","Type":"Text","ID":"TextTool_154175ad-9757-4090-9b9f-3fec59ed0085","ToolName":"TextTool","From":"00:00:25.4420000","To":"00:00:30.4420000","Width":500.07946725586169,"Height":54.180770109054563,"SegmentType":0,"Position":"693.87578766764,569.897981225583","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"НЕЛЬЗЯ ОПИРАТЬСЯ ЛОКТЕМ НА СТОЛ ","Type":"Text","ID":"TextTool_6efafc19-7cbe-4d64-b69d-01ffef4fa7e8","ToolName":"TextTool","From":"00:00:25.5760000","To":"00:00:30.5760000","Width":616.0587055403663,"Height":54.180770109054563,"SegmentType":0,"Position":"639.885452604164,647.884020761716","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"или придерживать свободной рукой","Type":"Text","ID":"TextTool_3d540182-5739-4921-9757-747107cbc152","ToolName":"TextTool","From":"00:00:25.6760000","To":"00:00:30.6760000","Width":592.06300106771016,"Height":52.181128069666542,"SegmentType":0,"Position":"651.883304840492,727.869702337236","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"После того, как светодиод загорится, ","Type":"Text","ID":"TextTool_e42cdb43-c692-487c-b033-88965eb4b6a3","ToolName":"TextTool","From":"00:00:30.8180000","To":"00:00:35.8180000","Width":568.067296595054,"Height":52.181128069666542,"SegmentType":0,"Position":"661.881515037432,571.897623264971","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"удерживайте наконечник В ЦЕНТРЕ ОТВЕРСТИЯ, ","Type":"Text","ID":"TextTool_ccf2d0d1-65c3-4bce-b506-4bca8023b43e","ToolName":"TextTool","From":"00:00:30.9850000","To":"00:00:35.9850000","Width":776.03006869140711,"Height":56.180412148442656,"SegmentType":0,"Position":"555.900486949867,647.884020761716","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"не касаясь стенок, пока светодиод не погаснет.","Type":"Text","ID":"TextTool_2e50d337-650a-4941-82a1-971817c72f8c","ToolName":"TextTool","From":"00:00:31.1190000","To":"00:00:36.1190000","Width":716.04080750976675,"Height":46.182201951502506,"SegmentType":0,"Position":"591.894043658852,729.869344376624","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Далее у вас есть 3 секунды","Type":"Text","ID":"TextTool_4ee883d3-ebf8-433f-9b20-28b4ce213e82","ToolName":"TextTool","From":"00:00:36.2270000","To":"00:00:41.2270000","Width":426.09271179850509,"Height":44.182559912114513,"SegmentType":0,"Position":"725.870060297848,577.896549383135","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"чтобы переместить наконечник щупа в среднее отверстие (№2)","Type":"Text","ID":"TextTool_d8e31cc7-86d5-448d-9b8f-07cd8a76d950","ToolName":"TextTool","From":"00:00:36.4270000","To":"00:00:41.4270000","Width":1123.9677835449211,"Height":56.180412148442585,"SegmentType":0,"Position":"389.930197680662,649.883662801104","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"После того, как загорится красный сигнал на пульте, ","Type":"Text","ID":"TextTool_d86ebc7f-8e59-4dfa-8805-9df9cc372db8","ToolName":"TextTool","From":"00:00:41.5360000","To":"00:00:46.5360000","Width":888.01002289713585,"Height":58.180054187830578,"SegmentType":0,"Position":"499.910509847002,563.899055107419","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"удерживайте наконечник В ЦЕНТРЕ ОТВЕРСТИЯ, ","Type":"Text","ID":"TextTool_cb669188-189c-47a1-9b95-4ef6d1ac7a28","ToolName":"TextTool","From":"00:00:41.7360000","To":"00:00:46.7360000","Width":814.02326743977926,"Height":62.179338266606621,"SegmentType":0,"Position":"533.904424516599,641.885094643552","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"не касаясь стенок, пока светодиод не погаснет.","Type":"Text","ID":"TextTool_e540aecd-f1c7-4fa9-b937-a10179b2e402","ToolName":"TextTool","From":"00:00:41.8700000","To":"00:00:46.8700000","Width":798.02613112467532,"Height":56.180412148442585,"SegmentType":0,"Position":"549.901560831703,723.87041825846","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Далее у вас есть 3 секунды","Type":"Text","ID":"TextTool_42a7d139-30a8-442e-b587-2ea1b7534a40","ToolName":"TextTool","From":"00:00:46.9450000","To":"00:00:51.9530000","Width":426.09271179850509,"Height":54.180770109054563,"SegmentType":0,"Position":"733.8686284554,563.899055107419","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"чтобы переместить наконечник щупа в маленькое отверстие (№3)","Type":"Text","ID":"TextTool_b77ef316-f8c1-4728-a569-96346981c2ff","ToolName":"TextTool","From":"00:00:47.1120000","To":"00:00:52.1120000","Width":1051.9806701269527,"Height":50.181486030278549,"SegmentType":0,"Position":"427.923396429034,651.883304840492","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Дальнейшие действия аналогичны.","Type":"Text","ID":"TextTool_7856bccb-7fe1-449a-9a76-b635061c5a9c","ToolName":"TextTool","From":"00:00:52.1870000","To":"00:00:55.0250000","Width":608.0601373828141,"Height":48.181843990890528,"SegmentType":0,"Position":"643.88473668294,565.898697146807","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_64da7883-a5c8-4549-95fd-fa782932a79b","ToolName":"TextTool","From":"00:00:55.0910000","To":"00:00:57.0950000","Width":374.10201877441693,"Height":42.182917872726492,"SegmentType":0,"Position":"757.864332928056,567.898339186195","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_447590cf-42cc-45db-b53e-e370f3380c8b","ToolName":"TextTool","From":"00:00:55.1920000","To":"00:00:57.3620000","Width":168.13888871745178,"Height":54.180770109054563,"SegmentType":0,"Position":"871.843929173173,651.883304840492","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\vigilanceAssessment.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:01:10","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"NextCircle","Type":null,"ID":"CallingMehtodByTimer_da24b81e-425c-4b46-a5da-0973abe2ccc9","ToolName":"CallingMehtodByTimer","From":"00:00:02.0860000","To":"00:00:23.7930000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_876c88d7-7545-4fc4-b1aa-1e2911e76a3f","ToolName":"EndScenario","From":"00:01:08.2330000","To":"00:01:09.4540000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Jump","Type":null,"ID":"CallingMethod_550604d4-379e-475a-b484-5565f393904a","ToolName":"CallingMethod","From":"00:00:23.8320000","To":"00:00:24.6990000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"NextCircle","Type":null,"ID":"CallingMehtodByTimer_ab9b21b0-62dc-4b43-b660-d49e9338a844","ToolName":"CallingMehtodByTimer","From":"00:00:24.7780000","To":"00:00:33.8770000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"YellowSignal","Type":null,"ID":"CallingMethod_3801acbc-cf3c-44a0-9059-48e691d6f6e0","ToolName":"CallingMethod","From":"00:00:33.9570000","To":"00:00:34.6650000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"NextCircle","Type":null,"ID":"CallingMehtodByTimer_d1aab307-761e-48c7-960c-21a5e5ca810a","ToolName":"CallingMehtodByTimer","From":"00:00:34.7050000","To":"00:00:36.9110000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_c5f6f923-33c2-488c-9609-3e3913be27d6","ToolName":"CallingMethod","From":"00:00:36.9500000","To":"00:00:37.6980000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"NextCircle","Type":null,"ID":"CallingMehtodByTimer_f342eccc-ae91-45bb-9ecd-822241acfa3c","ToolName":"CallingMehtodByTimer","From":"00:00:37.7770000","To":"00:00:41.6380000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"Jump","Type":null,"ID":"CallingMethod_a04341cf-516d-4dd5-a81d-be5fdfe8fa0d","ToolName":"CallingMethod","From":"00:00:41.6770000","To":"00:00:42.3860000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"NextCircle","Type":null,"ID":"CallingMehtodByTimer_8b36e6cf-8d2f-4b02-9835-5ae872917759","ToolName":"CallingMehtodByTimer","From":"00:00:42.3860000","To":"00:00:48.6890000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"RedSignal","Type":null,"ID":"CallingMethod_1713b7f9-845a-488d-82d3-ef4bea272e70","ToolName":"CallingMethod","From":"00:00:48.7280000","To":"00:00:49.4370000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"NextCircle","Type":null,"ID":"CallingMehtodByTimer_9ea346f1-8a9b-40eb-948c-86816b9be1f6","ToolName":"CallingMehtodByTimer","From":"00:00:49.4370000","To":"00:00:54.2040000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodScenarioModel, Updk7.Tests.Wpf","MethodName":"HideSignal","Type":null,"ID":"CallingMethod_3cd0c3fc-a0fb-4f05-b7aa-61b85beca480","ToolName":"CallingMethod","From":"00:00:54.2430000","To":"00:00:55.0700000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.CallingMethodByTimerScenarioModel, Updk7.Tests.Wpf","TimerInterval":"00:00:00.5000000","MethodName":"NextCircle","Type":null,"ID":"CallingMehtodByTimer_b99294fe-7768-42ea-994b-b989dda41894","ToolName":"CallingMehtodByTimer","From":"00:00:55.1090000","To":"00:01:03.6180000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Green_Button.mp4","Type":"Media","ID":"MediaPlayer_48d675a8-9a45-40b6-a895-ab6d981c14e2","ToolName":"MediaPlayer","From":"00:00:23.9010000","To":"00:00:28.9010000","Width":460.08662646810092,"Height":279.94630590820168,"SegmentType":0,"Position":"723.87041825846,464.110967789717","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.MediaSegmentScenarioModel, Updk7.Tests.Wpf","Source":"Media\\Video\\Red_Button.mp4","Type":"Media","ID":"MediaPlayer_83e0cb10-01d0-4ecc-864c-62c228232edc","ToolName":"MediaPlayer","From":"00:00:49.3380000","To":"00:00:54.3380000","Width":486.08197298014534,"Height":266.14282628418374,"SegmentType":0,"Position":"711.872566022132,645.884378722328","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Перед Вами окружность","Type":"Text","ID":"TextTool_def88e90-be47-44e7-a5a3-41b7ed746d83","ToolName":"TextTool","From":"00:00:00.1970000","To":"00:00:05.1970000","Width":462.08626850748948,"Height":54.180770109054606,"SegmentType":0,"Position":"717.871492140296,171.969215387369","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"состоящая из точек","Type":"Text","ID":"TextTool_23844e33-bce9-4d82-acfb-56c330f95ca5","ToolName":"TextTool","From":"00:00:00.2360000","To":"00:00:05.2360000","Width":392.098797128909,"Height":54.180770109054563,"SegmentType":0,"Position":"757.864332928056,243.956328805337","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Зелёное пятно будет последовательно ","Type":"Text","ID":"TextTool_a1f0a3e2-cb5a-4060-b5aa-7ee3a0254e08","ToolName":"TextTool","From":"00:00:05.2790000","To":"00:00:10.2790000","Width":648.05297817057419,"Height":48.18184399089057,"SegmentType":0,"Position":"631.886884446611,321.94236834147","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"переходить с точки на точку","Type":"Text","ID":"TextTool_58332446-35f5-4bc7-91ba-3f734dca53ef","ToolName":"TextTool","From":"00:00:05.3580000","To":"00:00:10.3580000","Width":494.08054113769759,"Height":54.180770109054606,"SegmentType":0,"Position":"709.872923982744,385.930913601886","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда зелёное пятно будет совершать перескок  ","Type":"Text","ID":"TextTool_74fe35a4-581d-47d1-9054-fffe098b02e2","ToolName":"TextTool","From":"00:00:10.4380000","To":"00:00:15.4380000","Width":806.02469928222718,"Height":60.1796962272186,"SegmentType":0,"Position":"553.900844910479,313.943800183918","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"через одну позицию","Type":"Text","ID":"TextTool_c469b5dd-fe8a-48c1-8ae0-95c76d2f5d07","ToolName":"TextTool","From":"00:00:10.4780000","To":"00:00:15.4780000","Width":402.09700732584889,"Height":52.181128069666542,"SegmentType":0,"Position":"751.865406809892,385.930913601886","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"ВНИМАТЕЛЬНО СЛЕДИТЕ ЗА ПЯТНОМ","Type":"Text","ID":"TextTool_dd161670-f75e-42fd-b2de-5ab051156b47","ToolName":"TextTool","From":"00:00:15.6390000","To":"00:00:18.6330000","Width":644.05369409179821,"Height":64.178980305994742,"SegmentType":0,"Position":"643.884736682939,235.957760647785","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Как только вы заметите такой перескок пятна","Type":"Text","ID":"TextTool_f25ce582-4670-465b-97b7-6c419d1cb106","ToolName":"TextTool","From":"00:00:18.7500000","To":"00:00:23.7500000","Width":704.04295527343868,"Height":64.178980305994614,"SegmentType":0,"Position":"603.89189589518,235.957760647785","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕЕ нажмите зеленую кнопку пульта","Type":"Text","ID":"TextTool_eafba3a5-4dbf-488c-8ce4-66a3dd4ca16b","ToolName":"TextTool","From":"00:00:23.8320000","To":"00:00:28.8320000","Width":888.01002289713574,"Height":64.178980305994685,"SegmentType":0,"Position":"509.908720043943,381.93162952311","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда в центре круга будет зажигаться жёлтый сигнал.","Type":"Text","ID":"TextTool_44fa6017-d217-4ae6-b873-4c8cd2305c67","ToolName":"TextTool","From":"00:00:28.9530000","To":"00:00:33.9530000","Width":858.01539230631556,"Height":64.178980305994614,"SegmentType":0,"Position":"525.905856359047,381.93162952311","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"это значит, что скоро последует перескок зелёного пятна","Type":"Text","ID":"TextTool_7ee45cf7-f5c7-4852-adac-967221840b2a","ToolName":"TextTool","From":"00:00:33.9950000","To":"00:00:38.9950000","Width":868.01360250325581,"Height":56.1804121484426,"SegmentType":0,"Position":"527.905498398434,381.93162952311","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕЕ нажмите зеленую кнопку пульта","Type":"Text","ID":"TextTool_9309acca-5681-49f6-bd34-91f382210a4c","ToolName":"TextTool","From":"00:00:39.0770000","To":"00:00:44.0770000","Width":844.01789803059933,"Height":48.18184399089057,"SegmentType":0,"Position":"531.904782477211,385.930913601886","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Иногда в центре круга будет зажигаться красный сигнал","Type":"Text","ID":"TextTool_df687f27-5984-4d38-9899-ea6d963483e6","ToolName":"TextTool","From":"00:00:44.1190000","To":"00:00:49.1190000","Width":828.02076171549538,"Height":56.180412148442585,"SegmentType":0,"Position":"541.902992674151,385.930913601886","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"КАК МОЖНО БЫСТРЕЕ нажмите красную кнопку пульта","Type":"Text","ID":"TextTool_76497abb-993f-4d57-ac3d-f8c60eccfe00","ToolName":"TextTool","From":"00:00:49.1610000","To":"00:00:54.1610000","Width":904.00715921223969,"Height":58.180054187830592,"SegmentType":0,"Position":"499.910509847003,577.896549383135","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Нажатие на несоответствующую инструкции кнопку ","Type":"Text","ID":"TextTool_37949aa0-53af-49be-9dcb-343d0ff352be","ToolName":"TextTool","From":"00:00:54.2820000","To":"00:00:59.2820000","Width":716.04080750976664,"Height":48.181843990890528,"SegmentType":0,"Position":"603.891895895179,579.896191422523","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"СЧИТАЕТСЯ ОШИБКОЙ!","Type":"Text","ID":"TextTool_4b40fb4b-e944-47c7-a4d3-f573de728f75","ToolName":"TextTool","From":"00:00:59.3250000","To":"00:01:02.3190000","Width":388.09951305013357,"Height":48.181843990890684,"SegmentType":0,"Position":"757.864332928056,581.895833461911","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Реагируйте быстро и внимательно.","Type":"Text","ID":"TextTool_985dd588-4b6c-410d-8c2e-101944a8b0ab","ToolName":"TextTool","From":"00:01:02.3970000","To":"00:01:05.3910000","Width":544.07159212239753,"Height":62.179338266606621,"SegmentType":0,"Position":"681.877935431312,575.896907343747","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ.","Type":"Text","ID":"TextTool_6762e48c-0968-4aef-9be9-f6fb880c355c","ToolName":"TextTool","From":"00:01:05.4700000","To":"00:01:08.3060000","Width":372.10237673502871,"Height":56.180412148442585,"SegmentType":0,"Position":"769.862185164384,577.896549383135","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_35de5ab0-7692-430f-a8ce-bf746c7677c7","ToolName":"TextTool","From":"00:01:05.4700000","To":"00:01:08.3460000","Width":170.13853075683969,"Height":50.181486030278549,"SegmentType":0,"Position":"865.845003055009,645.884378722328","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Scenarions\мethodCriticalFrequencyLightFlares.json

{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.StudyAssignmentModel, Updk7.Tests.Wpf","FullTime":"00:00:40","Elements":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Common","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf","Type":null,"ID":"EndScenario_26c1504c-5ff7-484a-b302-3f9181be515c","ToolName":"EndScenario","From":"00:00:36.2560000","To":"00:00:36.5800000","Width":400.0,"Height":200.0,"SegmentType":0,"Position":"0,0","IsBase":false}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Media","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Audio","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Text","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Обратите внимание на лампочку пульта","Type":"Text","ID":"TextTool_cd88c555-bac8-4b76-9ee5-92f984f977b3","ToolName":"TextTool","From":"00:00:00.0550000","To":"00:00:04.0360000","Width":660.05083040690261,"Height":68.178264384770671,"SegmentType":0,"Position":"595.893327737627,333.940220577798","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Красная лампочка будет мелькать с нарастающей частотой","Type":"Text","ID":"TextTool_ac259b8f-5c7b-447e-9e84-f5f9de5134c2","ToolName":"TextTool","From":"00:00:04.0580000","To":"00:00:07.0790000","Width":963.99642039388016,"Height":58.180054187830578,"SegmentType":0,"Position":"441.920890704751,425.923754389646","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"в тот момент, когда мелькания лампочки сольются ","Type":"Text","ID":"TextTool_af3222ea-95b3-4979-9a54-ca8829016976","ToolName":"TextTool","From":"00:00:07.1230000","To":"00:00:12.1230000","Width":806.0246992822274,"Height":48.18184399089057,"SegmentType":0,"Position":"527.905498398435,521.906572280271","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"в НЕПРЕРЫВНОЕ  свечение","Type":"Text","ID":"TextTool_e98d1896-566a-47ef-96c8-aa8d10cfb9d5","ToolName":"TextTool","From":"00:00:07.1570000","To":"00:00:12.1570000","Width":436.09092199544557,"Height":66.178622345382564,"SegmentType":0,"Position":"701.874355825192,601.892253855791","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"НАЖМИТЕ и ОТПУСТИТЕ ЧЕРНУЮ кнопку","Type":"Text","ID":"TextTool_2c81068b-1ab7-434a-bbb3-5ce9a5175950","ToolName":"TextTool","From":"00:00:12.2050000","To":"00:00:17.2050000","Width":664.05011448567859,"Height":46.182201951502506,"SegmentType":0,"Position":"581.895833461911,703.87399786458","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Далее лампочка загорится снова","Type":"Text","ID":"TextTool_7b96d3ed-4392-4bc0-8602-1db56297dfec","ToolName":"TextTool","From":"00:00:17.2830000","To":"00:00:22.2830000","Width":536.07302396484579,"Height":66.178622345382678,"SegmentType":0,"Position":"653.882946879879,333.940220577798","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"В тот момент, когда Вы заметите,","Type":"Text","ID":"TextTool_a878b1ae-5ea4-4515-98d7-88255119d1ef","ToolName":"TextTool","From":"00:00:22.3160000","To":"00:00:27.3160000","Width":546.07123416178581,"Height":60.1796962272186,"SegmentType":0,"Position":"651.883304840492,419.924828271482","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"что свечение лампочки становится ПУЛЬСИРУЮЩИМ ","Type":"Text","ID":"TextTool_b91f43f2-bd4e-4450-a075-daa0794860fd","ToolName":"TextTool","From":"00:00:22.3610000","To":"00:00:27.3610000","Width":800.02577316406325,"Height":44.182559912114513,"SegmentType":0,"Position":"525.905856359047,525.905856359047","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"НАЖМИТЕ и ОТПУСТИТЕ ЧЕРНУЮ кнопку","Type":"Text","ID":"TextTool_cdba06de-c468-4e72-8f98-0cc27f99786f","ToolName":"TextTool","From":"00:00:27.3720000","To":"00:00:30.3340000","Width":674.0483246826185,"Height":52.181128069666542,"SegmentType":0,"Position":"577.896549383135,605.891537934567","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Этот цикл повторится 3 раза. ","Type":"Text","ID":"TextTool_7740f995-9646-4cb0-921b-4b6a1d4ec436","ToolName":"TextTool","From":"00:00:30.3790000","To":"00:00:32.5170000","Width":470.08483666504151,"Height":60.1796962272186,"SegmentType":0,"Position":"667.880441155596,789.858605558264","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"Реагируйте аналогичным образом в каждом цикле","Type":"Text","ID":"TextTool_3327da9b-8de9-4967-825e-a9e0fbd5c13a","ToolName":"TextTool","From":"00:00:30.4900000","To":"00:00:33.2070000","Width":764.032216455079,"Height":46.182201951502506,"SegmentType":0,"Position":"515.907646162107,889.840707527665","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"БУДЬТЕ ВНИМАТЕЛЬНЫ. ","Type":"Text","ID":"TextTool_1db1c8c3-2a46-45d3-8e0c-f6eae2d09f06","ToolName":"TextTool","From":"00:00:33.2290000","To":"00:00:36.1020000","Width":390.09915508952088,"Height":56.180412148442585,"SegmentType":0,"Position":"719.871134179684,519.906930240883","IsBase":true},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.TextSegmentScenarioModel, Updk7.Tests.Wpf","Foreground":"#FFFFFFFF","FontSize":72.0,"Text":"УСПЕХОВ!","Type":"Text","ID":"TextTool_d5990f16-7c14-4958-a78f-d7ea6a3c0109","ToolName":"TextTool","From":"00:00:33.2970000","To":"00:00:36.2140000","Width":174.13781483561581,"Height":52.181128069666542,"SegmentType":0,"Position":"835.850372464188,609.890822013343","IsBase":true}]}},{"$type":"Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.ElementScenarioModel, Updk7.Tests.Wpf","Name":"Arrow","Segments":{"$type":"System.Collections.Generic.List`1[[Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models.SegmentScenarioModel, Updk7.Tests.Wpf]], mscorlib","$values":[]}}]}}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\ITestsRepository.cs


using System.Windows;

namespace Updk7.Tests.Wpf
{
    public interface ITestsRepository
    {
        bool Contains(TestType testType);
        ITest GetTest(TestType testType, Pult.IDataTransport controlDeviceTransport);
        FrameworkElement GetView(TestType testType);
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\TestsRepository.cs


using System.Collections.Generic;
using System.Linq;
using System.Windows;

namespace Updk7.Tests.Wpf
{
    public class TestsRepository : ITestsRepository
    {
        private List<ITestsRepository> _repositories = new List<ITestsRepository>();

        public TestsRepository()
        {
            Add(new Questionnaires.QuestionnairesRepository());
            Add(new Questionnaires.CustomQuestionnairesRepository());
            Add(new Psychophysical.PsychophysicalRepository());
            Add(new Compatibility.CompatibilityRepository());
        }

        public void Add(ITestsRepository repository)
        {
            if (!_repositories.Contains(repository))
                _repositories.Add(repository);
        }

        public bool Contains(TestType testType)
        {
            return _repositories.Any(r => r.Contains(testType));
        }

        public ITest GetTest(TestType testType, Pult.IDataTransport controlDeviceTransport)
        {
            var repository = _repositories.FirstOrDefault(r => r.Contains(testType));
            return repository?.GetTest(testType, controlDeviceTransport);
        }

        public FrameworkElement GetView(TestType testType)
        {
            var repository = _repositories.FirstOrDefault(r => r.Contains(testType));
            return repository?.GetView(testType);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Compatibility\CompatibilityRepository.cs


using System.Windows;

namespace Updk7.Tests.Wpf.Compatibility
{
    public class CompatibilityRepository : ITestsRepository
    {
        public CompatibilityRepository()
        {
        }

        public bool Contains(TestType testType)
        {
            return testType == TestType.Опрос_совместимости;
        }

        public ITest GetTest(TestType testType, Pult.IDataTransport controlDeviceTransport)
        {
            return new ViewModels.CompatibilityViewModel();
        }

        public FrameworkElement GetView(TestType testType)
        {
            return new Views.CompatibilityView();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Compatibility\ViewModels\AssistantViewModel.cs


namespace Updk7.Tests.Wpf.Compatibility.ViewModels
{
    public enum OpinionType
    {
        NoMatter,
        Agree,
        Disagree
    }

    public class AssistantViewModel : Prism.Mvvm.BindableBase
    {
        public AssistantViewModel()
        {
        }

        private string _fullName;

        public string FullName
        {
            get { return _fullName; }
            set { SetProperty(ref _fullName, value); }
        }

        private int _id;

        public int Id
        {
            get { return _id; }
            set { SetProperty(ref _id, value); }
        }

        private OpinionType? _opinion;

        public OpinionType? Opinion
        {
            get { return _opinion; }
            set { SetProperty(ref _opinion, value); }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Compatibility\ViewModels\CompatibilityViewModel.cs


using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;

namespace Updk7.Tests.Wpf.Compatibility.ViewModels
{
    public class CompatibilityViewModel : Prism.Mvvm.BindableBase, ITest
    {
        public CompatibilityViewModel()
        {
            Assistants.CollectionChanged += onAssistantsCollectionChanged;
            CompleteTestCommand = new Prism.Commands.DelegateCommand(completeTest, canCompleteTest);
        }

        public string Title { get; } = "Опрос совместимости";

        private int _testProgress;

        public int TestProgress
        {
            get { return _testProgress; }
            private set { SetProperty(ref _testProgress, value); }
        }

        public event EventHandler<TestCompleteEventArgs> TestComplete;

        public TestParameter[] Parameters { get; private set; }

        public Prism.Commands.DelegateCommand CompleteTestCommand { get; }

        private string _assistantsTitle;

        public string AssistantsTitle
        {
            get { return _assistantsTitle; }
            private set { SetProperty(ref _assistantsTitle, value); }
        }

        public ObservableCollection<AssistantViewModel> Assistants { get; } =
            new ObservableCollection<AssistantViewModel>();

        public void Break()
        {
            clearViewModel();
        }

        public void Start(TestParameter[] parameters)
        {
            Parameters = parameters;

            clearViewModel();
            if (Parameters != null)
                setupViewModel();
        }

        private void setupViewModel()
        {
            var titleParameter = Parameters.FirstOrDefault(p => p.Key == "Title");
            if (titleParameter != null)
                AssistantsTitle = titleParameter.StringValue;

            var namesParameter = Parameters.FirstOrDefault(p => p.Key == "Names");
            if (namesParameter != null && !string.IsNullOrEmpty(namesParameter.StringValue))
            {
                var parameters = namesParameter.StringValue.Split(';');
                foreach (var parameter in parameters)
                {
                    var viewModel = new AssistantViewModel();
                    var split = parameter.Split('-');
                    viewModel.Id = int.Parse(split[0]);
                    viewModel.FullName = split[1].Trim();

                    Assistants.Add(viewModel);
                }
            }
            else
                AssistantsTitle = "Нет подходящих кандидатов для опроса";

            CompleteTestCommand.RaiseCanExecuteChanged();
        }

        private void clearViewModel()
        {
            TestProgress = 0;
            AssistantsTitle = string.Empty;

            while (Assistants.Count != 0)
                Assistants.RemoveAt(Assistants.Count - 1);
        }

        private bool canCompleteTest()
        {
            return Assistants.All(v => v.Opinion.HasValue) || Assistants.Count == 0; ;
        }

        private void completeTest()
        {
            Func<IEnumerable<AssistantViewModel>, string> map = assistants => assistants
                .Aggregate(string.Empty, (acc, a) => string.IsNullOrEmpty(acc) ? $"{a.Id}" : acc + $", {a.Id}");

            var resultString = string.Empty;
            if (Assistants.Count != 0)
            {
                var agree = map(Assistants.Where(a => a.Opinion.HasValue && a.Opinion == OpinionType.Agree));
                var disagree = map(Assistants.Where(a => a.Opinion.HasValue && a.Opinion == OpinionType.Disagree));
                var noMatter = map(Assistants.Where(a => a.Opinion.HasValue && a.Opinion == OpinionType.NoMatter));
                resultString = $"Agree: {agree}; Disagree: {disagree}; NoMatter: {noMatter}";
            }

            var testResults = new TestResults();
            testResults.Test = TestType.Опрос_совместимости;
            testResults.BeginTime = DateTime.Now;
            testResults.Values.Add(new TestResultValue("Compatibility", resultString));

            TestComplete?.Invoke(this, new TestCompleteEventArgs(testResults));
        }

        private void onAssistantPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(AssistantViewModel.Opinion))
            {
                CompleteTestCommand.RaiseCanExecuteChanged();
                if (Assistants.Count != 0)
                    TestProgress = 100 * Assistants.Count(a => a.Opinion.HasValue) / Assistants.Count;
            }
        }

        private void onAssistantsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.OldItems != null)
            {
                foreach (AssistantViewModel v in e.OldItems)
                    v.PropertyChanged -= onAssistantPropertyChanged;
            }

            if (e.NewItems != null)
            {
                foreach (AssistantViewModel v in e.NewItems)
                    v.PropertyChanged += onAssistantPropertyChanged;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Compatibility\Views\AssistantView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Compatibility.Views.AssistantView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Compatibility.Views"
             xmlns:converters="clr-namespace:Updk7.Wpf.Converters;assembly=Updk7.Wpf"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="220" />
            <ColumnDefinition Width="220" />
            <ColumnDefinition Width="220" />
        </Grid.ColumnDefinitions>
        <TextBlock 
            Grid.Column="0"
            Text="{Binding FullName}"
            Foreground="Black"
            FontSize="20"
            FontWeight="Medium"
            HorizontalAlignment="Left"
            VerticalAlignment="Center"
            />
        <RadioButton
            Grid.Column="1"
            Content="Согласен"
            FontSize="18"
            VerticalAlignment="Center"
            Style="{StaticResource FlatRectRadioButtonStyle}"
            IsChecked="{Binding Opinion, Converter={converters:EnumToBoolConverter EnumValue=Agree}}"
            />
        <RadioButton
            Grid.Column="2"
            Content="Не согласен"
            FontSize="18"
            VerticalAlignment="Center"
            Style="{StaticResource FlatRectRadioButtonStyle}"
            IsChecked="{Binding Opinion, Converter={converters:EnumToBoolConverter EnumValue=Disagree}}"
            />
        <RadioButton
            Grid.Column="3"
            FontSize="18"
            Content="Не возражаю"
            VerticalAlignment="Center"
            Style="{StaticResource FlatRectRadioButtonStyle}"
            IsChecked="{Binding Opinion, Converter={converters:EnumToBoolConverter EnumValue=NoMatter}}"
            />
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Compatibility\Views\AssistantView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Compatibility.Views
{
    /// <summary>
    /// Interaction logic for AssistantView.xaml
    /// </summary>
    public partial class AssistantView : UserControl
    {
        public AssistantView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Compatibility\Views\CompatibilityView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Compatibility.Views.CompatibilityView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Compatibility.Views"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <!--Заголовок-->
        <TextBlock
            Grid.Row="0"
            FontSize="22"
            FontWeight="Medium"
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            Text="{Binding AssistantsTitle}"
            />
        <!--Описание-->
        <TextBlock
            Grid.Row="1"
            FontSize="14"
            VerticalAlignment="Center"
            HorizontalAlignment="Center">
            Выразите свое отношение к работе в паре с нижеперечисленными людьми
        </TextBlock>
        <!--Список имен-->
        <ScrollViewer
            Grid.Row="2">
            <ListView
                Margin="3, 10, 3, 3"
                Background="Transparent"
                Foreground="Transparent"
                BorderBrush="Transparent"
                BorderThickness="0"
                ItemsSource="{Binding Assistants}"
                ScrollViewer.VerticalScrollBarVisibility="Visible">
                <ListView.Template>
                    <ControlTemplate>
                        <ItemsPresenter ScrollViewer.VerticalScrollBarVisibility="Visible" />
                    </ControlTemplate>
                </ListView.Template>
                <ListView.ItemContainerStyle>
                    <Style TargetType="{x:Type ListViewItem}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type ListViewItem}">
                                    <local:AssistantView 
                                            DataContext="{Binding}"
                                            />
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </ListView.ItemContainerStyle>
            </ListView>
        </ScrollViewer>
        <!--Кнопки управления-->
        <Grid
            Grid.Row="3">
            <Button 
                Margin="5"
                Content="Завершить опрос"
                FontSize="20"
                FontWeight="Bold"
                VerticalAlignment="Center"
                HorizontalAlignment="Center"
                Width="220"
                Height="35"
                Style="{StaticResource FlatButtonStyle}"
                Command="{Binding CompleteTestCommand}"
                />
        </Grid>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Compatibility\Views\CompatibilityView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Compatibility.Views
{
    /// <summary>
    /// Interaction logic for CompatibilityView.xaml
    /// </summary>
    public partial class CompatibilityView : UserControl
    {
        public CompatibilityView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Extensions\ListExtensions.cs


namespace System.Collections.Generic
{
    internal static class ListExtensions
    {
        public static IEnumerable<T> SeekForward<T>(this IList<T> list, int startIndex)
        {
            for (int i = startIndex; i < list.Count; i++)
                yield return list[i];
        }

        public static IEnumerable<T> SeekBackward<T>(this IList<T> list, int startIndex)
        {
            for (int i = startIndex; i >= 0; i--)
                yield return list[i];
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Extensions\TestResultExtensions.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Questionnaires.Data
{
    internal static class TestResultExtensions
    {
        public static TestResultValue Add(this TestResultValue scale, int value)
        {
            scale.Int += value;
            return scale;
        }

        public static TestResultValue Add(this TestResultValue scale, Questionnaire questionnaire,
            int answerNumber, params int[] questionNumbers)
        {
            scale.Int += questionnaire.Questions.SelectQuestions(answerNumber, questionNumbers).Count();
            return scale;
        }

        public static TestResultValue Add(this TestResultValue scale, TestResultValue addedScale)
        {
            scale.Int += addedScale.Int;
            return scale;
        }

        public static TestResultValue Add(this TestResultValue scale, Questionnaire questionnaire,
            int[] answersCost, params int[] questionNumbers)
        {
            foreach (var question in questionnaire.Questions.SelectQuestions(questionNumbers))
            {
                var answer = question.Answers.FirstOrDefault(a => a.IsSelected);
                if (answer != null)
                    scale.Int += answersCost[question.Answers.IndexOf(answer)];
            }

            return scale;
        }

        public static TestResultValue Add(this TestResultValue scale, Questionnaire questionnaire,
            Dictionary<int, int> keys)
        {
            foreach (var kvp in keys)
            {
                var question = questionnaire.Questions[kvp.Key - 1];
                if (question.Answers[kvp.Value - 1].IsSelected)
                    scale.Int += 1;
            }

            return scale;
        }

        public static TestResultValue AddWithPoints(this TestResultValue scale, Questionnaire questionnaire, int answerNumber, int answerPoints, params int[] questionNumbers)
        {
            scale.Int += questionnaire.Questions.SelectQuestions(answerNumber, questionNumbers).Count() * answerPoints;
            return scale;
        }

        public static TestResultValue Subtruct(this TestResultValue scale, Questionnaire questionnaire,
            int[] answersCost, params int[] questionNumbers)
        {
            foreach (var question in questionnaire.Questions.SelectQuestions(questionNumbers))
            {
                var answer = question.Answers.FirstOrDefault(a => a.IsSelected);
                if (answer != null)
                    scale.Int -= answersCost[question.Answers.IndexOf(answer)];
            }

            return scale;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Common.cs


using System.Collections.Generic;
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public static class Common
    {
        public static Random _rnd = new Random();

        public static string[] Letters = new string[]
        {
             "А","Б","В","Г","Д","Е","Ж","З","И","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ч","Ш","Э","Ю","Я"
        };

        public static void ClipMouse(FrameworkElement elementBounds)
        {
            if (elementBounds != null)
            {
                var startPoint = elementBounds.PointToScreen(new System.Windows.Point(1, 1));
                var endPoint = elementBounds.PointToScreen(new System.Windows.Point(elementBounds.ActualWidth, elementBounds.ActualHeight));
                System.Drawing.Rectangle mouseBounds = new System.Drawing.Rectangle(new System.Drawing.Point((int)startPoint.X, (int)startPoint.Y), new System.Drawing.Size((int)endPoint.X, (int)endPoint.Y));
                ClipCursor(ref mouseBounds);
            }
        }

        public static double GetRandomNumber(double minimum, double maximum)
        {
            return _rnd.NextDouble() * (maximum - minimum) + minimum;
        }

        public static TimeSpan GetSeconds(double seconds)
        {
            return TimeSpan.FromSeconds(seconds);
        }

        public static double Rounding(double value, int round)
        {
            return Math.Round(value, round);
        }

        /// <summary>
        /// Перемешивает значения в списке
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="list"></param>
        public static void Shuffle<T>(this IList<T> list)
        {
            int n = list.Count;
            while (n > 1)
            {
                n--;
                int k = _rnd.Next(n + 1);
                T value = list[k];
                list[k] = list[n];
                list[n] = value;
            }
        }
        public static void UnClipMouse()
        {
            ClipCursor(IntPtr.Zero);
        }

        public enum ColorsCircle
        {
            Red,
            Green,
            Yellow
        }

        public static partial class Drawing
        {
            /// <summary>
            /// Возвращает цвет
            /// </summary>
            /// <param name="color"></param>
            /// <param name="isSmooth">Если true, то возвращает цвет в RadialGradient</param>
            /// <returns></returns>
            public static Brush GetColor(ColorsCircle color, bool isSmooth = false)
            {
                switch (color)
                {
                    case ColorsCircle.Green:
                        if (isSmooth)
                        {
                            //var greenBrush = new RadialGradientBrush();
                            //GradientStop g1 = new GradientStop((Color)ColorConverter.ConvertFromString("#0014B614"), 1.0);
                            //GradientStop g2 = new GradientStop((Color)ColorConverter.ConvertFromString("#FF4BF30C"), 0.0);
                            //GradientStop g3 = new GradientStop((Color)ColorConverter.ConvertFromString("#FF14B614"), 0.8);
                            //GradientStop g4 = new GradientStop((Color)ColorConverter.ConvertFromString("#FF4FE815"), 0.26);
                            //greenBrush.GradientStops.Add(g1);
                            //greenBrush.GradientStops.Add(g2);
                            //greenBrush.GradientStops.Add(g3);
                            //greenBrush.GradientStops.Add(g4);
                            //return greenBrush;
                            return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF50D550"));
                        }
                        else return new SolidColorBrush(new Color() { R = 30, G = 200, B = 50, A = 255 });
                    case ColorsCircle.Yellow:
                        return new SolidColorBrush(new Color() { R = 255, G = 240, B = 0, A = 255 });
                    case ColorsCircle.Red:
                        return new SolidColorBrush(new Color() { R = 240, G = 40, B = 5, A = 255 });
                }
                return null;
            }
        }

        public static partial class Mathematic
        {
            public static double ToRadians(double angle)
            {
                return (Math.PI * angle) / 180;
            }
        }

        [DllImport("user32.dll")]
        private static extern void ClipCursor(ref System.Drawing.Rectangle rect);

        [DllImport("user32.dll")]
        private static extern void ClipCursor(IntPtr rect);
    }
}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ContinueViewModel.cs

using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class ContinueViewModel : INotifyPropertyChanged,IDisposable
    {
        private ITestManager _manager;
        public ContinueViewModel(ITestManager testManager)
        {
            _manager = testManager;
            _manager.Buttons.ButtonPressed += _buttons_ButtonPressed;
            _manager.Buttons.Disconnected += Buttons_Disconnected;
            _manager.Buttons.Start();
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Unsubscribe();
        }

        private void _buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            switch (e.Button)
            {
                case PultButton.Green:
                    Preview_Command.Execute(null);
                    break;
                case PultButton.Yellow:
                    RestartLearning_Command.Execute(null);
                    break;
                case PultButton.Red:
                    StartMain_Command.Execute(null);
                    break;
                case PultButton.Black:
                    TextInstruction_Command.Execute(null);
                    break;
            }
        }

        private void Unsubscribe()
        {
            _manager.Buttons.ButtonPressed -= _buttons_ButtonPressed;
        }

        public RelayCommand RestartLearning_Command => new RelayCommand(obj =>
        {
            Unsubscribe();
            _manager.Buttons.Stop();
            _manager.Learning();
        });

        public RelayCommand Preview_Command => new RelayCommand(obj =>
        {
            Unsubscribe();
            _manager.Buttons.Stop();
            _manager.ToInstruction();
        });

        public RelayCommand StartMain_Command => new RelayCommand(obj =>
        {
            Unsubscribe();
            _manager.Buttons.Stop();
            _manager.Start();
        });

        public RelayCommand TextInstruction_Command => new RelayCommand(obj =>
        {
            Unsubscribe(); 
            _manager.Buttons.Stop();
            _manager.ToTextInstruction();
        });

        private FrameworkElement _elementForScreen;

        public FrameworkElement ElementForScreen
        {
            get => _elementForScreen;
            set
            {
                _elementForScreen = value;
                OnPropertyChanged();
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged([CallerMemberName] string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }

        public void Dispose()
        {
            Unsubscribe();
        }
    }
}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EnumTests.cs


using System.ComponentModel;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public enum EnumTests
    {
        /// <summary>
        /// Тремор 3 отверстия
        /// </summary>
        [Description("Тремор 3 отверстия")]
        Tremor3Test,

        /// <summary>
        /// Глазомер
        /// </summary>
        [Description("Глазомер")]
        AccurateEye,

        /// <summary>
        /// Оценка готовности к тестированию
        /// </summary>
        [Description("Оценка готовности к тестированию")]
        ReadinessAssessmentTesting,

        /// <summary>
        /// Уровень восприятия скорости и расстояния
        /// </summary>
        [Description("Уровень восприятия скорости и расстояния")]
        LevelOfPerceptionOfSpeedAndDistance,

        /// <summary>
        /// Оценка склонности к риску
        /// </summary>
        [Description("Оценка склонности к риску")]
        AssessmentOfPropensityToTakeRisks,

        /// <summary>
        /// Эмоциональная устойчивость
        /// </summary>
        [Description("Эмоциональная устойчивость")]
        EmotionalStability,

        /// <summary>
        /// Распределение внимания
        /// </summary>
        [Description("Распределение внимания")]
        AttentionDistribution,

        /// <summary>
        /// Сложная двигательная реакция (по 310у)
        /// </summary>
        [Description("Сложная двигательная реакция (по 310у)")]
        ComplexMotorReaction310,

        /// <summary>
        /// Сложная двигательная реакция 30
        /// </summary>
        [Description("Сложная двигательная реакция 30")]
        ComplexMotorableReaction30,

        /// <summary>
        /// Сложная двигательная реакция – М (СДР-М)
        /// </summary>
        [Description("Сложная двигательная реакция – М (СДР-М)")]
        ComplexMotorReaction_M,

        /// <summary>
        /// Оценка монотоноустойчивости
        /// </summary>
        [Description("Оценка монотоноустойчивости")]
        EstimationOfStabilityToMonotonistance,

        /// <summary>
        /// Оценка бдительности
        /// </summary>
        [Description("Оценка бдительности")]
        VigilanceAssessment,

        /// <summary>
        /// Оценка устойчивости внимания (УВ)
        /// </summary>
        [Description("Оценка устойчивости внимания (УВ)")]
        EstimationOfStabilityOfAttention,

        /// <summary>
        /// Концентрация внимания
        /// </summary>
        [Description("Концентрация внимания")]
        ConcentrationAttention,

        /// <summary>
        /// Тест ЭПБ (экспресс-проба бдительности - УРБ)
        /// </summary>
        [Description("Тест ЭПБ (экспресс-проба бдительности - УРБ)")]
        ExpressSampleVigilance,

        /// <summary>
        /// Тест «Готовность к Экстренным Действиям» (ГЭД)
        /// </summary>
        [Description("Тест «Готовность к Экстренным Действиям» (ГЭД)")]
        ReadinessForEmergencyAction,

        /// <summary>
        /// Тест «Готовность к Экстренным Действиям - 2» (ГЭД-2)
        /// </summary>
        [Description("Тест «Готовность к Экстренным Действиям - 2» (ГЭД-2)")]
        ReadinessForEmergencyAction_2,

        /// <summary>
        /// Тест Корректурная проба (КП)
        /// </summary>
        [Description("Тест Корректурная проба (КП)")]
        CorrectiveTestSample,

        /// <summary>
        /// Тест КЧССМ. Методика определения критической частоты слияния световых мельканий
        /// </summary>
        [Description("Тест КЧССМ. Методика определения критической частоты слияния световых мельканий")]
        MethodCriticalFrequencyLightFlares,

        /// <summary>
        /// Тест «Игра 5»
        /// </summary>
        [Description("Тест «Игра 5»")]
        Game5,

        /// <summary>
        /// Тест «Проба на моторную согласованность»  (МС)
        /// </summary>
        [Description("Тест «Проба на моторную согласованность»  (МС)")]
        TestForMotorableCoherence,

        /// <summary>
        /// Тест Чувство времени (ЧВ)
        /// </summary>
        [Description("Тест Чувство времени (ЧВ)")]
        FeelingTime,

        /// <summary>
        /// Тест «Теппинг-тест»
        /// </summary>
        [Description("Тест «Теппинг-тест»")]
        TeppingTest,

        /// <summary>
        /// Методика оценки объёма внимания
        /// </summary>
        [Description("Методика оценки объёма внимания")]
        AssesmentMethodOnVolumeAttentions,

        /// <summary>
        /// Тест «Скорость переделки навыков (СПН)»
        /// </summary>
        [Description("Тест «Скорость переделки навыков (СПН)»")]
        SpeedAlterationSkills,

        /// <summary>
        /// Тест Простая двигательная реакция (ПДР)
        /// </summary>
        [Description("Тест Простая двигательная реакция (ПДР)")]
        SimpleMotorableReaction,

        /// <summary>
        /// Тест «Реакция на движущийся объект» (РДО)
        /// </summary>
        [Description("Тест «Реакция на движущийся объект» (РДО)")]
        ReactionToAMovingObject,

        /// <summary>
        /// Тест «Статический тремор»
        /// </summary>
        [Description("Тест «Статический тремор»")]
        StaticTremor,

        /// <summary>
        /// Тест «Оценка стрессоустойчивости» (СТР) (по 310у)
        /// </summary>
        [Description("Тест «Оценка стрессоустойчивости» (СТР) (по 310у)")]
        StressEvaluationSTR,

        /// <summary>
        /// Тест «Оценка стрессоустойчивости – М» (СТР-М)
        /// </summary>
        [Description("Тест «Оценка стрессоустойчивости – М» (СТР-М)")]
        StressEvaluationM,

        /// <summary>
        /// Тест «ПЕРЕКЛЮЧЕНИЕ ВНИМАНИЯ-2 (ПВ-2)»
        /// </summary>
        [Description("Тест «ПЕРЕКЛЮЧЕНИЕ ВНИМАНИЯ-2 (ПВ-2)»")]
        SwitchAttention2,

        /// <summary>
        /// Тест «Переключение внимания и помехоустойчивость» (ПВ и ПУ)
        /// </summary>
        [Description("Тест «Переключение внимания и помехоустойчивость» (ПВ и ПУ)")]
        SwitchAttention,

        /// <summary>
        /// Теппинг 310
        /// </summary>
        [Description("Теппинг 310")]
        Tepping310,

        /// <summary>
        /// Методика оценки оперативной памяти (ОВ-м)
        /// </summary>
        [Description("Методика оценки оперативной памяти (ОВ-м)")]
        MethodAssesmentOperationMemory,

        /// <summary>
        /// Оценка стрессоустойчивости-(СТР-м2)
        /// </summary>
        [Description("Оценка стрессоустойчивости (СТР-м2)")]
        StressEvaluationM2,

        /// <summary>
        /// Оценка бдительности (ОБ-м)
        /// </summary>
        [Description("Оценка бдительности (ОБ-м)")]
        VigilanceAssessmentM,

        /// <summary>
        /// Оценка монотоноустойчивости ОМУ-м
        /// </summary>
        [Description("Оценка монотоноустойчивости ОМУ-м")]
        EstimationOfStabilityToMonotonistanceM,
        
        /// <summary>
        /// Тест «Готовность к Экстренным Действиям» (ГЭД-1М)
        /// </summary>
        [Description("Тест «Готовность к Экстренным Действиям» (ГЭД-1М)")]
        ReadinessForEmergencyActionM,

        /// <summary>
        /// Тест «Готовность к Экстренным Действиям» (ГЭД-2М)
        /// </summary>
        [Description("Тест «Готовность к Экстренным Действиям» (ГЭД-2М)")]
        ReadinessForEmergencyAction_2M,

        /// <summary>
        /// Глазомер - М
        /// </summary>
        [Description("Оценка глазомера - М")]
        AccurateEye_M,

        [Description("Тест «Оценка моторной согласованности – М»  (МС-м)")]
        TestForMotorableCoherence_M,

        Unknown
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ExceptionCodes.cs


namespace Updk7.Tests.Wpf.Psychophysical
{
    public static class ExceptionCodes
    {
        public static class StressEvaluationMCodes
        {
            public const string Vm_Error_ControlResults_Code = "StressEM_C_Result";
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\GenericStyles.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="./Styles/BaseStyles.xaml"/>
        <ResourceDictionary Source="./Instructions/Instructions.xaml"/>
        <ResourceDictionary Source="./Tremor3/Views.xaml"/>
        <ResourceDictionary Source="./AccurateEye/Views.xaml"/>
        <ResourceDictionary Source="./ReadinessAssessmentTesting/Views.xaml"/>
        <ResourceDictionary Source="./LevelOfPerceptionOfSpeedAndDistance/Views.xaml"/>
        <ResourceDictionary Source="./AssessmentOfPropensityToTakeRisks/Views.xaml"/>
        <ResourceDictionary Source="./EmotionalStability/Views.xaml"/>
        <ResourceDictionary Source="./AttentionDistribution/Views.xaml"/>
        <ResourceDictionary Source="./ComplexMotorReaction/Views.xaml"/>
        <ResourceDictionary Source="./ComplexMotorReaction_M/Views.xaml"/>
        <ResourceDictionary Source="./EstimationOfStabilityToMonotonistance/Views.xaml"/>
        <ResourceDictionary Source="./VigilanceAssessment/Views.xaml"/>
        <ResourceDictionary Source="./EstimationOfStabilityOfAttention/Views.xaml"/>
        <ResourceDictionary Source="./ConcentrationAttention/Views.xaml"/>
        <ResourceDictionary Source="./ExpressSampleVigilance/Views.xaml"/>
        <ResourceDictionary Source="./ReadinessForEmergencyAction/Views.xaml"/>
        <ResourceDictionary Source="./ReadinessForEmergencyAction_2/Views.xaml"/>
        <ResourceDictionary Source="./CorrectiveTestSample/Views.xaml"/>
        <ResourceDictionary Source="./MethodCriticalFrequencyLightFlares/Views.xaml"/>
        <ResourceDictionary Source="./Game5/Views.xaml"/>
        <ResourceDictionary Source="./TestForMotorableCoherence/Views.xaml"/>
        <ResourceDictionary Source="./FeelingTime/Views.xaml"/>
        <ResourceDictionary Source="./TeppingTest/Views.xaml"/>
        <ResourceDictionary Source="./AssesmentMethodOnVolumeAttentions/Views.xaml"/>
        <ResourceDictionary Source="./SpeedAlterationSkills/Views.xaml"/>
        <ResourceDictionary Source="./SimpleMotorableReaction/Views.xaml"/>
        <ResourceDictionary Source="./ReactionToAMovingObject/Views.xaml"/>
        <ResourceDictionary Source="./StaticTremor/Views.xaml"/>
        <ResourceDictionary Source="./StressEvaluationSTR/Views.xaml"/>
        <ResourceDictionary Source="./StressEvaluationM/Views.xaml"/>
        <ResourceDictionary Source="./SwitchAttention2/Views.xaml"/>
        <ResourceDictionary Source="./SwitchAttention/Views.xaml"/>
        <ResourceDictionary Source="./Tepping310/Views.xaml"/>
        <ResourceDictionary Source="./ReadinessForEmergencyActionM/Views.xaml"/>
        <ResourceDictionary Source="./ReadinessForEmergencyAction_2M/Views.xaml"/>
        <ResourceDictionary Source="./AccurateEye_M/Views.xaml"/>
        <ResourceDictionary Source="./TestOfMotorableCoherence_M/Views.xaml"/>
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\IContinue.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public interface IContinue
    {
        object ContinueViewModel { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\InstructionsFactory.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Documents;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public static class InstructionsFactory
    {
        private static readonly List<TestInstruction> _instructions = new List<TestInstruction>()
        {
            new TestInstruction() { TestType = EnumTests.AccurateEye, InstructionNames = new List<string>(){ "accurateEyeInstruction" } },
            new TestInstruction() { TestType = EnumTests.AssesmentMethodOnVolumeAttentions, InstructionNames = new List<string>{ "assesmentMethodOnVolumeAttentionsInstruction" } },
            new TestInstruction() { TestType = EnumTests.AccurateEye_M, InstructionNames = new List<string>{ "accurateEyeInstruction_m" } },
            new TestInstruction() { TestType = EnumTests.AssessmentOfPropensityToTakeRisks, InstructionNames = new List<string>{ "assessmentOfPropensityToTakeRisksInstruction" } },
            new TestInstruction()
            {
                TestType = EnumTests.AttentionDistribution,
                InstructionNames = new List<string>
                {
                    "attentionDistributionMainInstruction",
                    "attentionDistributionInstruction1",
                    "attentionDistributionInstruction2"
                }
            },
            new TestInstruction() { TestType = EnumTests.ComplexMotorReaction310, InstructionNames = new List<string>(){ "complexMotorReactionInstruction" } },
            new TestInstruction() { TestType = EnumTests.ComplexMotorableReaction30, InstructionNames = new List<string>(){ "complexMotorReactionInstruction" } },
            new TestInstruction()
            {
                TestType = EnumTests.ComplexMotorReaction_M,
                InstructionNames = new List<string>()
                {
                    "complexMotorReaction_M_MainInstruction",
                    "complexMotorReaction_M_instruction1",
                    "complexMotorReaction_M_instruction2"
                }
            },
            new TestInstruction() { TestType = EnumTests.ConcentrationAttention, InstructionNames = new List<string>{ "concentrationAttention_instruction" } },
            new TestInstruction() { TestType = EnumTests.CorrectiveTestSample, InstructionNames = new List<string>{ "correctiveTestSample_instruction" } },
            new TestInstruction() { TestType = EnumTests.EmotionalStability, InstructionNames = new List<string>{ "emotionalStability_instruction" } },
            new TestInstruction() { TestType = EnumTests.EstimationOfStabilityOfAttention, InstructionNames = new List<string>{ "estimationOfStabilityOfAttention_instruction" } },
            new TestInstruction() { TestType = EnumTests.EstimationOfStabilityToMonotonistance, InstructionNames = new List<string>{ "estimationOfStabilityToMonotonistance_instruction" }},
            new TestInstruction() { TestType = EnumTests.EstimationOfStabilityToMonotonistanceM, InstructionNames = new List<string>{ "estimationOfStabilityToMonotonistance_instruction" }},
            new TestInstruction() { TestType = EnumTests.ExpressSampleVigilance, InstructionNames = new List<string>{ "expressSampleVigilance_instruction" } },
            new TestInstruction() { TestType = EnumTests.FeelingTime, InstructionNames = new List<string>{ "feelingTime_instruction" } },
            new TestInstruction() { TestType = EnumTests.Game5, InstructionNames = new List<string>{ "game5_instruction" } },
            new TestInstruction() { TestType = EnumTests.LevelOfPerceptionOfSpeedAndDistance, InstructionNames = new List<string>{ "levelOfPerceptionOfSpeedAndDistance_instruction" } },
            new TestInstruction() { TestType = EnumTests.MethodAssesmentOperationMemory, InstructionNames = new List<string>{ "assesmentMethodOnVolumeAttentionsInstruction" } },
            new TestInstruction() { TestType = EnumTests.MethodCriticalFrequencyLightFlares, InstructionNames = new List<string>{ "methodCriticalFrequencyLightFlares_instruction" } },
            new TestInstruction() { TestType = EnumTests.ReactionToAMovingObject, InstructionNames = new List<string>{ "reactionToAMovingObject_instruction" } },
            new TestInstruction() { TestType = EnumTests.ReadinessAssessmentTesting, InstructionNames = new List<string>{ "readinessAssessmentTesting_instruction" } },
            new TestInstruction() { TestType = EnumTests.ReadinessForEmergencyAction, InstructionNames = new List<string>{ "readinessForEmergencyAction_instruction" } },
            new TestInstruction() { TestType = EnumTests.ReadinessForEmergencyAction_2, InstructionNames = new List<string>{ "readinessForEmergencyAction_2_instruction" } },
            new TestInstruction() { TestType = EnumTests.ReadinessForEmergencyAction_2M,InstructionNames = new List<string>{ "readinessForEmergencyAction_2_instruction" } },
            new TestInstruction() { TestType = EnumTests.ReadinessForEmergencyActionM, InstructionNames = new List<string>{ "readinessForEmergencyAction_instruction" } },
            new TestInstruction() { TestType = EnumTests.SimpleMotorableReaction, InstructionNames = new List<string>{ "simpleMotorableReaction_instruction" } },
            new TestInstruction() { TestType = EnumTests.SpeedAlterationSkills, InstructionNames = new List<string>{ "speedAlterationSkills_instruction" } },
            new TestInstruction() { TestType = EnumTests.StaticTremor, InstructionNames = new List<string>{ "staticTremor_instruction" } },
            new TestInstruction()
            {
                TestType = EnumTests.StressEvaluationM, InstructionNames = new List<string>
                {
                    "stressEvaluationM_MainInstruction",
                    "stressEvaluationM_instruction1",
                    "stressEvaluationM_instruction2",
                    "stressEvaluationM_instruction3",
                    "stressEvaluationM_instruction4"
                }
            },
            new TestInstruction()
            {
               TestType = EnumTests.StressEvaluationM2, InstructionNames = new List<string>
               {
                   "stressEvaluationM_MainInstruction",
                   "stressEvaluationM_instruction1",
                   "stressEvaluationM_instruction2",
                   "stressEvaluationM_instruction3",
                   "stressEvaluationM_instruction4"
               }
            },
            new TestInstruction()
            {
               TestType = EnumTests.StressEvaluationSTR, InstructionNames = new List<string>
               {
                   "stressEvaluationSTR_MainInstruction",
                   "stressEvaluationSTR_instruction1",
                   "stressEvaluationSTR_instruction2",
                   "stressEvaluationSTR_instruction3",
                   "stressEvaluationSTR_instruction4"
               }
            },
            new TestInstruction()
            {
                TestType = EnumTests.SwitchAttention, InstructionNames = new List<string>
                {
                    "switchAttention_MainInstruction",
                    "switchAttention_instruction1",
                    "switchAttention_instruction2",
                    "switchAttention_instruction3",
                    "switchAttention_instruction4"
                }
            },
            new TestInstruction()
            {
                TestType = EnumTests.SwitchAttention2, InstructionNames = new List<string>
                {
                    "switchAttention2_MainInstruction",
                    "switchAttention2_instruction1",
                    "switchAttention2_instruction2",
                    "switchAttention2_instruction3",
                    "switchAttention2_instruction4"
                }
            },
            new TestInstruction() { TestType = EnumTests.Tepping310, InstructionNames = new List<string> { "tepping310_instruction" } },
            new TestInstruction() { TestType = EnumTests.TeppingTest, InstructionNames = new List<string> { "teppingTest_instruction" } },
            new TestInstruction() { TestType = EnumTests.TestForMotorableCoherence, InstructionNames = new List<string> { "testForMotorableCoherence_instruction" } },
            new TestInstruction() { TestType = EnumTests.TestForMotorableCoherence_M, InstructionNames = new List<string> { "testForMotorableCoherence_m_instruction" } },
            new TestInstruction() { TestType = EnumTests.Tremor3Test, InstructionNames = new List<string> { "tremor3_instruction" } },
            new TestInstruction() { TestType = EnumTests.VigilanceAssessment ,InstructionNames = new List<string> { "vigilanceAssessment_instruction" } },
            new TestInstruction() { TestType = EnumTests.VigilanceAssessmentM ,InstructionNames = new List<string> { "vigilanceAssessment_instruction" } }

        };
        public static FlowDocument GetInstruction(EnumTests testType, int instructionNumber, ResourceDictionary resourceDictionary)
        {
            var testInstructions = _instructions.FirstOrDefault(f => f.TestType == testType);
            if (testInstructions != null)
                return (FlowDocument)resourceDictionary[testInstructions.InstructionNames[instructionNumber]];
            return null;
        }
    }

    public class TestInstruction
    {
        public EnumTests TestType { get; set; }
        public List<string> InstructionNames { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\InstructionView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.InstructionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <local:MainView x:Name="mainView" DataContext="{Binding Main}"/>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\InstructionView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public partial class InstructionView : UserControl
    {
        public InstructionView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\InstructionViewModel.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Updk7.Tests.Pult;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.ViewModels;
using Updk7.Tests.Wpf.Source.Psychophysical.LearningTasksExtension;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class InstructionViewModel : INotifyPropertyChanged,IDisposable
    {
        private readonly ITestManager _manager;
        private MainViewModel _main;

        public MainViewModel Main
        {
            get { return _main; }
            set
            {
                _main = value;
                OnPropertyChanged();
            }
        }

        private bool _isBetween;

        public bool IsBetween
        {
            get { return _isBetween; }
            set
            {
                _isBetween = value;
                OnPropertyChanged();
            }
        }

        public FrameworkElement TestControl { get; private set; }
        public EnumTests Type { get; private set; }
        public string InstructionName { get; private set; }
        public InstructionViewModel(EnumTests testType, string instructionName, ITestManager manager, FrameworkElement testControl, bool isBetween = false)
        {
            IsBetween = isBetween;
            _manager = manager;
            TestControl = testControl;
            (TestControl as ILearning).Mode = TestMode.Manual;
            InstructionName = instructionName;
            Type = testType;
            Initialize();
        }

        public void Initialize()
        {
            TestManager manager = _manager as TestManager;
            StudyAssignmentModel model = ModelSelector.GetModel(InstructionName);
            if (model == null)
                model = GetModel(manager);

            MainViewModel main = new MainViewModel(TestControl, model, InstructionName, true, IsBetween);
            main.WaitingOuterAction += Main_WaitingOuterAction;
            main.Try += Main_Try;
            main.Replay += Main_Replay;
            main.ToTest += Main_ToTest;
            main.ToTextInstruction += Main_ToTextInstruction;
            main.Stop += Main_Stop;
            Main = main;
            TestControl.Loaded += TestControl_Loaded;
        }

        private PultButtons _buttons;
        private void Main_Stop(object sender, EventArgs e)
        {
            _buttons = _manager.Buttons;
            _buttons.ButtonPressed += _buttons_ButtonPressed;
            _buttons.Disconnected += _buttons_Disconnected;
            _buttons.Start();
        }

        private void _buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            UnsubscribeButtons();
        }

        private void UnsubscribeButtons()
        {
            _buttons.ButtonPressed -= _buttons_ButtonPressed;
            _buttons.Disconnected -= _buttons_Disconnected;
        }

        private void _buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            _buttons.Stop();
            UnsubscribeButtons();
            switch (e.Button)
            {
                case PultButton.Green:
                    _main.Try_Command.Execute(null);
                    break;
                case PultButton.Yellow:
                    _main.Replay_Command.Execute(null);
                    break;
                case PultButton.Red:
                    _main.ToTest_Command.Execute(null);
                    break;
                case PultButton.Black:
                    _main.ToInstruction_Command.Execute(null);
                    break;
            }
           
        }

        private void Main_ToTextInstruction(object sender, EventArgs e)
        {
            _buttons.Stop();
            _manager.ToTextInstruction();
            UnsubscribeButtons();
            
        }

        private void Main_ToTest(object sender, EventArgs e)
        {
            _buttons.Stop();
            _manager.Start();
            UnsubscribeButtons();
        }

        private void Main_Replay(object sender, EventArgs e)
        {
            _buttons.Stop();
            _manager.ToInstruction();
            UnsubscribeButtons();
        }

        private void Main_Try(object sender, EventArgs e)
        {
            _buttons.Stop();
            _manager.Learning();
            UnsubscribeButtons();
        }

        private void TestControl_Loaded(object sender, RoutedEventArgs e)
        {
            TestControl.Loaded -= TestControl_Loaded;
            Main.Initialize();
        }

        private StudyAssignmentModel GetModel(TestManager manager)
        {
            StudyAssignmentModel model = new StudyAssignmentModel(manager.TraningTime);
            List<string> elementNames = TestElementNames.GetElementNamesByTypeTest(Type);
            for (int i = 0; i < elementNames.Count; i++)
            {
                ElementScenarioModel newElementScenario = new ElementScenarioModel();
                newElementScenario.Name = elementNames[i];
                model.AddElementScenario(newElementScenario);
            }

            return model;
        }

        private IStopper _currentStopper;
        private void Main_WaitingOuterAction(object sender, IStopper e)
        {
            _currentStopper = e;
        }

        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged([CallerMemberName] string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }

        public void Dispose()
        {
            Main?.Dispose();
        }
    }

    internal static class ModelSelector
    {
        public static StudyAssignmentModel GetModel(string instructionName)
        {
            var currrentDirectory = Directory.GetCurrentDirectory();
            var scenarionsDirectory = $"{ currrentDirectory }\\Scenarions";
            var isExistScenariosCatalog = Directory.Exists(scenarionsDirectory);
            if (!isExistScenariosCatalog)
                Directory.CreateDirectory(scenarionsDirectory);
            string path = $@"{scenarionsDirectory}\{instructionName}.json";
            if (File.Exists(path))
            {
                StudyAssignmentModel model = JsonFileGenerator.GetModel(path);
                return model;
            }
            return null;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\IPsychophysicalTest.cs


using System;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public interface IPsychophysicalTest : IDisposable
    {
        event EventHandler<Results> Results;
        void Stop();
        void Start();
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ITestManager.cs


using System.Windows;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public interface ITestManager
    {
       Pult.PultButtons Buttons { get; set; }
       void Start();
       TestProxy TestProxy { get; set; }
       TestBase Test { get; set; }
       InstructionViewModel Instruction { get; set; }
       void ToStartView();
       void ToInstruction();
       void Learning();
       void ToTextInstruction();
       void ToActionMenu();
       void Stop();
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ITestQuest.cs


namespace Updk7.Tests.Wpf.Psychophysical
{
    public interface ITestQuest
    {
        void TestStart();
        void TestStop();
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTaskHeaderView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTaskHeaderView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800" Height="50" Width="250">
    <Grid>
        <TextBlock
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            Text="Учебное задание" 
            Foreground="White"
            FontSize="24"
            FontFamily="Segoe Print"/>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTaskHeaderView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public partial class LearningTaskHeaderView : UserControl
    {
        public LearningTaskHeaderView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\MessageBoxControl.cs


using System.Windows;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class MessageBoxControl:NotifyViewModelBase
    {
        public string Message
        {
            get { return (string)GetValue(MessageProperty); }
            set { SetValue(MessageProperty, value); }
        }

        public static readonly DependencyProperty MessageProperty =
            DependencyProperty.Register("Message", typeof(string), typeof(MessageBoxControl), new PropertyMetadata("", MessageFieldChanged));

        private static void MessageFieldChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue != e.OldValue)
                (d as MessageBoxControl).MessageT = (string)e.NewValue;
        }

        private string _messageT;
        public string MessageT
        {
            get { return _messageT; }
            set
            {
                _messageT = value;
                OnPropertyChanged();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\NeuroTimer.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class NeuroTimer : IDisposable
    {
        public event EventHandler Tick;
        private SynchronizationContext _context;
        public TimeSpan Interval { get; set; } = TimeSpan.FromSeconds(1.0);
        public NeuroTimer()
        {

        }
        Timer _timer;
        public void Start()
        {
            _isDisposed = false;
            TimerCallback timerCallback = new TimerCallback(IntervalDone);
            _timer = new Timer(new TimerCallback(IntervalDone), null, TimeSpan.FromMilliseconds(0), Interval);
            _context = SynchronizationContext.Current;
            _isStarted = true;
        }

        private void IntervalDone(object timerState)
        {
            if (_context != null)
                _context.Post(_ =>
                {
                    if (_isStarted)
                        Tick?.Invoke(this, new EventArgs());
                    else if (!_isDisposed)
                        _timer?.Change(Timeout.Infinite, Timeout.Infinite);
                },
                null);

        }

        private bool _isStarted = false;
        public void Stop()
        {
            if (_context != null)
                _context.Post(_ =>
                {
                    _isStarted = false;
                }, null);
        }

        private bool _isDisposed = false;
        public void Dispose()
        {
            if (!_isDisposed)
            {
                _timer?.Dispose();
                _isDisposed = true;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\NotifyBase.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class NotifyBase : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged([CallerMemberName] string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\NotifyViewModelBase.cs


using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Controls;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public abstract class NotifyViewModelBase : ContentControl, INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged([CallerMemberName]string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\PsychophysicalRepository.cs


using System;
using System.ComponentModel;
using System.Windows;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class PsychophysicalRepository : ITestsRepository
    {
        private PsychophysicalTestFactory _testFactory = null;
        private IPsychophysicalTest _test;

        public PsychophysicalRepository()
        {
            _testFactory = new PsychophysicalTestFactory();
        }

        public bool Contains(TestType testType)
        {
            return getPsyhoTestTypeByTestType(testType) != EnumTests.Unknown ? true : false;
        }

        public ITest GetTest(TestType testType, Pult.IDataTransport controlDeviceTransport)
        {
            var psyhoTest = _testFactory.CreateTest(controlDeviceTransport, getPsyhoTestTypeByTestType(testType));
            _test = psyhoTest;
            return new PsyhoTestToITest(psyhoTest, testType);
        }

        public FrameworkElement GetView(TestType testType)
        {
            return _test as FrameworkElement;
        }

        private EnumTests getPsyhoTestTypeByTestType(TestType type)
        {
            switch (type)
            {
                case TestType.Готовность_к_тестированию_ЭПФС: return EnumTests.ReadinessAssessmentTesting;
                case TestType.Оценка_склонности_к_риску_ОСР: return EnumTests.AssessmentOfPropensityToTakeRisks;
                case TestType.Распределение_внимания_РВ: return EnumTests.AttentionDistribution;
                case TestType.Оценка_монотоноустойчивости_ОМУ: return EnumTests.EstimationOfStabilityToMonotonistance;
                case TestType.Оценка_бдительности_ОБ: return EnumTests.VigilanceAssessment;
                case TestType.Оценка_устойчивости_внимания_УВ: return EnumTests.EstimationOfStabilityOfAttention;
                case TestType.Концентрация_внимания_КВ: return EnumTests.ConcentrationAttention;
                case TestType.Оценка_скорости_переделки_навыков_СПН: return EnumTests.SpeedAlterationSkills;
                case TestType.Эмоциональная_устойчивость_ЭУ: return EnumTests.EmotionalStability;
                case TestType.Оценка_объема_внимания_ОВ: return EnumTests.AssesmentMethodOnVolumeAttentions;
                case TestType.Оценка_глазомера_ОГ: return EnumTests.AccurateEye;
                case TestType.Корректурная_проба_КП: return EnumTests.CorrectiveTestSample;
                case TestType.Оценка_стрессоустойчивости_СТР: return EnumTests.StressEvaluationSTR;
                case TestType.Оценка_стрессоустойчивости_М_СТР_М: return EnumTests.StressEvaluationM;
                case TestType.Сложная_двигательная_реакция_30_СДР_30: return EnumTests.ComplexMotorableReaction30;
                case TestType.Сложная_двигательная_реакция_СДР_100: return EnumTests.ComplexMotorReaction310;
                case TestType.Простая_двигательная_реакция_ПДР: return EnumTests.SimpleMotorableReaction;
                case TestType.Критическая_частота_слияния_миганий_КЧСМ: return EnumTests.MethodCriticalFrequencyLightFlares;
                case TestType.Чувство_времени_ЧВ: return EnumTests.FeelingTime;
                case TestType.Теппинг_тест_310_ТЕП_310: return EnumTests.Tepping310;
                case TestType.Статический_тремор_ТРЕМ: return EnumTests.StaticTremor;
                case TestType.Готовность_к_экстренному_действию_ГЭД: return EnumTests.ReadinessForEmergencyAction;
                case TestType.Готовность_к_экстренному_действию_2_ГЭД_2: return EnumTests.ReadinessForEmergencyAction_2;
                case TestType.Экспресс_проба_бдительности_УРБ: return EnumTests.ExpressSampleVigilance;
                case TestType.Реакция_на_движущийся_объект_РДО: return EnumTests.ReactionToAMovingObject;
                case TestType.Переключение_внимания_и_помехоустойчивость_ПВПУ: return EnumTests.SwitchAttention;
                case TestType.Переключение_внимания_2_ПВ_2: return EnumTests.SwitchAttention2;
                case TestType.Тест_Игра_5: return EnumTests.Game5;
                case TestType.Уровень_восприятия_скорости_и_расстояния_УВСР: return EnumTests.LevelOfPerceptionOfSpeedAndDistance;
                case TestType.Сложная_двигательная_реакция_СДР_М: return EnumTests.ComplexMotorReaction_M;
                case TestType.Проба_на_моторную_согласованность_МС: return EnumTests.TestForMotorableCoherence;
                case TestType.Теппинг_тест: return EnumTests.TeppingTest;
                case TestType.Тремор_3: return EnumTests.Tremor3Test;
                case TestType.Методика_оценки_оперативной_памяти_ОВ_М: return EnumTests.MethodAssesmentOperationMemory;
                case TestType.Оценка_стрессоустойчивости_СТР_M2: return EnumTests.StressEvaluationM2;
                case TestType.Оценка_бдительности_ОБ_М: return EnumTests.VigilanceAssessmentM;
                case TestType.Оценка_монотоноустойчивости_ОМУ_М: return EnumTests.EstimationOfStabilityToMonotonistanceM;
                case TestType.Готовность_к_экстренным_действиям_ГЭД_1М: return EnumTests.ReadinessForEmergencyActionM;
                case TestType.Готовность_к_экстренным_действиям_ГЭД_2М: return EnumTests.ReadinessForEmergencyAction_2M;
                case TestType.Оценка_глазомера_М: return EnumTests.AccurateEye_M;
                case TestType.Оценка_моторной_согласованности_М_МС_м: return EnumTests.TestForMotorableCoherence_M;
            }
            return EnumTests.Unknown;
        }
    }

    public class PsyhoTestToITest : ITest
    {
        public IPsychophysicalTest Test { get; }
        public TestType TestType { get; }
        public PsyhoTestToITest(IPsychophysicalTest test, TestType type)
        {
            Test = test;
            TestType = type;
            Test.Results += _test_Results;
        }

        private void _test_Results(object sender, Results e)
        {
            TestCompleteEventArgs resultsArgs = null;
            if (e.ResultsTest != null)
            {
                TestResults results = new TestResults(TestType);
                foreach (var res in e.ResultsTest)
                    results.AddValue(new TestResultValue(res.Key, res.Value));
                resultsArgs = new TestCompleteEventArgs(results) { Exception = e.Exception };
            }
            Test.Dispose();
            TestComplete?.Invoke(this, resultsArgs);
        }

        public string Title { get; set; }

        public TestParameter[] Parameters { get; set; }

        public int TestProgress { get; set; }

        public event EventHandler<TestCompleteEventArgs> TestComplete;
        public event PropertyChangedEventHandler PropertyChanged;

        public void Break()
        {
            Test.Dispose();
        }

        public void Start(TestParameter[] parameters)
        {
        }

        protected void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\PsychophysicalTestFactory.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using Updk7.Tests.Wpf.Psychophysical.TestOfMotorableCoherence_M;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class PsychophysicalTestFactory
    {
        private ResourceDictionary _resources = null;
        private ResourceDictionary _baseResources = null;
        private ResourceDictionary _instructionResources = null;
        public PsychophysicalTestFactory()
        {
            _resources = new ResourceDictionary() { Source = new Uri(@"/Updk7.Tests.Wpf;component/Source/Psychophysical/GenericStyles.xaml", UriKind.Relative) };
            _baseResources = _resources.MergedDictionaries.FirstOrDefault(f => f.Source.OriginalString == "./Styles/BaseStyles.xaml");
            _instructionResources = _resources.MergedDictionaries.FirstOrDefault(f => f.Source.OriginalString == "./Instructions/Instructions.xaml");
            SoundResources.Initialize();
        }

        public IPsychophysicalTest CreateTest(Pult.IDataTransport transport, EnumTests testType)
        {
            IPsychophysicalTest test = null;

            switch (testType)
            {
                case EnumTests.Tremor3Test:
                    test = new Tremor3.Tremor3ViewModel(new Pult.PultButtons(transport), new Pult.PultTremor(transport), new Pult.PultLed(transport));
                    break;
                case EnumTests.AccurateEye:
                    test = new AccurateEye.AccurateEyeTestViewModel(testType, new Pult.PultButtons(transport), new Pult.PultTepping(transport));
                    break;
                case EnumTests.ReadinessAssessmentTesting:
                    test = new ReadinessAssessmentTesting.ReadinessAssessmentViewModel(testType, new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.LevelOfPerceptionOfSpeedAndDistance:
                    test = new LevelOfPerceptionOfSpeedAndDistance.LevelOfPerceptionOfSpeedAndDistanceViewModel(testType, new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.AssessmentOfPropensityToTakeRisks:
                    test = new AssessmentOfPropensityToTakeRisks.AssessmentOfPropensityToTakeRisksViewModel(testType, new Pult.PultButtons(transport), new Pult.PultResistors(transport));
                    break;
                case EnumTests.EmotionalStability:
                    test = new EmotionalStability.EmotionalStabilityViewModel(testType, new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.AttentionDistribution:
                    test = new AttentionDistribution.AttentionDistributionViewModel(new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.ComplexMotorReaction310:
                    test = new ComplexMotorReaction.ComplexMotorReactionViewModel(ComplexMotorReaction.SDRType._100, new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.ComplexMotorableReaction30:
                    test = new ComplexMotorReaction.ComplexMotorReactionViewModel(ComplexMotorReaction.SDRType._30, new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.ComplexMotorReaction_M:
                    test = new ComplexMotorReaction_M.ComplexMotorReactionMViewModel(new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.EstimationOfStabilityToMonotonistance:
                    test = new EstimationOfStabilityToMonotonistance.EstimationOfStabilityToMonotonistanceViewModel(
                                                                                          new EstimationOfStabilityToMonotonistance.Signals(),
                                                                                          EstimationOfStabilityToMonotonistance.ESM_Mode.ESM,
                                                                                          testType,
                                                                                          new Pult.PultButtons(transport), 
                                                                                          new Pult.PultButtons(transport));
                    break;
                case EnumTests.VigilanceAssessment:
                    test = new VigilanceAssessment.VigilanceAssessmentViewModel(new VigilanceAssessment.Signals(),
                                                                                testType,
                                                                                new Pult.PultButtons(transport),
                                                                                new Pult.PultButtons(transport));
                    break;
                case EnumTests.EstimationOfStabilityOfAttention:
                    test = new EstimationOfStabilityOfAttention.EstimationOfStabilityOfAttentionViewModel(testType, new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.ConcentrationAttention:
                    test = new ConcentrationAttention.ConcentrationAttentionViewModel(testType,
                                                                                      new Pult.PultButtons(transport),
                                                                                      new Pult.PultButtons(transport));
                    break;
                case EnumTests.ExpressSampleVigilance:
                    test = new ExpressSampleVigilance.ExpressSampleVigilanceViewModel(new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.ReadinessForEmergencyAction:
                    test = new ReadinessForEmergencyAction.ReadinessForEmergencyActionViewModel(new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.ReadinessForEmergencyAction_2:
                    test = new ReadinessForEmergencyAction_2.ReadinessForEmergencyActionViewModel_2(
                                                                                       new Pult.PultButtons(transport),
                                                                                       new Pult.PultButtons(transport),
                                                                                       new Pult.PultGsr(transport));
                    break;
                case EnumTests.CorrectiveTestSample:
                    test = new CorrectiveTestSample.CorrectiveTestSampleViewModel(new Pult.PultButtons(transport));
                    break;
                case EnumTests.MethodCriticalFrequencyLightFlares:
                    test = new MethodCriticalFrequencyLightFlares.MethodCriticalFrequencyLightFlaresViewModel(
                                                                                       new Pult.PultButtons(transport),
                                                                                       new Pult.PultBlinkDown(transport),
                                                                                       new Pult.PultBlinkUp(transport));
                    break;
                case EnumTests.Game5:
                    test = new Game5.Game5ViewModel(new Pult.PultButtons(transport));
                    break;
                case EnumTests.TestForMotorableCoherence:
                    test = new TestForMotorableCoherence.TestForMotorableCoherenceViewModel(new Pult.PultButtons(transport), new Pult.PultResistors(transport));
                    break;
                case EnumTests.FeelingTime:
                    test = new FeelingTime.FeelingTimeViewModel(new Pult.PultButtons(transport), new Pult.PultLed(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.TeppingTest:
                    test = new TeppingTest.TeppingTestViewModel(new Pult.PultButtons(transport), new Pult.PultTepping(transport), new Pult.PultLed(transport));
                    break;
                case EnumTests.Tepping310:
                    test = new Tepping310.Tepping310ViewModel(new Pult.PultButtons(transport), new Pult.PultTepping(transport), new Pult.PultLed(transport));
                    break;
                case EnumTests.AssesmentMethodOnVolumeAttentions:
                    test = new AssesmentMethodOnVolumeAttentions.AssesmentMethodOnVolumeAttentionsViewModel(
                                                                                            new AssesmentMethodOnVolumeAttentions.Samples(),
                                                                                            new Pult.PultButtons(transport));
                    break;
                case EnumTests.SpeedAlterationSkills:
                    test = new SpeedAlterationSkills.SpeedAlternationSkillsViewModel(
                                                                        new Pult.PultButtons(transport),
                                                                        new Pult.PultButtons(transport));
                    break;
                case EnumTests.SimpleMotorableReaction:
                    test = new SimpleMotorableReaction.SimpleMotorableReactionViewModel(new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.ReactionToAMovingObject:
                    test = new ReactionToAMovingObject.ReactionToAMovingObjectViewModel(new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.StaticTremor:
                    test = new StaticTremor.StaticTremorViewModel(new Pult.PultButtons(transport), new Pult.PultTremor(transport), new Pult.PultLed(transport));
                    break;
                case EnumTests.StressEvaluationSTR:
                    test = new StressEvaluationSTR.StressEvaluationSTRViewModel(new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.StressEvaluationM:
                    test = new StressEvaluationM.StressEvaluationMViewModel(new List<StressEvaluationM.IQuestStrategy>()
                                                                           {
                                                                              new StressEvaluationM.Strategy1(),
                                                                              new StressEvaluationM.Strategy2(),
                                                                              new StressEvaluationM.Strategy3(),
                                                                              new StressEvaluationM.Strategy4(),
                                                                           }, 
                                                                           new Pult.PultButtons(transport),
                                                                           new Pult.PultButtons(transport));
                    break;
                case EnumTests.SwitchAttention2:
                    test = new SwitchAttention2.SwitchAttention2ViewModel(new Pult.PultButtons(transport));
                    break;
                case EnumTests.SwitchAttention:
                    test = new SwitchAttention.SwitchAttentionViewModel(new Pult.PultButtons(transport));
                    break;
                case EnumTests.MethodAssesmentOperationMemory:
                    test = new AssesmentMethodOnVolumeAttentions.AssesmentMethodOnVolumeAttentionsViewModel(
                                                                                    new MethodAssesmentOperationMemory.SamplesOperationMemory(),
                                                                                    new Pult.PultButtons(transport));
                    break;
                case EnumTests.StressEvaluationM2:
                    test = new StressEvaluationM.StressEvaluationMViewModel(new List<StressEvaluationM.IQuestStrategy>()
                                                                           {
                                                                              new StressEvaluationM.Strategy1(),
                                                                              new StressEvaluationM.Strategy2(),
                                                                              new StressEvaluationM2.Strategy3(),
                                                                              new StressEvaluationM2.Strategy4(),
                                                                           },
                                                                           new Pult.PultButtons(transport),
                                                                           new Pult.PultButtons(transport));
                    break;
                case EnumTests.VigilanceAssessmentM:
                    test = new VigilanceAssessment.VigilanceAssessmentViewModel(
                                                                     new VigilanceAssessmentM.Signals(),
                                                                     testType,
                                                                     new Pult.PultButtons(transport),
                                                                     new Pult.PultButtons(transport));
                    break;
                case EnumTests.EstimationOfStabilityToMonotonistanceM:
                    test = new EstimationOfStabilityToMonotonistance.EstimationOfStabilityToMonotonistanceViewModel(
                                                                                           new EstimationOfStabilityToMonotonistanceM.Signals(),
                                                                                           EstimationOfStabilityToMonotonistance.ESM_Mode.ESM_M,
                                                                                           testType,
                                                                                           new Pult.PultButtons(transport),
                                                                                           new Pult.PultButtons(transport));
                    break;
                case EnumTests.ReadinessForEmergencyActionM:
                    test = new ReadinessForEmergencyActionM.ReadinessForEmergencyActionMViewModel(new Pult.PultButtons(transport), new Pult.PultButtons(transport));
                    break;
                case EnumTests.ReadinessForEmergencyAction_2M:
                    test = new ReadinessForEmergencyAction_2M.ReadinessForEmergencyAction_2MViewModel(new Pult.PultButtons(transport),
                                                                                                      new Pult.PultButtons(transport),
                                                                                                      new Pult.PultGsr(transport));
                    break;
                case EnumTests.AccurateEye_M:
                    test = new AccurateEye_M.AccurateEyeTest_MViewModel(new Pult.PultButtons(transport), new Pult.PultTepping(transport));
                    break;
                case EnumTests.TestForMotorableCoherence_M:
                    test = new TestOfMotorableCoherence_MViewModel(new Pult.PultButtons(transport),
                                                                   new Pult.PultResistors(transport),
                                                                   new Pult.PultButtons(transport));
                    break;
            }
            if (test != null && test is TestBase)
            {
                (test as TestBase).TestType = testType;
                (test as TestBase).Resources = _resources;
            }
            return test;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\RelayCommand.cs


using System;
using System.Windows.Input;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class RelayCommand : ICommand
    {
        private Action<object> execute;
        private Func<object, bool> canExecute;

        public event EventHandler CanExecuteChanged
        {
            add { CommandManager.RequerySuggested += value; }
            remove { CommandManager.RequerySuggested -= value; }
        }

        public RelayCommand(Action<object> execute, Func<object, bool> canExecute = null)
        {
            this.execute = execute;
            this.canExecute = canExecute;
        }

        public bool CanExecute(object parameter)
        {
            return this.canExecute == null || this.canExecute(parameter);
        }

        public void Execute(object parameter)
        {
            this.execute(parameter);
        }
    }
}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Results.cs


using System;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class Results
    {
        public Exception Exception { get; set; }
        public Dictionary<string, object> ResultsTest { get; set; }
        public Results(Dictionary<string, object> resultsTest)
        {
            ResultsTest = resultsTest;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SoundResources.cs

using System;
using System.Windows;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public static class SoundResources
    {
        private static string[] _soundPaths = new string[]
        {
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/AttentionDistribution/Sounds/1.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/AttentionDistribution/Sounds/2.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/AttentionDistribution/Sounds/3.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/AttentionDistribution/Sounds/4.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/AttentionDistribution/Sounds/5.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/AttentionDistribution/Sounds/6.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/AttentionDistribution/Sounds/7.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/AttentionDistribution/Sounds/8.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/AttentionDistribution/Sounds/9.wav",

            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/EmotionalStability/Sounds/correct.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/EmotionalStability/Sounds/even.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/EmotionalStability/Sounds/odd.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/EmotionalStability/Sounds/wrong.wav",

            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/EstimationOfStabilityToMonotonistance/Sounds/metronom.wav",

            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/metronom.wav",

            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/black.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/red.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/1.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/2.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/3.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/4.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/5.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/6.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/7.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/8.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/9.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/10.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/11.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/12.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/13.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/14.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/15.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/16.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/17.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/18.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/19.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/20.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/21.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/22.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/23.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/24.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/25.wav",

            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/26.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/28.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/30.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/32.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/34.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/36.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/38.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/40.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/42.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/44.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/46.wav",
            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/48.wav",

            "pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/beep.wav"
        };

        private static Dictionary<string, byte[]> _soundArrays = new Dictionary<string, byte[]>();

        public static void Initialize()
        {
            for (int i = 0; i < _soundPaths.Length; i++)
            {
                var path = new Uri($@"{_soundPaths[i]}");
                var stream = Application.GetResourceStream(path).Stream;
                var buffer = new byte[stream.Length];
                stream.Read(buffer, 0, (int)stream.Length);
                _soundArrays.Add(_soundPaths[i], buffer);
                stream.Dispose();
            }
        }

        public static byte[] GetSoundArray(string path)
        {
            var byteArrayKey = _soundArrays.Keys.FirstOrDefault(f => f == path);
            if (byteArrayKey != null)
                return _soundArrays[byteArrayKey];
            return new byte[0];
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StartView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.StartView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:psychophysical="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
             xmlns:controls="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="1080" d:DesignWidth="1920">
    <UserControl.Resources>
        <!--<DrawingBrush x:Key="ellipsedBrush"
                  Stretch="None"
                  TileMode="Tile"
                  Viewport="0,0,5,5"
                  AlignmentX="Left"
                  AlignmentY="Top"
                  ViewportUnits="Absolute">
            <DrawingBrush.Drawing>
                <GeometryDrawing Brush="#9F101929">
                    <GeometryDrawing.Geometry>
                        <EllipseGeometry RadiusX="5" RadiusY="5"/>
                    </GeometryDrawing.Geometry>
                </GeometryDrawing>
            </DrawingBrush.Drawing>
        </DrawingBrush>-->
        <Style x:Key="FocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <SolidColorBrush x:Key="strokeRectangle" Color="#FFA5BADB"/>
        <SolidColorBrush x:Key="Button.Static.Background" Color="#00000000"/>
        <SolidColorBrush x:Key="Button.Default.Text.Foreground" Color="#FFE3E3E3"/>
        <SolidColorBrush x:Key="Button.MouseOver.Text.Foreground" Color="#FFFFAE00"/>
        <SolidColorBrush x:Key="Button.Pressed.Text.Foreground" Color="#FF35D2E2"/>
        <Style TargetType="{x:Type controls:SubMenuButton}">
            <Style.Resources>
                <Style TargetType="Rectangle">
                    <Setter Property="Height" Value="20"/>
                    <Setter Property="Width" Value="20" />
                    <Setter Property="Margin" Value="5" />
                    <Setter Property="RadiusX" Value="5" />
                    <Setter Property="RadiusY" Value="5" />
                </Style>
            </Style.Resources>
            <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
            <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Foreground" Value="{StaticResource Button.Default.Text.Foreground}"/>
            <Setter Property="FontSize" Value="32" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="FontFamily" Value="Segoe Print" />
            <Setter Property="Margin" Value="10,5,5,5" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type controls:SubMenuButton}">
                        <Border x:Name="border" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                            <StackPanel Focusable="False" Orientation="Horizontal"
                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                  Margin="{TemplateBinding Padding}"
                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                <Rectangle Fill="{TemplateBinding RectangleFill}" Stroke="{StaticResource strokeRectangle}"/>
                                <TextBlock x:Name="tbxDescription"
                                           Grid.Column="1"
                                           Text="{TemplateBinding Description}"
                                           Foreground="{StaticResource Button.Default.Text.Foreground}"/>
                            </StackPanel>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="tbxDescription" Property="Foreground" Value="{StaticResource Button.MouseOver.Text.Foreground}"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="tbxDescription" Property="Foreground" Value="{StaticResource Button.Pressed.Text.Foreground}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid>
        <ContentControl Content="{Binding Content}"/>
        <Border x:Name="borderBlurred">
            <Border.Background>
                <VisualBrush Visual="{Binding Content}"/>
            </Border.Background>
            <Border.Effect>
                <BlurEffect Radius="20"/>
            </Border.Effect>
        </Border>
        <Border x:Name="border1">
            <Grid ShowGridLines="False">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <TextBlock Grid.Column="1" Grid.Row="0" VerticalAlignment="Bottom" Margin="0,0,0,30" HorizontalAlignment="Center" Text="Выберите действие" Foreground="#FFCECECE" FontSize="40"/>
                <Border x:Name="border" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" Height="270" Width="480" CornerRadius="20" Background="#9F101929" RenderTransformOrigin="0.5,0.5">
                <Border.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Border.RenderTransform>
                    <Grid HorizontalAlignment="Center" Margin="15">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <controls:SubMenuButton Grid.Row="0" Description="Демо инструкции" RectangleFill="Green" Command="{Binding ToInstruction_Command}"/>
                        <controls:SubMenuButton Grid.Row="1" Description="Читать инструкцию" RectangleFill="Black" Command="{Binding ToTextInstruction_Command}"/>
                        <controls:SubMenuButton Grid.Row="2" Description="Попробовать" RectangleFill="Orange" Command="{Binding Learning_Command}"/>
                    </Grid>
                </Border>
            </Grid>
        </Border>
        <Path Height="50"
              Width="50"
              VerticalAlignment="Bottom"
              HorizontalAlignment="Right"
              Margin="20"
              Data="M41.598198,75.835028 C74.277332,75.802832 90.401287,109.46826 93.335987,111.38189 80.835644,126.54826 25.169661,
              128.2159 6.8359909,87.215666 20.039169,79.012587 31.594385,75.844885 41.598198,75.835028 z M2.2530696,49.549002 C4.2528824,
              49.799281 73.505268,58.549002 4.753147,80.799002 -1.4972134,64.799002 0.50303626,51.799002 2.2530696,49.549002 z M114.00296,
              30.299002 C114.00296,30.299002 141.5866,73.049002 99.753132,107.799 59.253529,49.382334 114.00296,30.299002 114.00296,
              30.299002 z M55.502762,0.92401051 C60.752834,59.175032 30.753138,48.049262 3.6280019,41.549132 19.294596,0.88242086 53.752861,
              1.4235743 55.502762,0.92401051 z M63.908768,0.50058907 C72.413151,0.56705118 95.846745,6.2681947 108.75299,23.54922 51.752144,
              60.048365 61.002563,1.799499 61.252285,0.79975372 61.783623,0.59659445 62.693859,0.4910954 63.908768,0.50058907 z"
              Fill="#B6FFFFFF"
              Stretch="Fill" />
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StartView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public partial class StartView : UserControl
    {
        public StartView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StartViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class StartViewModel : NotifyBase, IDisposable
    {
        private FrameworkElement _content;
        public FrameworkElement Content
        {
            get { return _content; }
            set 
            {
                _content = value;
                OnPropertyChanged();
            }
        }
        public RelayCommand ToInstruction_Command => new RelayCommand(obj =>
        {
            Unsubscribe();
            _manager.ToInstruction();
        });
        public RelayCommand Learning_Command => new RelayCommand(obj =>
        {
            Unsubscribe();
            _manager.Learning();
        });

        public RelayCommand ToTextInstruction_Command => new RelayCommand(obj =>
        {
            Unsubscribe();
            _manager.ToTextInstruction();
        });

        private readonly ITestManager _manager;
        public StartViewModel(ITestManager manager)
        {
            _manager = manager;
            Content = _manager.Test.GetTestControl();
            _manager.Buttons.ButtonPressed += _buttons_ButtonPressed;
            _manager.Buttons.Start();
        }

        private void _buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            switch (e.Button)
            {
                case PultButton.Green:
                    ToInstruction_Command.Execute(null);
                    break;
                case PultButton.Black:
                    ToTextInstruction_Command.Execute(null);
                    break;
                case PultButton.Yellow:
                    Learning_Command.Execute(null);
                    break;
            }
        }

        private void Unsubscribe()
        {
            _manager.Buttons.ButtonPressed -= _buttons_ButtonPressed;
            _manager.Buttons.Stop();
        }

        public void Dispose()
        {
            Unsubscribe();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StringTestNamesResource.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical">
    <sys:String x:Key="{x:Static local:EnumTests.Tremor3Test}">Тремор 3 отверстия</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.AccurateEye}">Глазомер</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.ReadinessAssessmentTesting}">Оценка готовности к тестированию</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.LevelOfPerceptionOfSpeedAndDistance}">Уровень восприятия скорости и расстояния</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.AssessmentOfPropensityToTakeRisks}">Оценка склонности к риску</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.EmotionalStability}">Эмоциональная устойчивость</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.AttentionDistribution}">Распределение внимания</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.ComplexMotorReaction310}">Сложная двигательная реакция (по 310у)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.ComplexMotorReaction_M}">Сложная двигательная реакция – М (СДР-М)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.EstimationOfStabilityToMonotonistance}">Оценка монотоноустойчивости</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.VigilanceAssessment}">Оценка бдительности</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.EstimationOfStabilityOfAttention}">Оценка устойчивости внимания (УВ)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.ConcentrationAttention}">Концентрация внимания</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.ExpressSampleVigilance}">Тест ЭПБ (экспресс-проба бдительности - УРБ)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.ReadinessForEmergencyAction}">Тест «Готовность к Экстренным Действиям» (ГЭД)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.ReadinessForEmergencyAction_2}">Тест «Готовность к Экстренным Действиям - 2» (ГЭД-2)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.CorrectiveTestSample}">Тест Корректурная проба (КП)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.MethodCriticalFrequencyLightFlares}">Тест КЧССМ. Методика определения критической частоты слияния световых мельканий</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.Game5}">Тест «Игра 5»</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.TestForMotorableCoherence}">Тест «Проба на моторную согласованность»  (МС)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.FeelingTime}">Тест Чувство времени (ЧВ)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.TeppingTest}">Тест «Теппинг-тест»</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.AssesmentMethodOnVolumeAttentions}">Методика оценки объёма внимания</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.SpeedAlterationSkills}">Тест «Скорость переделки навыков (СПН)»</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.SimpleMotorableReaction}">Тест Простая двигательная реакция (ПДР)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.ReactionToAMovingObject}">Тест «Реакция на движущийся объект» (РДО)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.StaticTremor}">Тест «Статический тремор»</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.StressEvaluationSTR}">Тест «Оценка стрессоустойчивости» (СТР) (по 310у)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.StressEvaluationM}">Тест «Оценка стрессоустойчивости – М» (СТР-М)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.SwitchAttention2}">Тест «ПЕРЕКЛЮЧЕНИЕ ВНИМАНИЯ-2 (ПВ-2)»</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.SwitchAttention}">Тест «Переключение внимания и помехоустойчивость» (ПВ и ПУ)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.Tepping310}">Теппинг 310</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.MethodAssesmentOperationMemory}">Методика оценки оперативной памяти (ОВ-м)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.StressEvaluationM2}">Оценка стрессоустойчивости-(СТР-м2)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.VigilanceAssessmentM}">Оценка бдительности (ОБ-м)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.EstimationOfStabilityToMonotonistanceM}">Оценка монотоноустойчивости (ОМУ-м)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.ReadinessForEmergencyActionM}">Тест «Готовность к Экстренным Действиям» (ГЭД-1М)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.ReadinessForEmergencyAction_2M}">Тест «Готовность к Экстренным Действиям» (ГЭД-2М)</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.ComplexMotorableReaction30}">Тест Сложная двигательная реакция 30</sys:String>
    <sys:String x:Key="{x:Static local:EnumTests.AccurateEye_M}">Оценка глазомера - М</sys:String>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestBase.cs


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public abstract class TestBase : ContentControl, IPsychophysicalTest, ITestQuest, IDisconnect, IContinue, INotifyPropertyChanged
    {
        public static readonly DependencyProperty InstructionPultProperty =
            DependencyProperty.Register("InstructionPult", typeof(PultButtons), typeof(TestBase), new PropertyMetadata(null));

        public static readonly DependencyProperty ManagerProperty =
            DependencyProperty.Register("Manager", typeof(TestManager), typeof(TestBase), new PropertyMetadata(null));

        public static readonly DependencyProperty TestCurrentViewProperty =
            DependencyProperty.Register("TestCurrentView", typeof(object), typeof(TestBase), new PropertyMetadata(null, TestCurrentViewFieldChanged));
        public bool EndTest
        {
            get { return (bool)GetValue(EndTestProperty); }
            set { SetValue(EndTestProperty, value); }
        }

        public static readonly DependencyProperty EndTestProperty =
            DependencyProperty.Register("EndTest", typeof(bool), typeof(TestBase), new PropertyMetadata(false));

        public Visibility LearningTaskHeaderVisibility
        {
            get { return (Visibility)GetValue(LearningTaskHeaderVisibilityProperty); }
            set { SetValue(LearningTaskHeaderVisibilityProperty, value); }
        }

        public static readonly DependencyProperty LearningTaskHeaderVisibilityProperty =
            DependencyProperty.Register("LearningTaskHeaderVisibility", typeof(Visibility), typeof(TestBase), new PropertyMetadata(Visibility.Hidden));

        public Exception Exception { get; set; } = null;

        public TestBase(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null )
        {
            Pult = pult;
            AdditionalPult = additionalPult;
            InstructionPult = instructionPult;
            Manager = new TestManager(this, InstructionPult);
            Loaded += Test_Loaded;
        }

        public event EventHandler CreatedView;
        public event PropertyChangedEventHandler PropertyChanged;

        public virtual event EventHandler<Results> Results;

        public IPult AdditionalPult { get; set; }

        public PultButtons InstructionPult
        {
            get { return (PultButtons)GetValue(InstructionPultProperty); }
            set { SetValue(InstructionPultProperty, value); }
        }

        public TestManager Manager
        {
            get { return (TestManager)GetValue(ManagerProperty); }
            set { SetValue(ManagerProperty, value); }
        }

        public IPult Pult { get; set; }

        public object TestCurrentView
        {
            get => (object)GetValue(TestCurrentViewProperty);
            set => SetValue(TestCurrentViewProperty, value);
        }

        public EnumTests TestType { get; set; }
        private object continueViewModel;
        public object ContinueViewModel
        {
            get => continueViewModel;
            set
            {
                continueViewModel = value;
                OnPropertyChanged();
            }
        }

        public void OnPropertyChanged([CallerMemberName]string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }

        public virtual void Start() { }

        public virtual void Stop()
        {
            EndTest = true;
            Manager.Stop();
        }

        public virtual void TestStart() { Start(); }
        public virtual void TestManual() { Start(); }

        public virtual void TestStop()
        {
            Stop();
        }

        public virtual void ToDefault()
        {
            Stop();
        }
        public virtual FrameworkElement GetTestControl()
        {
            return null;
        }

        public virtual void DisconnectedPult(Exception e)
        {
            Manager.Dispose();
        }
        public string CurrentInstructionName { get; private set; }
        public int CurrentNumberTextInstruction { get; private set; }
        public bool IsBetweenTasks { get; private set; }
        public void SetInstructions(string instructionName, int numberTextInstruction = 0, bool isBetweenTasks = false)
        {
            CurrentInstructionName = instructionName;
            CurrentNumberTextInstruction = numberTextInstruction;
            IsBetweenTasks = isBetweenTasks;
        }

        private static void TestCurrentViewFieldChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue != null)
            {
                (d as TestBase).CreatedView?.Invoke(d as TestBase, new EventArgs());
            }
        }
        private void Test_Loaded(object sender, RoutedEventArgs e)
        {
            Loaded -= Test_Loaded;
            Manager.ToStartView();
        }

        public void Dispose()
        {
            Stop();
            Manager.Dispose();
            (AdditionalPult as PultBase)?.Dispose();
            if (InstructionPult.IsRunning)
                InstructionPult?.Dispose();
            (Pult as PultBase)?.Dispose();
        }
    }

    public interface IDisconnect
    {
        void DisconnectedPult(Exception e);
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestElementNames.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Updk7.Tests.Wpf.Psychophysical;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public static class TestElementNames
    {
        private static Dictionary<EnumTests, List<string>> _type_elementNames = new Dictionary<EnumTests, List<string>>()
        {
            [EnumTests.AccurateEye] = new List<string>() { "OriginalPath", "NewPath", "startEl", "endEl" },
            [EnumTests.AccurateEye_M] = new List<string>()
            {
                "A_OriginalLine",
                "B_OriginalLine",
                "C_OriginalLine",
                "D_OriginalLine",
                "E_OriginalLine",
                "A_NewLine",
                "B_NewLine",
                "C_NewLine",
                "D_NewLine",
                "E_NewLine",
                "A_Prop_CC",
                "B_Prop_CC",
                "C_Prop_CC",
                "D_Prop_CC",
                "E_Prop_CC",
                "startEl" },
            [EnumTests.AssesmentMethodOnVolumeAttentions] = new List<string>() { },
            [EnumTests.AssessmentOfPropensityToTakeRisks] = new List<string>()
            {
                "el1",
                "el2",
                "el3",
                "elStatic1",
                "elStatic2",
                "elStatic3",
                "elMove1",
                "elMove2",
                "elMove3"
            },
            [EnumTests.AttentionDistribution] = new List<string>() { },
            [EnumTests.ComplexMotorReaction310] = new List<string>() { },
            [EnumTests.ComplexMotorableReaction30] = new List<string>() { },
            [EnumTests.ComplexMotorReaction_M] = new List<string>() { },
            [EnumTests.ConcentrationAttention] = new List<string>() { },
            [EnumTests.CorrectiveTestSample] = new List<string>() { },
            [EnumTests.EmotionalStability] = new List<string>() { },
            [EnumTests.EstimationOfStabilityOfAttention] = new List<string>() { },
            [EnumTests.EstimationOfStabilityToMonotonistance] = new List<string>() { },
            [EnumTests.EstimationOfStabilityToMonotonistanceM] = new List<string>() { },
            [EnumTests.ExpressSampleVigilance] = new List<string>() { },
            [EnumTests.FeelingTime] = new List<string>() { },
            [EnumTests.Game5] = new List<string> { },
            [EnumTests.LevelOfPerceptionOfSpeedAndDistance] = new List<string> { "elMove", "elStatic" },
            [EnumTests.MethodAssesmentOperationMemory] = new List<string>() { },
            [EnumTests.MethodCriticalFrequencyLightFlares] = new List<string>() { },
            [EnumTests.ReactionToAMovingObject] = new List<string>() { },
            [EnumTests.ReadinessAssessmentTesting] = new List<string>() { },
            [EnumTests.ReadinessForEmergencyAction] = new List<string>() { },
            [EnumTests.ReadinessForEmergencyActionM] = new List<string>() { },
            [EnumTests.ReadinessForEmergencyAction_2] = new List<string>() { },
            [EnumTests.ReadinessForEmergencyAction_2M] = new List<string>() { },
            [EnumTests.SimpleMotorableReaction] = new List<string>() { },
            [EnumTests.SpeedAlterationSkills] = new List<string>() { },
            [EnumTests.StaticTremor] = new List<string>() { },
            [EnumTests.StressEvaluationM] = new List<string>() { },
            [EnumTests.StressEvaluationM2] = new List<string>() { },
            [EnumTests.SwitchAttention] = new List<string>() { },
            [EnumTests.SwitchAttention2] = new List<string>() { },
            [EnumTests.Tepping310] = new List<string>() { },
            [EnumTests.TeppingTest] = new List<string>() { },
            [EnumTests.TestForMotorableCoherence] = new List<string>() { },
            [EnumTests.TestForMotorableCoherence_M] = new List<string>() { },
            [EnumTests.Tremor3Test] = new List<string>() { },
            [EnumTests.VigilanceAssessment] = new List<string>() { },
            [EnumTests.VigilanceAssessmentM] = new List<string>() { }
        };

        public static List<string> GetElementNamesByTypeTest(EnumTests type)
        {
            EnumTests? key = _type_elementNames.Keys.FirstOrDefault(f => f == type);
            if (key != null)
                return _type_elementNames[key.Value];
            return null;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestManager.cs

using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class TestManager : ITestManager, INotifyPropertyChanged, IDisposable
    {
        private TestBase test;
        public TestBase Test
        {
            get { return test; }
            set
            {
                test = value;
                OnPropertyChanged();
            }
        }

        private TimeSpan _traningTime;
        public TimeSpan TraningTime
        {
            get { return _traningTime; }
            set
            {
                _traningTime = value;
                OnPropertyChanged();
            }
        }


        private Pult.PultButtons _buttons;
        public Pult.PultButtons Buttons
        {
            get { return _buttons; }
            set
            {
                _buttons = value;
                OnPropertyChanged();
            }
        }


        private InstructionViewModel _instruction;
        public InstructionViewModel Instruction
        {
            get { return _instruction; }
            set
            {
                _instruction = value;
                OnPropertyChanged();
            }
        }

        public TestProxy TestProxy { get; set; }

        private DispatcherTimer _learningTimer = new DispatcherTimer();
        public TestManager(TestBase test, Pult.PultButtons buttons)
        {
            Buttons = buttons;
            Buttons.Disconnected += Buttons_Disconnected;
            Test = test;
            _learningTimer.Tick += _learningTimer_Tick;
        }

        private void Buttons_Disconnected(object sender, Pult.DisconnectedEventArgs e)
        {
            Test.DisconnectedPult(e.Exception);
        }

        private void _learningTimer_Tick(object sender, EventArgs e)
        {
            ToActionMenu();
        }

        public void ToActionMenu()
        {
            Test.LearningTaskHeaderVisibility = Visibility.Hidden;
            _learningTimer.Stop();
            Test.TestStop();
            ContinueViewModel continueViewModel = new ContinueViewModel(this)
            {
                ElementForScreen = Test.TestCurrentView as FrameworkElement
            };
            Test.ContinueViewModel = continueViewModel;
        }

        private TextInstructionViewModel _textInstructionViewModel;
        private StartViewModel _startViewModel;

        public void ToStartView()
        {
            _startViewModel = new StartViewModel(this);
            Test.TestCurrentView = _startViewModel;
        }

        public void ToTextInstruction()
        {
            Stop();
            Test.ToDefault();
            _textInstructionViewModel = new TextInstructionViewModel(this, Test.IsBetweenTasks);
            var instruction = InstructionsFactory.GetInstruction(Test.TestType, Test.CurrentNumberTextInstruction, Test.Resources);
            _textInstructionViewModel.Text = instruction;
            Test.TestCurrentView = _textInstructionViewModel;
        }

        public void ToInstruction()
        {
            Stop();
            if (TraningTime.TotalSeconds != 0.0)
            {
                Test.TestManual();
                if (TestProxy != null && TestProxy.GetTest() is ILearning test)
                {
                    Instruction = new InstructionViewModel(Test.TestType, Test.CurrentInstructionName, this, test as FrameworkElement, Test.IsBetweenTasks);
                    Test.TestCurrentView = new InstructionView() { DataContext = Instruction };
                }
            }
        }
       
        public void Learning()
        {
            Stop();
            Test.LearningTaskHeaderVisibility = Visibility.Visible;
            _learningTimer.Interval = TraningTime;
            _learningTimer.Start();
            Test.TestStart();
        }

        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged([CallerMemberName]string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }
        public void Start()
        {
            Stop();
            if (Test != null)
                Test.Start();
        }

        public void Stop()
        {
            
            if (_startViewModel != null)
            {
                _startViewModel?.Dispose();
                _startViewModel = null;
            }
            if (Instruction != null)
            {
                Instruction?.Dispose();
                Instruction = null;
            }
            if (_textInstructionViewModel != null)
            {
                _textInstructionViewModel?.Dispose();
                _textInstructionViewModel = null;
            }
            Test.LearningTaskHeaderVisibility = Visibility.Hidden;
            _learningTimer.Stop();
            Test.ContinueViewModel = null;
        }

        public void Dispose()
        {
            Test.LearningTaskHeaderVisibility = Visibility.Hidden;
            Buttons.Disconnected -= Buttons_Disconnected;
            _learningTimer.Stop();
            Instruction?.Dispose();
            Instruction = null;
            Test.ContinueViewModel = null;
            _startViewModel?.Dispose();
            _textInstructionViewModel?.Dispose();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestProxy.cs

using System.Collections.Generic;
using System.Windows;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class TestProxy
    {
        private FrameworkElement _testControl;
        public FrameworkElement GetTest()
        {
            return _testControl;
        }

        public void SetTest(FrameworkElement testControl)
        {
            _testControl = testControl;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TextInstructionView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.TextInstructionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:controls="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Controls"
             xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Converters"
             xmlns:psychophysical="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
             d:DataContext="{d:DesignInstance Type=psychophysical:TextInstructionViewModel}"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <SolidColorBrush x:Key="ScrollBar.Static.Background" Color="#FA2E343C"/>
        <SolidColorBrush x:Key="ScrollBar.Static.Border" Color="#FA848992"/>
        <SolidColorBrush x:Key="ScrollBar.Pressed.Glyph" Color="#FF000000"/>
        <SolidColorBrush x:Key="ScrollBar.MouseOver.Glyph" Color="#FFFFFFFF"/>
        <SolidColorBrush x:Key="ScrollBar.Disabled.Glyph" Color="#FFBFBFBF"/>
        <SolidColorBrush x:Key="ScrollBar.Static.Glyph" Color="#606060"/>

        <SolidColorBrush x:Key="ScrollBar.MouseOver.Background" Color="#DADADA"/>
        <SolidColorBrush x:Key="ScrollBar.MouseOver.Border" Color="#DADADA"/>
        <SolidColorBrush x:Key="ScrollBar.Pressed.Background" Color="#606060"/>
        <SolidColorBrush x:Key="ScrollBar.Pressed.Border" Color="#606060"/>
        <Style x:Key="FocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ScrollBarButton" TargetType="{x:Type RepeatButton}">
            <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Border x:Name="border" BorderBrush="{StaticResource ScrollBar.Static.Border}" BorderThickness="0" Background="#00000000" SnapsToDevicePixels="true">
                            <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="RepeatButtonTransparent" TargetType="{x:Type RepeatButton}">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <SolidColorBrush x:Key="ScrollBar.MouseOver.Thumb" Color="#A6A6A6"/>
        <SolidColorBrush x:Key="ScrollBar.Pressed.Thumb" Color="#606060"/>
        <SolidColorBrush x:Key="ScrollBar.Static.Thumb" Color="#A2A2A2"/>
        <Style x:Key="ScrollBarThumbVertical" TargetType="{x:Type Thumb}">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Rectangle x:Name="rectangle" Fill="{StaticResource ScrollBar.Static.Thumb}" RadiusX="6" RadiusY="6" Height="{TemplateBinding Height}" SnapsToDevicePixels="True" Width="12"/>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource ScrollBar.MouseOver.Thumb}"/>
                            </Trigger>
                            <Trigger Property="IsDragging" Value="true">
                                <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource ScrollBar.Pressed.Thumb}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ScrollBarThumbHorizontal" TargetType="{x:Type Thumb}">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Rectangle x:Name="rectangle" Fill="{StaticResource ScrollBar.Static.Thumb}" Height="{TemplateBinding Height}" SnapsToDevicePixels="True" Width="{TemplateBinding Width}"/>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource ScrollBar.MouseOver.Thumb}"/>
                            </Trigger>
                            <Trigger Property="IsDragging" Value="true">
                                <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource ScrollBar.Pressed.Thumb}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ScrollBarStyleRounded" TargetType="{x:Type ScrollBar}">
            <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
            <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
            <Setter Property="Background" Value="{StaticResource ScrollBar.Static.Background}"/>
            <Setter Property="BorderBrush" Value="{StaticResource ScrollBar.Static.Border}"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="BorderThickness" Value="1,0"/>
            <Setter Property="Width" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
            <Setter Property="MinWidth" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ScrollBar}">
                        <Grid x:Name="Bg" SnapsToDevicePixels="true">
                            <Grid.RowDefinitions>
                                <RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/>
                                <RowDefinition Height="0.00001*"/>
                                <RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/>
                            </Grid.RowDefinitions>
                            <Border CornerRadius="8.5" BorderBrush="{DynamicResource ScrollBar.Static.Glyph}" Width="18" BorderThickness="2" Background="{TemplateBinding Background}" Grid.Row="1"/>
                            <RepeatButton x:Name="PART_LineUpButton" Command="{x:Static ScrollBar.LineUpCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{DynamicResource ScrollBarButton}">
                                <Path x:Name="ArrowTop" Data="M 0,4 C0,4 0,6 0,6 0,6 3.5,2.5 3.5,2.5 3.5,2.5 7,6 7,6 7,6 7,4 7,4 7,4 3.5,0.5 3.5,0.5 3.5,0.5 0,4 0,4 z" Fill="Gray" Margin="3,4,3,3" Stretch="Uniform"/>
                            </RepeatButton>
                            <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="1" Margin="2,3,2,3" HorizontalAlignment="Center">
                                <Track.DecreaseRepeatButton>
                                    <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource RepeatButtonTransparent}"/>
                                </Track.DecreaseRepeatButton>
                                <Track.IncreaseRepeatButton>
                                    <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource RepeatButtonTransparent}"/>
                                </Track.IncreaseRepeatButton>
                                <Track.Thumb>
                                    <Thumb Style="{StaticResource ScrollBarThumbVertical}"/>
                                </Track.Thumb>
                            </Track>
                            <RepeatButton x:Name="PART_LineDownButton" Command="{x:Static ScrollBar.LineDownCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="2"  Style="{DynamicResource ScrollBarButton}">
                                <Path x:Name="ArrowBottom" Data="M 0,2.5 C0,2.5 0,0.5 0,0.5 0,0.5 3.5,4 3.5,4 3.5,4 7,0.5 7,0.5 7,0.5 7,2.5 7,2.5 7,2.5 3.5,6 3.5,6 3.5,6 0,2.5 0,2.5 z" Fill="Gray" Margin="3,4,3,3" Stretch="Uniform"/>
                            </RepeatButton>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineDownButton}" Value="true"/>
                                    <Condition Binding="{Binding IsPressed, ElementName=PART_LineDownButton}" Value="true"/>
                                </MultiDataTrigger.Conditions>
                                <Setter Property="Fill" TargetName="ArrowBottom" Value="{StaticResource ScrollBar.Pressed.Glyph}"/>
                            </MultiDataTrigger>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineUpButton}" Value="true"/>
                                    <Condition Binding="{Binding IsPressed, ElementName=PART_LineUpButton}" Value="true"/>
                                </MultiDataTrigger.Conditions>
                                <Setter Property="Fill" TargetName="ArrowTop" Value="{StaticResource ScrollBar.Pressed.Glyph}"/>
                            </MultiDataTrigger>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineDownButton}" Value="true"/>
                                    <Condition Binding="{Binding IsPressed, ElementName=PART_LineDownButton}" Value="false"/>
                                </MultiDataTrigger.Conditions>
                                <Setter Property="Fill" TargetName="ArrowBottom" Value="{StaticResource ScrollBar.MouseOver.Glyph}"/>
                            </MultiDataTrigger>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineUpButton}" Value="true"/>
                                    <Condition Binding="{Binding IsPressed, ElementName=PART_LineUpButton}" Value="false"/>
                                </MultiDataTrigger.Conditions>
                                <Setter Property="Fill" TargetName="ArrowTop" Value="{StaticResource ScrollBar.MouseOver.Glyph}"/>
                            </MultiDataTrigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Fill" TargetName="ArrowTop" Value="{StaticResource ScrollBar.Disabled.Glyph}"/>
                                <Setter Property="Fill" TargetName="ArrowBottom" Value="{StaticResource ScrollBar.Disabled.Glyph}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="Orientation" Value="Horizontal">
                    <Setter Property="Width" Value="Auto"/>
                    <Setter Property="MinWidth" Value="0"/>
                    <Setter Property="Height" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/>
                    <Setter Property="MinHeight" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/>
                    <Setter Property="BorderThickness" Value="0,1"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ScrollBar}">
                                <Grid x:Name="Bg" SnapsToDevicePixels="true">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
                                        <ColumnDefinition Width="0.00001*"/>
                                        <ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
                                    </Grid.ColumnDefinitions>
                                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="1"/>
                                    <RepeatButton x:Name="PART_LineLeftButton" Command="{x:Static ScrollBar.LineLeftCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}">
                                        <Path x:Name="ArrowLeft" Data="M 3.18,7 C3.18,7 5,7 5,7 5,7 1.81,3.5 1.81,3.5 1.81,3.5 5,0 5,0 5,0 3.18,0 3.18,0 3.18,0 0,3.5 0,3.5 0,3.5 3.18,7 3.18,7 z" Fill="{StaticResource ScrollBar.Static.Glyph}" Margin="3" Stretch="Uniform"/>
                                    </RepeatButton>
                                    <Track x:Name="PART_Track" Grid.Column="1" IsEnabled="{TemplateBinding IsMouseOver}">
                                        <Track.DecreaseRepeatButton>
                                            <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource RepeatButtonTransparent}"/>
                                        </Track.DecreaseRepeatButton>
                                        <Track.IncreaseRepeatButton>
                                            <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource RepeatButtonTransparent}"/>
                                        </Track.IncreaseRepeatButton>
                                        <Track.Thumb>
                                            <Thumb Style="{StaticResource ScrollBarThumbHorizontal}"/>
                                        </Track.Thumb>
                                    </Track>
                                    <RepeatButton x:Name="PART_LineRightButton" Grid.Column="2" Command="{x:Static ScrollBar.LineRightCommand}" IsEnabled="{TemplateBinding IsMouseOver}" Style="{StaticResource ScrollBarButton}">
                                        <Path x:Name="ArrowRight" Data="M 1.81,7 C1.81,7 0,7 0,7 0,7 3.18,3.5 3.18,3.5 3.18,3.5 0,0 0,0 0,0 1.81,0 1.81,0 1.81,0 5,3.5 5,3.5 5,3.5 1.81,7 1.81,7 z" Fill="{StaticResource ScrollBar.Static.Glyph}" Margin="3" Stretch="Uniform"/>
                                    </RepeatButton>
                                </Grid>
                                <ControlTemplate.Triggers>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineRightButton}" Value="true"/>
                                            <Condition Binding="{Binding IsPressed, ElementName=PART_LineRightButton}" Value="true"/>
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Fill" TargetName="ArrowRight" Value="{StaticResource ScrollBar.Pressed.Glyph}"/>
                                    </MultiDataTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineLeftButton}" Value="true"/>
                                            <Condition Binding="{Binding IsPressed, ElementName=PART_LineLeftButton}" Value="true"/>
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Fill" TargetName="ArrowLeft" Value="{StaticResource ScrollBar.Pressed.Glyph}"/>
                                    </MultiDataTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineRightButton}" Value="true"/>
                                            <Condition Binding="{Binding IsPressed, ElementName=PART_LineRightButton}" Value="false"/>
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Fill" TargetName="ArrowRight" Value="{StaticResource ScrollBar.MouseOver.Glyph}"/>
                                    </MultiDataTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding IsMouseOver, ElementName=PART_LineLeftButton}" Value="true"/>
                                            <Condition Binding="{Binding IsPressed, ElementName=PART_LineLeftButton}" Value="false"/>
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Fill" TargetName="ArrowLeft" Value="{StaticResource ScrollBar.MouseOver.Glyph}"/>
                                    </MultiDataTrigger>
                                    <Trigger Property="IsEnabled" Value="false">
                                        <Setter Property="Fill" TargetName="ArrowLeft" Value="{StaticResource ScrollBar.Disabled.Glyph}"/>
                                        <Setter Property="Fill" TargetName="ArrowRight" Value="{StaticResource ScrollBar.Disabled.Glyph}"/>
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <converters:StringOrEmptyConverter x:Key="StringOrEmptyConverter"/>
        <SolidColorBrush x:Key="instruction.Background" Color="#FF49505B"/>
        <ControlTemplate x:Key="ScrollViewerControlTemplate_scrollToLeftTop" TargetType="{x:Type ScrollViewer}">
            <Grid x:Name="Grid" Background="{TemplateBinding Background}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Rectangle x:Name="Corner" Grid.Column="0" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Grid.Row="1"/>
                <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" Grid.Column="1" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}" Grid.Row="0"/>
                <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Style="{DynamicResource ScrollBarStyleRounded}"/>
                <ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
            </Grid>
        </ControlTemplate>

        <SolidColorBrush x:Key="strokeRectangle" Color="#FFA5BADB"/>
        <SolidColorBrush x:Key="Button.Static.Background" Color="#00000000"/>
        <SolidColorBrush x:Key="Button.Default.Text.Foreground" Color="White"/>
        <SolidColorBrush x:Key="Button.MouseOver.Text.Foreground" Color="#FFFFAE00"/>
        <SolidColorBrush x:Key="Button.Pressed.Text.Foreground" Color="#FF35D2E2"/>
        <Style x:Key="SubmenuButtonStyle" TargetType="{x:Type controls:SubMenuButton}">
            <Style.Resources>
                <Style TargetType="Rectangle">
                    <Setter Property="Height" Value="20"/>
                    <Setter Property="Width" Value="20" />
                    <Setter Property="Margin" Value="5" />
                    <Setter Property="RadiusX" Value="5" />
                    <Setter Property="RadiusY" Value="5" />
                </Style>
            </Style.Resources>
            <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
            <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Foreground" Value="{StaticResource Button.Default.Text.Foreground}"/>
            <Setter Property="FontSize" Value="32" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="FontFamily" Value="Segoe Print" />
            <Setter Property="Margin" Value="10,5,5,5" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type controls:SubMenuButton}">
                        <Border x:Name="border" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                            <StackPanel Focusable="False" Orientation="Horizontal"
                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                  Margin="{TemplateBinding Padding}"
                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                <Rectangle Fill="{TemplateBinding RectangleFill}" Stroke="{StaticResource strokeRectangle}"/>
                                <TextBlock x:Name="tbxDescription" Grid.Column="1" Text="{TemplateBinding Description}"/>
                            </StackPanel>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="tbxDescription" Property="Foreground" Value="{StaticResource Button.MouseOver.Text.Foreground}"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="tbxDescription" Property="Foreground" Value="{StaticResource Button.Pressed.Text.Foreground}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="{x:Type psychophysical:TextInstructionView}">
            <Style.Setters>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type psychophysical:TextInstructionView}">
                            <Grid Background="{StaticResource instruction.Background}" >
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.3*"/>
                                    <ColumnDefinition Width="3*"/>
                                    <ColumnDefinition Width="0.3*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="3*"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <TextBlock Grid.Row="0"
                   Grid.Column="1"
                   Foreground="#FFE9EBF3"
                   VerticalAlignment="Bottom"
                   Margin="0,0,0,20"
                   HorizontalAlignment="Center"
                   Text="Текст инструкции"
                   FontSize="35"
                   FontFamily="Segoe Print"/>
                                <ScrollViewer Grid.Column="1" Grid.Row="1" VerticalScrollBarVisibility="Visible" Template="{StaticResource ScrollViewerControlTemplate_scrollToLeftTop}">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="*"/>
                                        </Grid.RowDefinitions>
                                        <FlowDocumentScrollViewer x:Name="textViewer" TextBlock.Foreground="AliceBlue" VerticalScrollBarVisibility="Auto" Document="{Binding Text}">
                                            <FlowDocumentScrollViewer.Resources>
                                                <Style TargetType="{x:Type FlowDocument}">
                                                    <Setter Property="FontSize" Value="20"/>
                                                    <Setter Property="FontFamily" Value="Segoe UI"/>
                                                </Style>
                                            </FlowDocumentScrollViewer.Resources>
                                        </FlowDocumentScrollViewer>
                                    </Grid>
                                </ScrollViewer>

                                <Border x:Name="navigatePanel"
                                        Grid.Column="3"
                                        Grid.Row="1"
                                        CornerRadius="20"
                                        Background="#80101929"
                                        Height="230"
                                        Width="410"
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Left"
                                        Margin="0,0,40,0"
                                        RenderTransformOrigin="0.5,0.5">
                                    <Border.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform ScaleX="1" ScaleY="1"/>
                                            <SkewTransform/>
                                            <RotateTransform/>
                                            <TranslateTransform/>
                                        </TransformGroup>
                                    </Border.RenderTransform>
                                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center" >
                                        <Grid.RowDefinitions>
                                            <RowDefinition x:Name="learningRow"/>
                                            <RowDefinition />
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <controls:SubMenuButton x:Name="learningButton" Description="Попробовать" Grid.Row="0" RectangleFill="Green" Style="{DynamicResource SubmenuButtonStyle}" Command="{Binding Learning_Command}"/>
                                        <controls:SubMenuButton Description="Демо инструкции" Grid.Row="1" RectangleFill="Orange" Style="{DynamicResource SubmenuButtonStyle}" Command="{Binding ToInstruction_Command}"/>
                                        <controls:SubMenuButton Description="Тестирование" Grid.Row="2" RectangleFill="Red" Style="{DynamicResource SubmenuButtonStyle}" Command="{Binding ToTest_Command}"/>
                                    </Grid>
                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <DataTrigger Binding="{Binding IsBetweenText}" Value="True">
                                    <Setter TargetName="learningButton" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="learningRow"  Property="Height" Value="0" />
                                    <Setter TargetName="navigatePanel" Property="Height" Value="170"/>
                                </DataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style.Setters>
        </Style>
    </UserControl.Resources>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TextInstructionView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public partial class TextInstructionView : UserControl
    {
        public TextInstructionView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TextInstructionViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Documents;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical
{
    public class TextInstructionViewModel : NotifyBase, IDisposable
    {
        private FlowDocument _text;
        public FlowDocument Text
        {
            get { return _text; }
            set 
            {
                _text = value;
                OnPropertyChanged();
            }
        }

        private bool _isBetweenText;

        public bool IsBetweenText
        {
            get { return _isBetweenText; }
            set 
            {
                _isBetweenText = value;
                OnPropertyChanged();
            }
        }


        private readonly ITestManager _manager;

        public RelayCommand Learning_Command => new RelayCommand(obj =>
        {
            if (!IsBetweenText)
            {
                Unsubscribe();
                _manager.Learning();
            }
        });

        public RelayCommand ToInstruction_Command => new RelayCommand(obj =>
        {
            Unsubscribe();
            _manager.ToInstruction();
        });

        public RelayCommand ToTest_Command => new RelayCommand(obj =>
        {
            Unsubscribe();
            _manager.Start();
        });
        public TextInstructionViewModel(ITestManager manager, bool isBetween = false)
        {
            IsBetweenText = isBetween;
            _manager = manager;
            _manager.Buttons.ButtonPressed += _buttons_ButtonPressed;
            _manager.Buttons.Disconnected += Buttons_Disconnected;
            _manager.Buttons.Start();
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Unsubscribe();
        }

        private void _buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            switch (e.Button)
            {
                case PultButton.Green:
                    if (!IsBetweenText)
                        Learning_Command.Execute(null);
                    break;
                case PultButton.Yellow:
                    ToInstruction_Command.Execute(null);
                    break;
                case PultButton.Red:
                    ToTest_Command.Execute(null);
                    break;
            }
        }

        private void Unsubscribe()
        {
            _manager.Buttons.ButtonPressed -= _buttons_ButtonPressed;
            _manager.Buttons.Stop();
        }

        public void Dispose()
        {
            Unsubscribe();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye\AccurateEyeTestViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.AccurateEye
{
    public class AccurateEyeTestViewModel : TestBase
    {
        private readonly int countShowView = 3;

        private bool _isTestStart = false;

        private AccurateControl control;

        //количество раз выполнения теста
        private int counterShowViews = 0;

        private Results CurrentResults = new Results();

        private PultTepping Tepping;

        public AccurateEyeTestViewModel(EnumTests testType, PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            TestType = testType;
            Manager.TraningTime = new TimeSpan(0, 1, 20);
            SetInstructions("AccurateEye");
        }

        public override event EventHandler<Psychophysical.Results> Results;

        public override FrameworkElement GetTestControl()
        {
            return new AccurateControl("", LearningTasksExtension.TestMode.Manual);
        }

        public override void Start()
        {
            _isTestStart = false;
            _testManual = false;
            StartControl();
        }
        public override void TestManual()
        {
            _isTestStart = false;
            _testManual = true;
            StartControl();
        }

        private bool _testManual = false;
        public override void TestStart()
        {
            _testManual = false;
            _isTestStart = true;
            StartControl();
        }
       
        public override void ToDefault()
        {
            base.ToDefault();
            CurrentResults.ClearResults();
            TestCurrentView = control;
        }
        public override void Stop()
        {

            if (control != null)
                control.ReturnResults -= TestCurrentView_ReturnResults;
            if (Tepping != null)
            {
                Tepping.TeppingValueChanged -= Tepping_TeppingValueChanged;
                Tepping.Disconnected -= Tepping_Disconnected;
            }
            Tepping?.Stop();
            control?.Stop();
        }

        private void NoTap()
        {
            control?.StopDraw();
        }

        private void StartControl()
        {
            Tepping = Pult as PultTepping;
            Tepping.TeppingValueChanged += Tepping_TeppingValueChanged;
            Tepping.Disconnected += Tepping_Disconnected;

            if (!_isTestStart)
                control = new AccurateControl($"{counterShowViews + 1}/3");
            else if (_isTestStart || _testManual)
                control = new AccurateControl();

            if (_testManual)
            {
                Manager.TestProxy = new TestProxy();
                Manager.TestProxy.SetTest(control);
            }
            else
                TestCurrentView = control;
            control.ReturnResults += TestCurrentView_ReturnResults;

            if (!_testManual)
                Tepping.Start();
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            
            Results?.Invoke(this, new Psychophysical.Results(new Dictionary<string, object>())
            {
                Exception = e
            });
        }

        private void Tepping_Disconnected(object sender, DisconnectedEventArgs e)
        {
            DisconnectedPult(e.Exception);
        }

        private void Tap()
        {
            control?.StartDraw();
        }
        private void Tepping_TeppingValueChanged(object sender, TeppingChangedEventArgs e)
        {
            if (e.Value)
                Tap();
            else
                NoTap();
        }

        private void TestCurrentView_ReturnResults(object sender, CurveResult e)
        {
            control.ReturnResults -= TestCurrentView_ReturnResults;
            if (!_isTestStart&&!_testManual)
            {
                CurrentResults.SetIterationResult(e);
                counterShowViews++;
            }
            if (counterShowViews != countShowView)
            {
                if (!_isTestStart)
                    control = new AccurateControl($"{counterShowViews + 1}/3");
                else if (_isTestStart|| _testManual)
                    control = new AccurateControl();
                control.ReturnResults += TestCurrentView_ReturnResults;
                if (_testManual)
                {
                    Manager.TestProxy = new TestProxy();
                    Manager.TestProxy.SetTest(control);
                }
                else
                    TestCurrentView = control;
            }
            else
            {
                Dictionary<string, object> result = CurrentResults.GetFormattedResults();
                Results?.Invoke(this, new Psychophysical.Results(result));
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye\AccutateEyeControl.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.Controls;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;

namespace Updk7.Tests.Wpf.Psychophysical.AccurateEye
{
    public class AccurateControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<CurveResult> ReturnResults;
        public Canvas Canva
        {
            get { return (Canvas)GetValue(CanvaProperty); }
            set { SetValue(CanvaProperty, value); }
        }

        public string QuestNumber
        {
            get { return (string)GetValue(QuestNumberProperty); }
            set { SetValue(QuestNumberProperty, value); }
        }

        public static readonly DependencyProperty QuestNumberProperty =
            DependencyProperty.Register("QuestNumber", typeof(string), typeof(AccurateControl), new PropertyMetadata(""));

        public int SecondsToDraw
        {
            get { return (int)GetValue(SecondsToDrawProperty); }
            set { SetValue(SecondsToDrawProperty, value); }
        }

        public static readonly DependencyProperty SecondsToDrawProperty =
            DependencyProperty.Register("SecondsToDraw", typeof(int), typeof(AccurateControl), new PropertyMetadata(0));

        public TextTimerViewModel TimerVM
        {
            get { return (TextTimerViewModel)GetValue(TimerVMProperty); }
            set { SetValue(TimerVMProperty, value); }
        }

        public static readonly DependencyProperty TimerVMProperty =
            DependencyProperty.Register("TimerVM", typeof(TextTimerViewModel), typeof(AccurateControl), new PropertyMetadata(null));

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();

        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set 
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        public static readonly DependencyProperty CanvaProperty =
            DependencyProperty.Register("Canva", typeof(Canvas), typeof(AccurateControl), new PropertyMetadata(null));
        
        private List<Route> _scenario = new List<Route>() { Route.Down, Route.Right, Route.Up, Route.Right, Route.Down };
        private int _positionScenario = 0;
        private Route? _currentRoute = null;
        private double A, B, C, D, E;
        DispatcherTimer _timer = new DispatcherTimer(DispatcherPriority.Render);
        private Point StartPoint = new Point(1, 1);
        private Random rnd = new Random();
        DispatcherTimer _t = new DispatcherTimer();
        Path pathOriginal;

        private void _t_Tick(object sender, EventArgs e)
        {
            pathOriginal.Visibility = Visibility.Hidden;
            if (Mode != TestMode.Manual)
            {
                _t.Stop();
                TimerVM.Stop();
            }
            _drawActive = true;
        }
        private List<string> _textForTextTimer = new List<string>() { "8", "7", "6", "5", "4", "3", "2", "1", "СТАРТ" };

        public AccurateControl(string questNumber = "", TestMode мode = TestMode.Normal)
        {
            TimerVM = new TextTimerViewModel(_textForTextTimer);
            QuestNumber = questNumber;
            Mode = мode;
            InitializeTestMethods();
            Initialize();
        }

        private PathFigure _figure = new PathFigure();
        private Brush linesBrush = new SolidColorBrush((Color) ColorConverter.ConvertFromString("#FFE9F0FB"));
        private void Initialize()
        {
            Canva = new Canvas();
            Canva.Height = 1500;
            Canva.Width = 1200;
            _timer.Interval = TimeSpan.FromMilliseconds(10);
            _timer.Tick += _timer_Tick;
            Path p = new Path();
            p.Name = "NewPath";
            p.Stroke = linesBrush;
            p.StrokeThickness = 10;
            var geometry = new PathGeometry();
            var figures = new PathFigureCollection();
            _figure.StartPoint = StartPoint;
            figures.Add(_figure);
            geometry.Figures = figures;
            p.Data = geometry;
            UsedElements.Add(p);
            Canva.Children.Add(p);
            Loaded += AccurateViewModel_Loaded;
        }

        public void StartShowingOriginalLines()
        {
            pathOriginal = GenerateOriginalLines();
            _t.Interval = TimeSpan.FromSeconds(10);
            _t.Tick += _t_Tick;
            if (Mode != TestMode.Manual)
            {
                _t.Start();
                TimerVM.Start();
            }
        }

        private void InitializeTestMethods()
        {
            TestMethods.Add("Initialize", () => Initialize());
            TestMethods.Add("_t_Tick", () => _t_Tick(this, new EventArgs()));
            TestMethods.Add("StartDraw", () => StartDraw());
            TestMethods.Add("_timer_Tick", () => _timer_Tick(this, new EventArgs()));
            TestMethods.Add("StopDraw", () => StopDraw());
        }

        private bool _isLoaded = false;
        private void AccurateViewModel_Loaded(object sender, RoutedEventArgs e)
        {
            Loaded -= AccurateViewModel_Loaded;
            if (!_isLoaded)
            {
                StartShowingOriginalLines();
                _isLoaded = true;
            }
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            double offsetValue = 3;
            if (Mode == TestMode.Manual)
                offsetValue = 10;

            switch (_currentRoute.Value)
            {
                case Route.Up:
                    currentEndPoint = new Point(currentEndPoint.Value.X, currentEndPoint.Value.Y - offsetValue);
                    break;
                case Route.Down:
                    currentEndPoint = new Point(currentEndPoint.Value.X, currentEndPoint.Value.Y + offsetValue);
                    break;
                case Route.Left:
                    currentEndPoint = new Point(currentEndPoint.Value.X - offsetValue, currentEndPoint.Value.Y);
                    break;
                case Route.Right:
                    currentEndPoint = new Point(currentEndPoint.Value.X + offsetValue, currentEndPoint.Value.Y);
                    break;
            }
            _curSegment.Point = currentEndPoint.Value;
        }

        private bool _isKeyDown = false;
        private bool _drawActive = false;//Рисование активно, можно тыкать щупом в площадку
        public void StartDraw()
        {
            if (!_isKeyDown&& _drawActive)
            {
                _currentRoute = _scenario[_positionScenario];
                if (currentEndPoint == null)
                    currentEndPoint = StartPoint;
                InitializeNewSegment(currentEndPoint.Value);
                if(Mode!= TestMode.Manual)
                _timer.Start();
                _isKeyDown = true;
            }
        }
        
        public void StopDraw()
        {
            if (_isKeyDown)
            {
                if (Mode != TestMode.Manual)
                    _timer.Stop();
                _isKeyDown = false;
                if (_scenario.Count - 1 > _positionScenario)
                    _positionScenario++;
                else
                {
                    System.Windows.Point A, B, C, D, E;
                    var canvaChildrenToIEnum = Canva.Children.Cast<FrameworkElement>();
                    var newPath = (Path)canvaChildrenToIEnum.FirstOrDefault(f => f.Name == "NewPath");
                    var originalLengths = new LineLengths() { A = this.A / 100, B = this.B / 100, C = this.C / 100, D = this.D / 100, E = this.E / 100 };
                    var path = (newPath.Data as PathGeometry).Figures[0];
                   
                    A = (path.Segments[0] as LineSegment).Point;
                    B = (path.Segments[1] as LineSegment).Point;
                    C = (path.Segments[2] as LineSegment).Point;
                    D = (path.Segments[3] as LineSegment).Point;
                    E = (path.Segments[4] as LineSegment).Point;
                    
                    var actualLengths = new LineLengths()
                    {
                        A = (A.Y - StartPoint.Y) / 100,
                        B = (B.X - A.X) / 100,
                        C = (B.Y - C.Y) / 100,
                        D = (D.X - C.X) / 100,
                        E = (E.Y - D.Y) / 100
                    };
                    

                    ReturnResults?.Invoke(this, new CurveResult(originalLengths, actualLengths));
                }
            }
        }

        private Point? currentEndPoint;
        private LineSegment _curSegment;
        private void InitializeNewSegment(Point StartPoint)
        {
            currentEndPoint = StartPoint;
            _curSegment = new LineSegment();
            _curSegment.Point = currentEndPoint.Value;
            _figure.Segments.Add(_curSegment);
        }

        private Path GenerateOriginalLines()
        {
            if (Mode != TestMode.Manual)
            {
                A = Parameters.A_Variants[rnd.Next(0, 5)];
                B = Parameters.B_Variants[rnd.Next(0, 5)];
                C = Parameters.C_Variants[rnd.Next(0, 5)];
                D = Parameters.D_Variants[rnd.Next(0, 5)];
                E = Parameters.E_Variants[rnd.Next(0, 5)];
            }
            else
            {
                A = Parameters.A_Variants[1];
                B = Parameters.B_Variants[1];
                C = Parameters.C_Variants[1];
                D = Parameters.D_Variants[1];
                E = Parameters.E_Variants[1];
            }

            A = A * 100;
            B = B * 100;
            C = C * 100;
            D = D * 100;
            E = E * 100;

            Path p = new Path();
            p.Name = "OriginalPath";
            p.Stroke = linesBrush;
            p.StrokeThickness = 10;
            var geometry = new PathGeometry();
            var figures = new PathFigureCollection();
            var figure = new PathFigure();
            figure.StartPoint = StartPoint;

            System.Windows.Point ALinePoint = new System.Windows.Point(StartPoint.X, StartPoint.Y + A);
            figure.Segments.Add(generateLineSegment(ALinePoint));//A line(vertical)

            System.Windows.Point BLinePoint = new System.Windows.Point(ALinePoint.X + B, ALinePoint.Y);
            figure.Segments.Add(generateLineSegment(BLinePoint));//B line(horizontal)

            System.Windows.Point CLinePoint = new System.Windows.Point(BLinePoint.X, BLinePoint.Y - C);
            figure.Segments.Add(generateLineSegment(CLinePoint));//C line(vertical)

            System.Windows.Point DLinePoint = new System.Windows.Point(CLinePoint.X + D, CLinePoint.Y);
            figure.Segments.Add(generateLineSegment(DLinePoint));//D line(horizontal)

            System.Windows.Point ELinePoint = new System.Windows.Point(DLinePoint.X, DLinePoint.Y + E);
            figure.Segments.Add(generateLineSegment(ELinePoint));//A line(vertical)

            figures.Add(figure);
            geometry.Figures = figures;
            p.Data = geometry;
            Canva.Children.Add(p);
            UsedElements.Add(p);
            var translatedStartPoint = p.TranslatePoint(StartPoint, Canva);
            var translatedEndPoint = p.TranslatePoint(ELinePoint, Canva);
            Ellipse startEl = new Ellipse
            {
                Name = "startEl",
                Fill = Common.Drawing.GetColor(Common.ColorsCircle.Red),
                Stroke = Brushes.Transparent,
                StrokeThickness = 5
            };
            startEl.Width = startEl.Height = 50;
            
            startEl.SetValue(Canvas.LeftProperty, translatedStartPoint.X - startEl.Width / 2);
            startEl.SetValue(Canvas.TopProperty, translatedStartPoint.Y - startEl.Height / 2);
            UsedElements.Add(startEl);

            Ellipse endEl = new Ellipse
            {
                Name= "endEl",
                Fill = Common.Drawing.GetColor(Common.ColorsCircle.Green),
                Stroke = Brushes.Transparent,
                StrokeThickness = 5
            };
            endEl.Width = endEl.Height = 50;
            endEl.SetValue(Canvas.LeftProperty, translatedEndPoint.X - endEl.Width / 2);
            endEl.SetValue(Canvas.TopProperty, translatedEndPoint.Y - endEl.Height / 2);
            UsedElements.Add(endEl);

            Canva.Children.Add(startEl);
            Canva.Children.Add(endEl);
            return p;
        }

        public void Stop()
        {
            if (_t != null)
            {
                _t.Tick -= _t_Tick;
                _t?.Stop();
            }
            if (_timer != null)
            {
                _timer.Tick -= _timer_Tick;
                _timer?.Stop();
            }
            TimerVM?.Stop();
        }

        private LineSegment generateLineSegment(System.Windows.Point LineEndPoint)
        {
            LineSegment lsegment = new LineSegment
            {
                Point = LineEndPoint
            };
            return lsegment;
        }
    }

    /// <summary>
    /// Длины линий(в сантиметрах)
    /// </summary>
    public static class Parameters
    {
        public static List<double> A_Variants = new List<double>() { 10, 11, 12, 13, 14 };
        public static List<double> B_Variants = new List<double>() { 3.5, 4, 4.5, 5, 5.5 };
        public static List<double> C_Variants = new List<double>() { 10, 11, 12, 13, 14 };
        public static List<double> D_Variants = new List<double>() { 3.5, 4, 4.5, 5, 5.5 };
        public static List<double> E_Variants = new List<double>() { 10, 11, 12, 13, 14 };
    }

    public enum Route
    {
        Up,
        Down,
        Left,
        Right
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye\Resources.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Controls">
    <DataTemplate DataType="{x:Type controls:TextTimerViewModel}" x:Shared="false">
        <TextBlock x:Name="tbx"
                                                       Text="{Binding Text}" 
                                                       HorizontalAlignment="Center"
                                                       FontSize="45"
                                                       Foreground="White"
                                                       VerticalAlignment="Center"
                                                       Margin="0,0,0,15"
                                                       Opacity="0"/>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding IsTextChanged}" Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard x:Name="begin">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="tbx" Storyboard.TargetProperty="(UIElement.Opacity)">
                                <EasingDoubleKeyFrame KeyTime="0:0:0" Value="1.0">
                                    <EasingDoubleKeyFrame.EasingFunction>
                                        <SineEase EasingMode="EaseInOut"/>
                                    </EasingDoubleKeyFrame.EasingFunction>
                                </EasingDoubleKeyFrame>
                                <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0.0">
                                    <EasingDoubleKeyFrame.EasingFunction>
                                        <SineEase EasingMode="EaseInOut"/>
                                    </EasingDoubleKeyFrame.EasingFunction>
                                </EasingDoubleKeyFrame>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <StopStoryboard BeginStoryboardName="begin"/>
                </DataTrigger.ExitActions>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye\Results.cs


using System;
using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Psychophysical.AccurateEye
{
    public class Results
    {
        private List<CurveResult> IterationResults = new List<CurveResult>();

        /// <summary>
        /// Удаляет все результаты
        /// </summary>
        public void ClearResults()
        {
            IterationResults.Clear();
        }

        /// <summary>
        /// Возвращает форматированные результаты
        /// </summary>
        /// <returns></returns>
        public Dictionary<string, object> GetFormattedResults()
        {
            double sum = 0.0;
            var factLines = new List<double>();
            var etalonLines = new List<double>();
            if (IterationResults.Count != 0)
            {
                foreach (var res in IterationResults)
                {
                    foreach (var value in res.SegmentResults)
                    {
                        sum = sum + Math.Abs(Math.Round(value.PercentageRatio));
                        factLines.Add(Math.Round((double)value.ActualLength, 2));
                        etalonLines.Add((double)value.OriginalLength);
                    }
                }
                var Average = sum / (IterationResults.Count * 5); // 5 - это 5 линий

                if (factLines.Count > 0 && etalonLines.Count > 0)
                {
                    var result = new Dictionary<string, object>()
                    {
                        ["Средний процент соотношения линий"] = (float)Average,
                        ["Длины линий"] = factLines.Select(s => (float)s).ToArray(),
                        ["Длины эталонов"] = etalonLines.Select(s => (float)s).ToArray()
                    };
                    return result;
                }
                else
                    return new Dictionary<string, object>();
            }
            else
                return new Dictionary<string, object>();
        }
        
        public void SetIterationResult(CurveResult curveResult)
        {
            IterationResults.Add(curveResult);
        }
    }

    /// <summary>
    /// Результат Кривой
    /// </summary>
    public class CurveResult
    {
        public List<SegmentResult> SegmentResults { get; private set; } = new List<SegmentResult>();

        /// <summary>
        /// Результат Кривой
        /// </summary>
        /// <param name="originalLengths">Длины эталона кривой</param>
        /// <param name="actualLengths">Длины фактической кривой</param>
        public CurveResult(LineLengths originalLengths, LineLengths actualLengths) => CalculateCurveResult(originalLengths, actualLengths);

        /// <summary>
        /// Вычисляет результат Кривой
        /// </summary>
        /// <param name="startPoint">Точка старта рисования кривой</param>
        /// <param name="originalLengths">Длины эталонной кривой</param>
        /// <param name="actualLengths">Длины фактической кривой</param>
        private void CalculateCurveResult(LineLengths originalLengths, LineLengths actualLengths)
        {
            SegmentResults.Add(CreateResult("A", originalLengths.A, actualLengths.A));
            SegmentResults.Add(CreateResult("B", originalLengths.B, actualLengths.B));
            SegmentResults.Add(CreateResult("C", originalLengths.C, actualLengths.C));
            SegmentResults.Add(CreateResult("D", originalLengths.D, actualLengths.D));
            SegmentResults.Add(CreateResult("E", originalLengths.E, actualLengths.E));
        }

        /// <summary>
        /// Вычисляет результат сегмента кривой
        /// </summary>
        /// <param name="nameLine">Имя сегмента линии</param>
        /// <param name="originalLenght">Длина эталона</param>
        /// <param name="actualLenght">Фактическая длина</param>
        /// <returns>Результат</returns>
        private SegmentResult CreateResult(string nameLine, double originalLenght, double actualLenght)
        {
            var segmentResult = new SegmentResult();
            segmentResult.LineName = nameLine;
            segmentResult.OriginalLength = originalLenght;
            segmentResult.ActualLength = actualLenght;
            return segmentResult;
        }
    }

    /// <summary>
    /// Результат сегмента кривой
    /// </summary>
    public class SegmentResult
    {
        /// <summary>
        /// Имя линии
        /// </summary>
        public string LineName { get; set; }

        private double? originalLength = null;
        /// <summary>
        /// Длина эталона
        /// </summary>
        public double? OriginalLength
        {
            get { return originalLength; }
            set
            {
                originalLength = value;
                if (actualLength != null)
                    PercentageRatio = GetPercentageRatio();
            }
        }

        private double? actualLength = null;
        /// <summary>
        /// Фактическая длина
        /// </summary>
        public double? ActualLength
        {
            get { return actualLength; }
            set
            {
                actualLength = value;
                if (originalLength != null)
                    PercentageRatio = GetPercentageRatio();
            }
        }

        /// <summary>
        /// Процентное соотношение эталона и фактической длины
        /// </summary>
        public double PercentageRatio { get; private set; }

        private double GetPercentageRatio()
        {
            var originalOnePercent = OriginalLength / 100.0;
            var newPercents = originalOnePercent != 0.0 ? ActualLength / originalOnePercent : 0.0;
            return newPercents.Value - 100;
        }
    }

    public class LineLengths
    {
        public double A { get; set; }
        public double B { get; set; }
        public double C { get; set; }
        public double D { get; set; }
        public double E { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.AccurateEye"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels"
                    xmlns:controls="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Controls">
    <Style TargetType="local:AccurateControl">
        <Style.Resources>
            <ResourceDictionary Source="./Resources.xaml"/>
        </Style.Resources>
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AccurateControl">
                    <ContentControl >
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920" Height="1080">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <Grid Grid.Row="1" Height="15cm" Width="12cm" >
                                            <Viewbox>
                                                <Grid>
                                                    <ContentControl Focusable="False" Height="1500" Width="1200" Margin="5" Content="{TemplateBinding Canva}"/>
                                                </Grid>
                                            </Viewbox>
                                        </Grid>

                                        <!--Timer and counter-->
                                        <Grid Grid.Row="2">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition/>
                                            </Grid.RowDefinitions>
                                            <TextBlock Text="{TemplateBinding QuestNumber}"
                                           HorizontalAlignment="Center"
                                           FontSize="35"
                                           Foreground="White"
                                           VerticalAlignment="Center"
                                           Margin="0,0,0,15"/>
                                            <ContentPresenter Grid.Row="1"
                                                      VerticalAlignment="Center"
                                                      HorizontalAlignment="Center"
                                                      Content="{TemplateBinding TimerVM}"/>
                                        </Grid>
                                    </Grid>
                                    <ContentPresenter Content="{Binding LearningPanel,RelativeSource={RelativeSource AncestorType={x:Type local:AccurateControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5" DataContext="{Binding}"
                                                    Background="{Binding Background}"
                                                    BorderBrush="{Binding BorderBrush}"
                                                    BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:AccurateEyeTestViewModel">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AccurateEyeTestViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor, 
                                                        AncestorType={x:Type local:AccurateEyeTestViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye_M\AccurateEyeTest_MViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.AccurateEye_M
{
    public class AccurateEyeTest_MViewModel : TestBase
    {
        private readonly int countShowView = 3;

        private bool _testManual = false;
        private bool _isTestStart = false;

        private Accurate_MControl control;

        //количество раз выполнения теста
        private int counterShowViews = 0;

        private Results CurrentResults = new Results();

        private PultTepping Tepping;

        public AccurateEyeTest_MViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            TestType = EnumTests.AccurateEye_M;
            SetInstructions("AccurateEye_M");
            Loaded += AccurateEyeTestViewModel_Loaded;
        }

        /// <summary>
        /// Для превью(При запуске теста, за блюром)
        /// </summary>
        /// <returns></returns>
        public override FrameworkElement GetTestControl()
        {
            return new Accurate_MControl("", LearningTasksExtension.TestMode.Manual);
        }

        public override event EventHandler<Psychophysical.Results> Results;
        #region public methods

        public override void Start()
        {
            _testManual = false;
            _isTestStart = false;
            StartControl();
        }
        public override void TestManual()
        {
            _isTestStart = false;
            _testManual = true;
            StartControl();
        }

        public override void Stop()
        {
            base.Stop();
            if (control != null)
                control.ReturnResults -= TestCurrentView_ReturnResults;
            if (Tepping != null)
                Tepping.TeppingValueChanged -= Tepping_TeppingValueChanged;
            Tepping?.Stop();
            control?.Stop();
        }

        public override void TestStart()
        {
            _testManual = false;
            _isTestStart = true;
            StartControl();
        }
        #endregion public methods
        #region private methods
        public override void ToDefault()
        {
            base.ToDefault();
            CurrentResults.ClearResults();
            TestCurrentView = control;
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Psychophysical.Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void AccurateEyeTestViewModel_Loaded(object sender, RoutedEventArgs e)
        {
            Manager.TraningTime = new TimeSpan(0, 1, 20);
        }

        private void NoTap()
        {
            control?.StopDraw();
        }

        private void StartControl()
        {
            Tepping = Pult as PultTepping;
            Tepping.TeppingValueChanged += Tepping_TeppingValueChanged;
            Tepping.Disconnected += Tepping_Disconnected;

            if (!_isTestStart)
            {
                control = new Accurate_MControl($"{counterShowViews + 1} из 3");
            }
            else if (_isTestStart || _testManual)
            {
                control = new Accurate_MControl();
            }

            if (_testManual)
            {
                Manager.TestProxy = new TestProxy();
                Manager.TestProxy.SetTest(control);
            }
            else
            {
                TestCurrentView = control;
            }

            control.ReturnResults += TestCurrentView_ReturnResults;

            if (!_testManual)
            {
                Tepping.Start();
            }
        }

        private void Tepping_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Psychophysical.Results(new Dictionary<string, object>())
            {
                Exception = e.Exception
            });
        }

        private void Tap()
        {
            control?.StartDraw();
        }
        private void Tepping_TeppingValueChanged(object sender, TeppingChangedEventArgs e)
        {
            if (e.Value)
                Tap();
            else
                NoTap();
        }

        private void TestCurrentView_ReturnResults(object sender, CurveResult e)
        {
            control.ReturnResults -= TestCurrentView_ReturnResults;
            if (!_isTestStart && !_testManual)
            {
                CurrentResults.SetIterationResult(e);
                counterShowViews++;
            }
            if (counterShowViews != countShowView)
            {
                if (!_isTestStart)
                {
                    control = new Accurate_MControl($"{counterShowViews + 1} из 3");
                }
                else if (_isTestStart || _testManual)
                {
                    control = new Accurate_MControl();
                }

                control.ReturnResults += TestCurrentView_ReturnResults;
                if (_testManual)
                {
                    Manager.TestProxy = new TestProxy();
                    Manager.TestProxy.SetTest(control);
                }
                else
                {
                    TestCurrentView = control;
                }
            }
            else
            {
                Dictionary<string, object> result = CurrentResults.GetFormattedResults();
                Results?.Invoke(this, new Psychophysical.Results(result));
            }
        }
        #endregion private methods
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye_M\AccutateEye_MControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.Controls;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.AccurateEye_M
{
    public class Accurate_MControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<CurveResult> ReturnResults;

        public bool IsLock
        {
            get { return (bool)GetValue(IsLockProperty); }
            set { SetValue(IsLockProperty, value); }
        }

        public static readonly DependencyProperty IsLockProperty =
            DependencyProperty.Register("IsLock", typeof(bool), typeof(Accurate_MControl), new PropertyMetadata(false));

        public Canvas Canva
        {
            get { return (Canvas)GetValue(CanvaProperty); }
            set { SetValue(CanvaProperty, value); }
        }
        
        public static readonly DependencyProperty CanvaProperty =
            DependencyProperty.Register("Canva", typeof(Canvas), typeof(Accurate_MControl), new PropertyMetadata(null));

        public string QuestNumber
        {
            get { return (string)GetValue(QuestNumberProperty); }
            set { SetValue(QuestNumberProperty, value); }
        }

        public static readonly DependencyProperty QuestNumberProperty =
            DependencyProperty.Register("QuestNumber", typeof(string), typeof(Accurate_MControl), new PropertyMetadata(""));

        public TextTimerViewModel TimerVM
        {
            get { return (TextTimerViewModel)GetValue(TimerVMProperty); }
            set { SetValue(TimerVMProperty, value); }
        }

        public static readonly DependencyProperty TimerVMProperty =
            DependencyProperty.Register("TimerVM", typeof(TextTimerViewModel), typeof(Accurate_MControl), new PropertyMetadata(null));
        private List<string> _textForTextTimer = new List<string>() { "24", "23", "22", "21", "20", "19",
                                                                      "18", "17", "16", "15", "14", "13", "12", "11", "10", "9",
                                                                      "8", "7", "6", "5", "4", "3", "2", "1", "СТАРТ" };


        private ProportionViewModel a_Proportion;

        public ProportionViewModel A_Proportion
        {
            get { return a_Proportion; }
            set
            {
                a_Proportion = value;
                OnPropertyChanged();
            }
        }

        private ProportionViewModel b_Proportion;

        public ProportionViewModel B_Proportion
        {
            get { return b_Proportion; }
            set
            {
                b_Proportion = value;
                OnPropertyChanged();
            }
        }

        private ProportionViewModel c_Proportion;

        public ProportionViewModel C_Proportion
        {
            get { return c_Proportion; }
            set
            {
                c_Proportion = value;
                OnPropertyChanged();
            }
        }

        private ProportionViewModel d_Proportion;

        public ProportionViewModel D_Proportion
        {
            get { return d_Proportion; }
            set
            {
                d_Proportion = value;
                OnPropertyChanged();
            }
        }

        private ProportionViewModel e_Proportion;

        public ProportionViewModel E_Proportion
        {
            get { return e_Proportion; }
            set
            {
                e_Proportion = value;
                OnPropertyChanged();
            }
        }

        private ProportionsView _proportionsView;

        public ProportionsView ProportionsView
        {
            get { return _proportionsView; }
            set 
            {
                _proportionsView = value;
                OnPropertyChanged();
            }
        }

        #region ILearning
        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        private TestMode _mode;
        public TestMode Mode 
        {
            get { return _mode; }
            set 
            {
                _mode = value;
                OnPropertyChanged();
            }
        }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();

        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }
        #endregion

        private List<NumberLine> _scenario = new List<NumberLine>() { NumberLine.One, NumberLine.Two, NumberLine.Three, NumberLine.Four, NumberLine.Five };
        private int _positionScenario = 0;
        private NumberLine? _currentLine = null;
        private double A, B, C, D, E;
        DispatcherTimer _timer = new DispatcherTimer();
        private Point StartPoint = new Point(1, 1500);
        private Random rnd = new Random();
        DispatcherTimer _previewTimer = new DispatcherTimer();
        private DispatcherTimer _endTimer = new DispatcherTimer();
        private List<Line> _originalLines = new List<Line>();
        private List<Line> _newLines = new List<Line>();

        private double _strokeThickness_Lines = 20.0;

        public Accurate_MControl(string questNumber = "", TestMode мode = TestMode.Normal)
        {
            TimerVM = new TextTimerViewModel(_textForTextTimer);
            QuestNumber = questNumber; 
            Mode = мode;
            Initialize();
            CollectingTestMethods();
        }

        public void StartShowingOriginalLines()
        {
            InitializeProportions();
            GenerateOriginalLines();
            GenerateNewLines();
            if (Mode == TestMode.Manual)
            {
                _previewTimer.Interval = TimeSpan.FromSeconds(5);
                TimerVM.Interval = TimeSpan.FromMilliseconds(175);
            }
            else
            {
                _previewTimer.Interval = TimeSpan.FromSeconds(27);
            }

            _previewTimer.Tick += _t_Tick;

            if (Mode != TestMode.Manual)
                PreviewStart();
        }

        private void PreviewStart()
        {
            _previewTimer.Start();
            TimerVM.Start();
        }

        private void _t_Tick(object sender, EventArgs e)
        {
            OriginalLinesVisibility(Visibility.Hidden);
            if (Mode != TestMode.Manual)
            {
                _previewTimer.Stop();
                TimerVM.Stop();
            }
            _drawActive = true;
        }

        private void CollectingTestMethods()
        {
            TestMethods.Add("PreviewStart", () => PreviewStart());
            //TestMethods.Add("_t_Tick", () => _t_Tick(this, new EventArgs()));
            TestMethods.Add("StartDraw", () => StartDraw());
            TestMethods.Add("_timer_Tick", () => _timer_Tick(this, new EventArgs()));
            TestMethods.Add("StopDraw", () => StopDraw());
        }
       
        private void Initialize()
        {
            Canva = new Canvas();
            Canva.Height = 2500;
            Canva.Width = 1200;
            _timer.Interval = TimeSpan.FromMilliseconds(10);
            _timer.Tick += _timer_Tick;
            _endTimer.Interval = TimeSpan.FromSeconds(2);
            _endTimer.Tick += _endTimer_Tick;
            Loaded += AccurateViewModel_Loaded;
        }

        private void _endTimer_Tick(object sender, EventArgs e)
        {
            _endTimer.Stop();
            SendResults();
        }

        private bool _isLoaded = false;
        private void AccurateViewModel_Loaded(object sender, RoutedEventArgs e)
        {
            Loaded -= AccurateViewModel_Loaded;
            if (!_isLoaded)
            {
                StartShowingOriginalLines();
                _isLoaded = true;
            }
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            double offsetValue = 3;
            if (Mode == TestMode.Manual)
                offsetValue = 10;


            if (!IsLock)
            {
                switch (_currentLine.Value)
                {
                    case NumberLine.One:
                        currentEndPoint = new Point(currentEndPoint.Value.X, currentEndPoint.Value.Y - offsetValue);
                        _curSegment.Y1 -= offsetValue;
                        break;
                    case NumberLine.Two:
                        currentEndPoint = new Point(currentEndPoint.Value.X + offsetValue, currentEndPoint.Value.Y);
                        _curSegment.X2 += offsetValue;
                        break;
                    case NumberLine.Three:
                        currentEndPoint = new Point(currentEndPoint.Value.X, currentEndPoint.Value.Y + offsetValue);
                        _curSegment.Y2 += offsetValue;
                        break;
                    case NumberLine.Four:
                        currentEndPoint = new Point(currentEndPoint.Value.X + offsetValue, currentEndPoint.Value.Y);
                        _curSegment.X2 += offsetValue;
                        break;
                    case NumberLine.Five:
                        currentEndPoint = new Point(currentEndPoint.Value.X, currentEndPoint.Value.Y - offsetValue);
                        _curSegment.Y1 -= offsetValue;
                        break;
                }
            }
        }

        private bool _isKeyDown = false;
        private bool _drawActive = false;//Рисование активно, можно тыкать щупом в площадку
        public void StartDraw()
        {
            if (!IsLock)
            {
                if (!_isKeyDown && _drawActive)
                {
                    _currentLine = _scenario[_positionScenario];
                    if (currentEndPoint == null)
                        currentEndPoint = StartPoint;
                    NameSegments segment = (NameSegments)_positionScenario;

                    InitializeNewSegment(currentEndPoint.Value, segment);
                    if (Mode != TestMode.Manual)
                        _timer.Start();
                    _isKeyDown = true;
                }
            }
        }

        public void StopDraw()
        {
            if (_isKeyDown)
            {
                if (Mode != TestMode.Manual)
                    _timer.Stop();
                _isKeyDown = false;

                //Вызов таймера окончания итерации теста
                if (_scenario.Count - 1 == _positionScenario)
                {
                    if (Mode != TestMode.Manual)
                    {
                        IsLock = true;
                        _endTimer.Start();
                    }
                }

                if (_scenario.Count - 1 >= _positionScenario)
                {
                    switch (_scenario[_positionScenario])
                    {
                        case NumberLine.One:
                            A_Proportion.IsDone = true;
                            break;
                        case NumberLine.Two:
                            B_Proportion.IsDone = true;
                            break;
                        case NumberLine.Three:
                            C_Proportion.IsDone = true;
                            break;
                        case NumberLine.Four:
                            D_Proportion.IsDone = true;
                            break;
                        case NumberLine.Five:
                            E_Proportion.IsDone = true;
                            break;
                    }

                    if(_scenario.Count - 1 != _positionScenario)
                    _positionScenario++;
                }
                
                
            }
        }

        private void SendResults()
        {
            var originalLengths = new LineLengths { A = A / 100, B = B / 100, C = C * C_Proportion.Value / 100, D = D / 100, E = E * E_Proportion.Value / 100 };
            var actualLengths = new LineLengths
            {
                A = _newLines[0].Y1 / 100,
                B = _newLines[1].X2 / 100,
                C = _newLines[2].Y2 / 100,
                D = _newLines[3].X2 / 100,
                E = _newLines[4].Y1 / 100
            };

            ReturnResults?.Invoke(this, new CurveResult(originalLengths, actualLengths));
        }


        private Point? currentEndPoint;
        private Line _curSegment;

        private List<Line> _newLinesList = new List<Line>();
        private void GenerateNewLines()
        {
            Line A_NewLine = new Line
            {
                Name = "A_NewLine",
                StrokeThickness = _strokeThickness_Lines,
                Stroke = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFA54A4A"))
            };
            Line B_NewLine = new Line
            {
                Name = "B_NewLine",
                StrokeThickness = _strokeThickness_Lines,
                Stroke = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFF7F25"))
            };
            Line C_NewLine = new Line
            {
                Name = "C_NewLine",
                StrokeThickness = _strokeThickness_Lines,
                Stroke = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF6289C8"))
            };
            Line D_NewLine = new Line
            {
                Name = "D_NewLine",
                StrokeThickness = _strokeThickness_Lines,
                Stroke = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF0C8812"))
            };
            Line E_NewLine = new Line
            {
                Name = "E_NewLine",
                StrokeThickness = _strokeThickness_Lines,
                Stroke = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFF1141C"))
            };
            UsedElements.Add(A_NewLine);
            UsedElements.Add(B_NewLine);
            UsedElements.Add(C_NewLine);
            UsedElements.Add(D_NewLine);
            UsedElements.Add(E_NewLine);
            _newLinesList.Add(A_NewLine);
            _newLinesList.Add(B_NewLine);
            _newLinesList.Add(C_NewLine);
            _newLinesList.Add(D_NewLine);
            _newLinesList.Add(E_NewLine);
            Canva.Children.Add(A_NewLine);
            Canva.Children.Add(B_NewLine);
            Canva.Children.Add(C_NewLine);
            Canva.Children.Add(D_NewLine);
            Canva.Children.Add(E_NewLine);
        }

        private void InitializeNewSegment(Point StartPoint, NameSegments segment)
        {
            currentEndPoint = StartPoint;
            _curSegment = _newLinesList.FirstOrDefault(f => f.Name == $"{segment}_NewLine");
            _curSegment.SetValue(Canvas.LeftProperty, StartPoint.X);
            _curSegment.SetValue(Canvas.TopProperty, StartPoint.Y);
            _newLines.Add(_curSegment);
        }

        private void InitializeProportions()
        {
            A_Proportion = new ProportionViewModel
            {
                Value = ProportionParameters.A_Proportion,
                DisplayValue = "",
                Color = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFA54A4A")),
                Description = "А"
            };

            B_Proportion = new ProportionViewModel
            {
                Value = ProportionParameters.B_Proportion,
                DisplayValue = "",
                Color = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFF7F25")),
                Description = "Б"
            };

            string cKey = Mode == TestMode.Manual
                ? ProportionParameters.C_ProportionVariants.Keys.ToList()[0]
                : ProportionParameters.C_ProportionVariants.Keys.ToList()[rnd.Next(0, ProportionParameters.C_ProportionVariants.Count)];

            double cValue = ProportionParameters.E_ProportionVariants.FirstOrDefault(f => f.Key == cKey).Value;

            C_Proportion = new ProportionViewModel
            {
                Value = cValue,
                DisplayValue = cKey,
                Color = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF6289C8")),
                Description = "В",
                IsFractional = true
            };

            D_Proportion = new ProportionViewModel
            {
                Value = ProportionParameters.D_Proportion,
                DisplayValue = "",
                Color = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF00C80D")),
                Description = "Г"
            };

            string eKey = "";
            if (Mode == TestMode.Manual)
                eKey = ProportionParameters.E_ProportionVariants.Keys.ToList()[0];
            else
            {
                double prevEValue = ProportionParameters.E_ProportionVariants.FirstOrDefault(f => f.Key == eKey).Value;
                eKey = cValue == 0.5
                    ? ProportionParameters.E_ProportionVariants.Keys.ToList()[rnd.Next(0, ProportionParameters.E_ProportionVariants.Count)]
                    : cValue == 0.33
                    ? ProportionParameters.E_ProportionVariants.Keys.ToList()[rnd.Next(1, ProportionParameters.E_ProportionVariants.Count)]
                    : ProportionParameters.E_ProportionVariants.Keys.ToList()[2];
            }

            double eValue = ProportionParameters.E_ProportionVariants.FirstOrDefault(f => f.Key == eKey).Value;

            E_Proportion = new ProportionViewModel
            {
                Value = eValue,
                DisplayValue = eKey,
                Color = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFF3C41")),
                Description = "Д",
                IsFractional = true
            };
            ProportionsView = new ProportionsView();

            UsedElements.Add(ProportionsView.A_Prop_CC);
            UsedElements.Add(ProportionsView.B_Prop_CC);
            UsedElements.Add(ProportionsView.C_Prop_CC);
            UsedElements.Add(ProportionsView.D_Prop_CC);
            UsedElements.Add(ProportionsView.E_Prop_CC);
        }

        #region OriginalLines
        private void GenerateOriginalLines()
        {
            if (Mode != TestMode.Manual)
            {
                A = Parameters.A_Variants[rnd.Next(0, 5)];
                B = Parameters.B_Variants[rnd.Next(0, 5)];
                C = Parameters.C_Variants[rnd.Next(0, 5)];
                D = Parameters.D_Variants[rnd.Next(0, 5)];
                E = Parameters.E_Variants[rnd.Next(0, 5)];
            }
            else
            {
                A = Parameters.A_Variants[1];
                B = Parameters.B_Variants[1];
                C = Parameters.C_Variants[1];
                D = Parameters.D_Variants[1];
                E = Parameters.E_Variants[1];
            }

            A = A * 100;
            B = B * 100;
            C = C * 100;
            D = D * 100;
            E = E * 100;

            double width = B + D;

            var lineSizes = new List<double>() { A, C, E };

            var height = Math.Abs(A - C) + Math.Abs(C - E) + lineSizes.Min();

            Canva.Width = width;
            Canva.Height = height + 100;

            if (A < C)
            {
                if (C < E)
                {
                    var offsetY = E - C + A;
                    StartPoint.Y = offsetY;
                }
                else if (C >= E)
                {
                    StartPoint.Y = A;
                }
            }
            else if (A > C)
            {
                if (C < E)
                {
                    var offsetY = E - C + A - C + C;
                    StartPoint.Y = offsetY;
                }
                else if (C >= E)
                {
                    StartPoint.Y = A;
                }
            }
            else if (A == C)
            {
                StartPoint.Y = A;
            }
               

            Point ALinePoint = new Point(StartPoint.X, StartPoint.Y - A);
            generateLine(
                StartPoint,
                ALinePoint,
                new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFA54A4A")),
                NumberLine.One,
                "A_OriginalLine"
                );

            Point BLinePoint = new Point(ALinePoint.X + B, ALinePoint.Y);
            generateLine(
               ALinePoint,
               BLinePoint,
               new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFF7F25")),
               NumberLine.Two,
               "B_OriginalLine"
               );

            Point CLinePoint = new Point(BLinePoint.X, BLinePoint.Y + C);
            generateLine(
              BLinePoint,
              CLinePoint,
              new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF6289C8")),
              NumberLine.Three,
              "C_OriginalLine"
              );

            Point DLinePoint = new Point(CLinePoint.X + D, CLinePoint.Y);
            generateLine(
              CLinePoint,
              DLinePoint,
              new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF00C80D")),
              NumberLine.Four,
              "D_OriginalLine"
              );

            Point ELinePoint = new Point(DLinePoint.X, DLinePoint.Y - E);
            generateLine(
              DLinePoint,
              ELinePoint,
              new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFF3C41")),
              NumberLine.Five,
              "E_OriginalLine"
              );

            Ellipse startEl = new Ellipse
            {
                Fill = Common.Drawing.GetColor(Common.ColorsCircle.Green),
                StrokeThickness = 5.0,
                Name= "startEl"
            };

            UsedElements.Add(startEl);
            startEl.Width = startEl.Height = 50;
            startEl.SetValue(Canvas.LeftProperty, StartPoint.X - startEl.Width / 2);
            startEl.SetValue(Canvas.TopProperty, StartPoint.Y - startEl.Height / 2);

            Canva.Children.Add(startEl);
        }

        private void OriginalLinesVisibility(Visibility visibility)
        {
            foreach (Line line in _originalLines)
                line.Visibility = visibility;
            foreach (TextBlock header in _headers)
                header.Visibility = visibility;
        }

        public void Stop()
        {
            _previewTimer.Tick -= _t_Tick;
            _previewTimer?.Stop();
            _timer.Tick -= _timer_Tick;
            _timer?.Stop();
            _endTimer.Tick -= _endTimer_Tick;
            _endTimer.Stop();
            TimerVM?.Stop();
        }

        private double _margin = 12.0;
        private List<TextBlock> _headers = new List<TextBlock>();
        private void generateLine(Point LineStartPoint, Point LineEndPoint, Brush brush, NumberLine numberLine, string name)
        {
            Line l = new Line
            {
                Stroke = brush,
                StrokeThickness = _strokeThickness_Lines,
                Name = name
            };

            TextBlock header = new TextBlock
            {
                FontSize = 42,
                Foreground = Brushes.White,
                Width = 70,
                Height = 52,
                TextAlignment = TextAlignment.Center
            };

            UsedElements.Add(l);

            switch (numberLine)
            {
                case NumberLine.One:
                    l.X1 = 0;
                    l.Y1 = 0;
                    l.Y2 = LineStartPoint.Y - LineEndPoint.Y;
                    l.X2 = 0;
                    l.SetValue(Canvas.LeftProperty, LineEndPoint.X);
                    l.SetValue(Canvas.TopProperty, LineEndPoint.Y);

                    header.Text = A_Proportion.DisplayValue;
                    header.SetValue(Canvas.LeftProperty, LineStartPoint.X + _margin + l.StrokeThickness);
                    header.SetValue(Canvas.TopProperty, LineStartPoint.Y - ((LineStartPoint.Y - LineEndPoint.Y) / 2) - (header.Height / 2));
                    break;
                case NumberLine.Two:
                    l.X1 = 0;
                    l.Y1 = 0;
                    l.X2 = LineEndPoint.X - LineStartPoint.X;
                    l.Y2 = 0;
                    l.SetValue(Canvas.LeftProperty, LineStartPoint.X);
                    l.SetValue(Canvas.TopProperty, LineStartPoint.Y);

                    header.Text = B_Proportion.DisplayValue;
                    header.SetValue(Canvas.LeftProperty, LineEndPoint.X - ((LineEndPoint.X - LineStartPoint.X) / 2) - header.Width / 2);
                    header.SetValue(Canvas.TopProperty, LineStartPoint.Y + _margin + l.StrokeThickness);
                    break;
                case NumberLine.Three:
                    l.X1 = 0;
                    l.Y1 = 0;
                    l.Y2 = LineEndPoint.Y - LineStartPoint.Y;
                    l.X2 = 0;
                    l.SetValue(Canvas.LeftProperty, LineStartPoint.X);
                    l.SetValue(Canvas.TopProperty, LineStartPoint.Y);

                    header.Text = C_Proportion.DisplayValue;
                    header.SetValue(Canvas.LeftProperty, LineStartPoint.X + _margin + l.StrokeThickness);
                    header.SetValue(Canvas.TopProperty, LineStartPoint.Y - ((LineStartPoint.Y - LineEndPoint.Y) / 2) + header.Height / 2);
                    break;
                case NumberLine.Four:
                    l.X1 = 0;
                    l.Y1 = 0;
                    l.X2 = LineEndPoint.X - LineStartPoint.X;
                    l.Y2 = 0;
                    l.SetValue(Canvas.LeftProperty, LineStartPoint.X);
                    l.SetValue(Canvas.TopProperty, LineStartPoint.Y);

                    header.Text = D_Proportion.DisplayValue;
                    header.SetValue(Canvas.LeftProperty, LineEndPoint.X - (LineEndPoint.X - LineStartPoint.X) / 2 - header.Width / 2);
                    header.SetValue(Canvas.TopProperty, LineStartPoint.Y + _margin + l.StrokeThickness);
                    break;
                case NumberLine.Five:
                    l.X1 = 0;
                    l.Y1 = 0;
                    l.Y2 = LineStartPoint.Y - LineEndPoint.Y;
                    l.X2 = 0;
                    l.SetValue(Canvas.LeftProperty, LineEndPoint.X);
                    l.SetValue(Canvas.TopProperty, LineEndPoint.Y);

                    header.Text = E_Proportion.DisplayValue;
                    header.SetValue(Canvas.LeftProperty, LineStartPoint.X + _margin + l.StrokeThickness);
                    header.SetValue(Canvas.TopProperty, LineStartPoint.Y - ((LineStartPoint.Y - LineEndPoint.Y) / 2) + header.Height / 2);
                    break;
            }

            _originalLines.Add(l);
            _headers.Add(header);
            Canva.Children.Add(header);
            Canva.Children.Add(l);
        }
        #endregion
    }

    /// <summary>
    /// Длины линий(в сантиметрах)
    /// </summary>
    public static class Parameters
    {
        public static List<double> A_Variants = new List<double>() { 10, 11, 12, 13, 14 };
        public static List<double> B_Variants = new List<double>() { 3.5, 4, 4.5, 5, 5.5 };
        public static List<double> C_Variants = new List<double>() { 10, 11, 12, 13, 14 };
        public static List<double> D_Variants = new List<double>() { 3.5, 4, 4.5, 5, 5.5 };
        public static List<double> E_Variants = new List<double>() { 10, 11, 12, 13, 14 };
    }

    public static class ProportionParameters
    {
        public static double A_Proportion = 1;
        public static double B_Proportion = 1;
        public static Dictionary<string,double> C_ProportionVariants = new Dictionary<string, double>
        {
            ["2"] = 0.5,
            ["3"] = 0.33,
            ["4"] = 0.25
        };
        public static double D_Proportion = 1;
        public static Dictionary<string, double> E_ProportionVariants = new Dictionary<string, double>
        {
            ["2"] = 0.5,
            ["3"] = 0.33,
            ["4"] = 0.25
        };
    }

    public enum NumberLine
    {
        One,
        Two,
        Three,
        Four,
        Five
    }

    public enum NameSegments
    {
        A,B,C,D,E
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye_M\Icon.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.AccurateEye_M.Icon"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.AccurateEye_M"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid Background="#FFFFF97D">
        <Viewbox>
            <Canvas Height="190" Width="190" >
                <Path Data="M25.5,32.399763 L25.5,173.89976" Height="142.5" Canvas.Left="26" Stretch="Fill" Stroke="#FFA54A4A" Canvas.Top="31.916" Width="3" StrokeThickness="3"/>
                <Path Data="M25.507353,32.333333 L94.507353,32.333333" Height="3" Canvas.Left="26" Stretch="Fill" Stroke="#FFFF2727" Canvas.Top="31.916" Width="70" StrokeThickness="3"/>
                <Path Data="M95.5,31.36372 L95.5,173.86372" Height="142.5" Canvas.Left="94" Stretch="Fill" Stroke="#FFFF5A23" Canvas.Top="31.916" Width="3" StrokeThickness="3"/>
                <Path Data="M94.007353,172.91669 L163.00735,172.91669" Height="3" Canvas.Left="94" Stretch="Fill" Stroke="#FF66D966" Canvas.Top="172.916" Width="70" StrokeThickness="3"/>
                <Path Data="M95.5,30.774077 L95.5,173.27408" Height="151.833" Canvas.Left="162" Stretch="Fill" Stroke="#FF4545D1" Canvas.Top="23.083" Width="3" StrokeThickness="3"/>
                <Ellipse Height="10" Canvas.Left="22.458" Canvas.Top="171.839" Width="10" Fill="#FF33CC33"/>
                <TextBlock Height="28" Canvas.Left="6.667" TextWrapping="Wrap" Text="A" Canvas.Top="79.333" Width="13.833" FontSize="20" Foreground="#FFA54A4A" FontWeight="Bold"/>
                <TextBlock Height="22.916" Canvas.Left="52.001" TextWrapping="Wrap" Text="Б" Width="13.833" FontSize="20" Foreground="#FFFF2727" Canvas.Top="33.916" FontWeight="Bold"/>
                <TextBlock Height="28" Canvas.Left="101" TextWrapping="Wrap" Text="В" Canvas.Top="79.333" Width="13.833" FontSize="20" Foreground="#FFFF5A23" FontWeight="Bold"/>
                <TextBlock Height="22.667" Canvas.Left="122.667" TextWrapping="Wrap" Text="Г" Canvas.Top="145.249" Width="13.833" FontSize="20" Foreground="#FF66D966" FontWeight="Bold"/>
                <TextBlock Height="28" Canvas.Left="169" TextWrapping="Wrap" Text="Д" Canvas.Top="79.333" Width="13.833" FontSize="20" Foreground="#FF4545D1" FontWeight="Bold"/>
            </Canvas>
        </Viewbox>    
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye_M\Icon.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.AccurateEye_M
{
    /// <summary>
    /// Interaction logic for Icon.xaml
    /// </summary>
    public partial class Icon : UserControl
    {
        public Icon()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye_M\ProportionsView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.AccurateEye_M.ProportionsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.AccurateEye_M"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid TextBlock.FontWeight="Bold"
          VerticalAlignment="Center">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Border x:Name="A_Prop_CC"
                HorizontalAlignment="Center"
                VerticalAlignment="Center">
            <ContentControl Content="{Binding A_Proportion,
                                  RelativeSource={RelativeSource FindAncestor,
                                  AncestorType={x:Type local:Accurate_MControl}}}"/>
        </Border>
        <Border x:Name="B_Prop_CC"
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"
                 Grid.Column="1">
            <ContentControl Content="{Binding B_Proportion,
                                  RelativeSource={RelativeSource FindAncestor,
                                  AncestorType={x:Type local:Accurate_MControl}}}"/>
        </Border>
        <Border x:Name="C_Prop_CC"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Grid.Column="2">
            <ContentControl  Content="{Binding C_Proportion,
                                  RelativeSource={RelativeSource FindAncestor,
                                  AncestorType={x:Type local:Accurate_MControl}}}"/>
        </Border>
        <Border x:Name="D_Prop_CC" 
                HorizontalAlignment="Center" 
                VerticalAlignment="Center"
                Grid.Column="3">
            <ContentControl Content="{Binding D_Proportion,
                                  RelativeSource={RelativeSource FindAncestor,
                                  AncestorType={x:Type local:Accurate_MControl}}}"/>
        </Border>
        <Border x:Name="E_Prop_CC"
                HorizontalAlignment="Center" 
                VerticalAlignment="Center"
                Grid.Column="4">
            <ContentControl Content="{Binding E_Proportion,
                                  RelativeSource={RelativeSource FindAncestor,
                                  AncestorType={x:Type local:Accurate_MControl}}}"/>
        </Border>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye_M\ProportionsView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.AccurateEye_M
{
    public partial class ProportionsView : UserControl
    {
        public ProportionsView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye_M\ProportionViewModel.cs

using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using Updk7.Tests.Wpf.Psychophysical;

namespace Updk7.Tests.Wpf.Psychophysical.AccurateEye_M
{
    public class ProportionViewModel : BindableBase
    {
        private string description;
        public string Description
        {
            get { return description; }
            set { SetProperty(ref description, value); }
        }

        private string _displayValue;
        public string DisplayValue
        {
            get { return _displayValue; }
            set { SetProperty(ref _displayValue, value); }
        }

        private double _value;
        public double Value
        {
            get { return _value; }
            set 
            {
                SetProperty(ref _value, value);
            }
        }

        private bool _isFractional;

        public bool IsFractional
        {
            get { return _isFractional; }
            set { _isFractional = value; }
        }

        private bool _isDone;

        public bool IsDone
        {
            get { return _isDone; }
            set { SetProperty(ref _isDone, value); }
        }

        private Brush _color;
        public Brush Color
        {
            get { return _color; }
            set { SetProperty(ref _color, value); }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye_M\Resources.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.AccurateEye_M"
                    xmlns:controls="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Controls">
    <DataTemplate DataType="{x:Type local:ProportionViewModel}" x:Shared="false">
        <Grid Width="40" Height="100" Margin="10" HorizontalAlignment="Left">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            
            <TextBlock Grid.Row="0"
                       x:Name="displayNumberTbx"
                       TextBlock.FontSize="25" 
                       Text="{Binding DisplayValue}"
                       VerticalAlignment="Bottom" 
                       HorizontalAlignment="Center"
                       TextAlignment="Center"
                       Foreground="White"
                       Margin="0,0,0,10"/>
            <Grid Grid.Row="1">
                <Rectangle Height="40"
                       Width="40"
                       Fill="{Binding Color}"
                       Grid.Row="2"/>
                <Viewbox Height="40"
                     Width="40"
                     x:Name="checkMarker"
                     Grid.Row="0"
                     HorizontalAlignment="Center"
                     VerticalAlignment="Center">
                    <Canvas Height="50"
                    Width="50"
                    Margin="10,0,0,0">
                        <Path x:Name="path" Data="M6.9134694,0.00039145317 C7.6598391,-0.0074913949 8.442708,0.10319371 9.2499998,0.37663144 C11.5,6.626631
                      12.96875,11.40775 12.96875,11.40775 L12.984375,24.235875 C12.984375,24.235875 1.2665139,7.100249 0.021891808,3.9091075 
                      L0,3.8485826 L0,3.4496414 L0.024256063,3.4228832 C0.58927569,2.8078739 3.330896,0.038229359 6.9134694,0.00039145317 z"
              Height="24.236"
              VerticalAlignment="Bottom"
              Width="13"
                  Canvas.Top="25.561">
                            <Path.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <LinearGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                                            <SkewTransform CenterY="0.5" CenterX="0.5"/>
                                            <RotateTransform Angle="-33.085" CenterY="0.5" CenterX="0.5"/>
                                            <TranslateTransform/>
                                        </TransformGroup>
                                    </LinearGradientBrush.RelativeTransform>
                                    <GradientStop Color="#001CE625" Offset="0"/>
                                    <GradientStop Color="#001CE625" Offset="1"/>
                                </LinearGradientBrush>
                            </Path.Fill>
                        </Path>
                        <Path x:Name="path1" Data="M36.979543,0 C28.646207,6.9999997 0.15662478,49.859375 0.156625,49.859375 L-1.6093515E-09,36.90625 C-3.4567716E-07,36.90625 30.375375,3.8955006 31.062875,3.3955008 C31.750375,2.8955006 33.812875,1.4999997 36.979543,0 z" Canvas.Left="12.813" Height="49.859" Width="36.979">
                            <Path.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <LinearGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                                            <SkewTransform CenterY="0.5" CenterX="0.5"/>
                                            <RotateTransform Angle="48.013" CenterY="0.5" CenterX="0.5"/>
                                            <TranslateTransform/>
                                        </TransformGroup>
                                    </LinearGradientBrush.RelativeTransform>
                                    <GradientStop Color="#001CE625" Offset="0"/>
                                    <GradientStop Color="#001CE625" Offset="1"/>
                                </LinearGradientBrush>
                            </Path.Fill>
                        </Path>
                    </Canvas>
                </Viewbox>
            </Grid>
        </Grid>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding IsFractional}" Value="true">
                <Setter TargetName="displayNumberTbx" Property="FontWeight" Value="Normal"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding IsDone}" Value="true">
                <DataTrigger.EnterActions>
                    <BeginStoryboard x:Name="checkMarkerAnimation">
                        <Storyboard>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="path">
                                <EasingColorKeyFrame KeyTime="0:0:0.2" Value="#FF1CE625"/>
                            </ColorAnimationUsingKeyFrames>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="path">
                                <EasingColorKeyFrame KeyTime="0:0:0.2" Value="#FF1CE625"/>
                            </ColorAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Offset)" Storyboard.TargetName="path1">
                                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0.004"/>
                            </DoubleAnimationUsingKeyFrames>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="path1">
                                <EasingColorKeyFrame KeyTime="0:0:0.2" Value="#001CE625"/>
                                <EasingColorKeyFrame KeyTime="0:0:0.4" Value="#FF1CE625"/>
                            </ColorAnimationUsingKeyFrames>
                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="path1">
                                <EasingColorKeyFrame KeyTime="0:0:0.2" Value="#001CE625"/>
                                <EasingColorKeyFrame KeyTime="0:0:0.4" Value="#FF1CE625"/>
                            </ColorAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <StopStoryboard BeginStoryboardName="checkMarkerAnimation"/>
                </DataTrigger.ExitActions>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

    <DataTemplate DataType="{x:Type controls:TextTimerViewModel}" x:Shared="false">
        <TextBlock x:Name="tbx"
                   Text="{Binding Text}" 
                   HorizontalAlignment="Center"
                   FontSize="45"
                   Foreground="White"
                   VerticalAlignment="Center"
                   Margin="0,0,0,15"
                   Opacity="0"/>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding IsTextChanged}" Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard x:Name="begin">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="tbx" Storyboard.TargetProperty="(UIElement.Opacity)">
                                <EasingDoubleKeyFrame KeyTime="0:0:0" Value="1.0">
                                    <EasingDoubleKeyFrame.EasingFunction>
                                        <SineEase EasingMode="EaseInOut"/>
                                    </EasingDoubleKeyFrame.EasingFunction>
                                </EasingDoubleKeyFrame>
                                <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0.0">
                                    <EasingDoubleKeyFrame.EasingFunction>
                                        <SineEase EasingMode="EaseInOut"/>
                                    </EasingDoubleKeyFrame.EasingFunction>
                                </EasingDoubleKeyFrame>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <StopStoryboard BeginStoryboardName="begin"/>
                </DataTrigger.ExitActions>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye_M\Results.cs


using System;
using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Psychophysical.AccurateEye_M
{
    public class Results
    {
        private List<CurveResult> IterationResults = new List<CurveResult>();

        /// <summary>
        /// Удаляет все результаты
        /// </summary>
        public void ClearResults()
        {
            IterationResults.Clear();
        }

        /// <summary>
        /// Возвращает форматированные результаты
        /// </summary>
        /// <returns></returns>
        public Dictionary<string, object> GetFormattedResults()
        {
            double sum = 0.0;
            var factLines = new List<double>();
            var etalonLines = new List<double>();
            if (IterationResults.Count != 0)
            {
                foreach (var res in IterationResults)
                {
                    foreach (var value in res.SegmentResults)
                    {
                        sum = sum + Math.Abs(Math.Round(value.PercentageRatio));
                        factLines.Add(Math.Round((double)value.ActualLength, 2));
                        etalonLines.Add((double)value.OriginalLength);
                    }
                }
                var Average = sum / (IterationResults.Count * 5); // 5 - это 5 линий
                var deviations = new List<float>();
                for (int i = 0; i < etalonLines.Count; i++)
                {
                    var deviation = factLines[i] - etalonLines[i];
                    deviations.Add((float)deviation);
                }

                if (factLines.Count > 0 && etalonLines.Count > 0)
                {
                    var result = new Dictionary<string, object>()
                    {
                        ["Средний процент отклонения линий"] = (float)Average,
                        ["Длины нарисованных отрезков"] = factLines.Select(s => (float)s).ToArray(),
                        ["Отклонения от заданного отрезка"] = deviations.ToArray(),
                        ["Длины эталонов с пропорциональным изменением длины"] = etalonLines.Select(s => (float)s).ToArray()
                    };
                    return result;
                }
                else
                    return new Dictionary<string, object>();
            }
            else
                return new Dictionary<string, object>();
        }
        
        public void SetIterationResult(CurveResult curveResult)
        {
            IterationResults.Add(curveResult);
        }
    }

    /// <summary>
    /// Результат Кривой
    /// </summary>
    public class CurveResult
    {
        public List<SegmentResult> SegmentResults { get; private set; } = new List<SegmentResult>();

        /// <summary>
        /// Результат Кривой
        /// </summary>
        /// <param name="originalLengths">Длины эталона кривой</param>
        /// <param name="actualLengths">Длины фактической кривой</param>
        public CurveResult(LineLengths originalLengths, LineLengths actualLengths) => CalculateCurveResult(originalLengths, actualLengths);

        /// <summary>
        /// Вычисляет результат Кривой
        /// </summary>
        /// <param name="startPoint">Точка старта рисования кривой</param>
        /// <param name="originalLengths">Длины эталонной кривой</param>
        /// <param name="actualLengths">Длины фактической кривой</param>
        private void CalculateCurveResult(LineLengths originalLengths, LineLengths actualLengths)
        {
            SegmentResults.Add(CreateResult("A", originalLengths.A, actualLengths.A));
            SegmentResults.Add(CreateResult("B", originalLengths.B, actualLengths.B));
            SegmentResults.Add(CreateResult("C", originalLengths.C, actualLengths.C));
            SegmentResults.Add(CreateResult("D", originalLengths.D, actualLengths.D));
            SegmentResults.Add(CreateResult("E", originalLengths.E, actualLengths.E));
        }

        /// <summary>
        /// Вычисляет результат сегмента кривой
        /// </summary>
        /// <param name="nameLine">Имя сегмента линии</param>
        /// <param name="originalLenght">Длина эталона</param>
        /// <param name="actualLenght">Фактическая длина</param>
        /// <returns>Результат</returns>
        private SegmentResult CreateResult(string nameLine, double originalLenght, double actualLenght)
        {
            var segmentResult = new SegmentResult();
            segmentResult.LineName = nameLine;
            segmentResult.OriginalLength = originalLenght;
            segmentResult.ActualLength = actualLenght;
            return segmentResult;
        }
    }

    /// <summary>
    /// Результат сегмента кривой
    /// </summary>
    public class SegmentResult
    {
        /// <summary>
        /// Имя линии
        /// </summary>
        public string LineName { get; set; }

        private double? originalLength = null;
        /// <summary>
        /// Длина эталона
        /// </summary>
        public double? OriginalLength
        {
            get { return originalLength; }
            set
            {
                originalLength = value;
                if (actualLength != null)
                    PercentageRatio = GetPercentageRatio();
            }
        }

        private double? actualLength = null;
        /// <summary>
        /// Фактическая длина
        /// </summary>
        public double? ActualLength
        {
            get { return actualLength; }
            set
            {
                actualLength =Math.Abs(value.Value);
                if (originalLength != null)
                    PercentageRatio = GetPercentageRatio();
            }
        }

        /// <summary>
        /// Процентное соотношение эталона и фактической длины
        /// </summary>
        public double PercentageRatio { get; private set; }

        private double GetPercentageRatio()
        {
            var originalOnePercent = OriginalLength / 100.0;
            var newPercents = originalOnePercent != 0.0 ? ActualLength / originalOnePercent : 0.0;
            return newPercents.Value - 100;
        }
    }

    public class LineLengths
    {
        public double A { get; set; }
        public double B { get; set; }
        public double C { get; set; }
        public double D { get; set; }
        public double E { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AccurateEye_M\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.AccurateEye_M"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels"
                    xmlns:learning="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension">
    <Style TargetType="local:Accurate_MControl">
        <Style.Resources>
            <ResourceDictionary Source="./Resources.xaml"/>
        </Style.Resources>
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Accurate_MControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920" Height="1080">
                                    <Grid x:Name="TEST_content_GRID" >
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="4cm"/>
                                            <RowDefinition/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="4.5cm"/>
                                            <ColumnDefinition/>
                                        </Grid.ColumnDefinitions>

                                        <TextBlock x:Name="tbxDescription" 
                                                   Grid.Column="0"
                                                   Grid.ColumnSpan="2"
                                                   Margin="35,0,0,15"
                                                   Grid.RowSpan="2"
                                                   Foreground="#FFF1F1F1"
                                                   HorizontalAlignment="Left"
                                                   VerticalAlignment="Bottom"
                                                   FontSize="30"
                                                   TextAlignment="Left">
                                                <Run Text="Нарисуйте ломаную линию,"/>
                                                <LineBreak/>
                                                <Run Text="изменяя длину отрезков в"/>
                                                <LineBreak/>
                                                <Run Text="соответствии с указанными пропорциями"/>
                                        </TextBlock>

                                        <ContentPresenter Content="{Binding ProportionsView,
                                                                    RelativeSource={RelativeSource FindAncestor,
                                                                    AncestorType={x:Type local:Accurate_MControl}}}" 
                                                          Grid.Row="0"
                                                          Grid.RowSpan="3"
                                                          Grid.ColumnSpan="2"
                                                          HorizontalAlignment="Left"
                                                          VerticalAlignment="Bottom"
                                                          Margin="30,0,0,0"/>

                                        <Grid x:Name="GRID_Lines" Grid.Row="1" Grid.ColumnSpan="2">
                                            <Viewbox>
                                                <Grid>
                                                    <ContentControl Focusable="False" Margin="5" Content="{TemplateBinding Canva}"/>
                                                </Grid>
                                            </Viewbox>
                                        </Grid>

                                        <!--Timer and counter-->
                                        <Grid Grid.Row="2" Grid.ColumnSpan="2">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition/>
                                            </Grid.RowDefinitions>
                                            <TextBlock Text="{TemplateBinding QuestNumber}"
                                                       HorizontalAlignment="Center"
                                                       FontSize="35"
                                                       Foreground="White"
                                                       VerticalAlignment="Center"
                                                       Margin="0,0,0,15"/>
                                            <ContentPresenter Grid.Row="1"
                                                              VerticalAlignment="Center"
                                                              HorizontalAlignment="Center"
                                                              Content="{TemplateBinding TimerVM}"/>
                                        </Grid>
                                    </Grid>
                                    <Border x:Name="lockBorder" Background="#7E49505B" Grid.RowSpan="3" Grid.ColumnSpan="2" Opacity="0.0"/>
                                    <ContentPresenter Content="{Binding LearningPanel, RelativeSource={RelativeSource AncestorType={x:Type local:Accurate_MControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsLock" Value="True" >
                            <Setter TargetName="lockBorder" Property="Opacity" Value="1.0"/>
                        </Trigger>
                        <DataTrigger Binding="{Binding Mode,
                            RelativeSource={RelativeSource Self}}" 
                                     Value="{x:Static learning:TestMode.Manual}">
                            <Setter TargetName="tbxDescription" Property="Opacity" Value="0.0" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:AccurateEyeTest_MViewModel">
        <Setter Property="Background" Value="White"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AccurateEyeTest_MViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:AccurateEyeTest_MViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AssesmentMethodOnVolumeAttentions\AssesmentMethodOnVolumeAttentionsControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.AssesmentMethodOnVolumeAttentions
{
    public class AssesmentMethodOnVolumeAttentionsControl : NotifyViewModelBase, ILearning
    {
        private MatrixControl _matrixView;
        
        private DispatcherTimer _timer = new DispatcherTimer();

        private int currentIndexSample = 0;

        private List<int> registeredResults = new List<int>();
        private ISamples _samples;
        public AssesmentMethodOnVolumeAttentionsControl(ISamples samples, TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            _samples = samples;
            if (Mode == TestMode.Manual)
            {
                Sample sample = _samples.SampleValues[0];
                MatrixView = new MatrixControl(sample.Variants[0], sample.Time, TestMode.Manual);
                MatrixView.IsHitTestVisible = false;
                MatrixView.Freezing();
                Initialize();
                
            }
        }

        private void Initialize()
        {
            TestMethods.Add("ShowMatrix", () => MatrixView.ShowMatrix());
            TestMethods.Add("HideMatrix", () => MatrixView.HideMatrix());
            TestMethods.Add("Start", () => MatrixView.Start());
            TestMethods.Add("Preview1State", () => MatrixView.Preview1State());
            TestMethods.Add("Pause1State", () => MatrixView.Pause1State());
            TestMethods.Add("Preview2State", () => MatrixView.Preview2State());
            TestMethods.Add("Pause2State", () => MatrixView.Pause2State());
            TestMethods.Add("CheckDot1", () => CheckDot1());
            TestMethods.Add("CheckDot2", () => CheckDot2());
        }

        public void CheckDot(PointChecker checker)
        {
            if (Mode == TestMode.Manual)
            {
                if (checker.Position != null)
                    checker.IsChecked = true;
            }
        }
        #region Only for instructions
        public void CheckDot1()
        {
            var dot = MatrixView.Cells.FirstOrDefault(f => f.Position != null);
            if (dot != null)
                dot.IsChecked = true;
        }

        public void CheckDot2()
        {
            var dot = MatrixView.Cells.LastOrDefault(f => f.Position != null);
            if (dot != null)
                dot.IsChecked = true;
        }
        #endregion

        public event EventHandler<Dictionary<string, object>> Results;
        public MatrixControl MatrixView
        {
            get { return _matrixView; }
            set
            {
                if (_matrixView != null)
                {
                    _matrixView.Result -= _matrixView_Result;
                    _matrixView.ChangeState -= _matrixView_ChangeState;
                }
                _matrixView = value;
                if (_matrixView != null)
                {
                    _matrixView.Result += _matrixView_Result;
                    _matrixView.ChangeState += _matrixView_ChangeState;
                }
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();

        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }
        public void Start()
        {
            if (Mode != TestMode.Manual)
            {
                _timer.Interval = TimeSpan.FromSeconds(2);
                _timer.Tick += _timer_Tick;
                _timer.Start();
            }
        }

        public void Stop()
        {
            if (_matrixView != null)
            {
                _matrixView.ChangeState -= _matrixView_ChangeState;
                _matrixView.Result -= _matrixView_Result;
                _matrixView.Stop();
            }
            if (_timer != null)
            {
                _timer.Tick -= _timer_Tick;
                _timer.Stop();
            }
        }

        [DllImport("User32.dll")]
        private static extern bool SetCursorPos(int X, int Y);
        private void _matrixView_ChangeState(object sender, State e)
        {
            if (Mode != TestMode.Manual)
            {
                switch (e)
                {
                    case State.Pause2:
                        Cursor = Cursors.None;
                        break;
                    case State.Quest:
                        Cursor = Cursors.Arrow;
                        SetPosition();
                        break;
                }
            }
        }

        private void _matrixView_Result(object sender, int e)
        {
            if (Mode != TestMode.Manual)
            {
                registeredResults.Add(e);
                _timer.Start();
            }
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            if (currentIndexSample < _samples.SampleValues.Count)
            {
                if (_matrixView != null)
                {
                    _matrixView.Stop();
                }

                Sample sample = _samples.SampleValues[currentIndexSample];
                MatrixView = new MatrixControl(sample.Variants[Common._rnd.Next(0, sample.Variants.Count())], sample.Time);
                MatrixView.Start();
                currentIndexSample++;
                _timer.Stop();
            }
            else
            {
                ReturnResults();
            }
        }

        private void ReturnResults()
        {
            if (_matrixView != null)
            {
                _matrixView.ChangeState -= _matrixView_ChangeState;
                _matrixView.Result -= _matrixView_Result;
                _matrixView.Stop();
            }
            _timer.Stop();
            int maxRes = registeredResults.Max();
            registeredResults.Remove(maxRes);
            int secondaryMaxRes = registeredResults.Max();
            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Максимальный результат обследуемого"] = maxRes + secondaryMaxRes
            });
        }

        private void SetPosition()
        {
            var p = new Point(ActualWidth / 2, ActualHeight / 2);
            Point pointToScreen = this.PointToScreen(p);
            SetCursorPos((int)pointToScreen.X, (int)pointToScreen.Y);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AssesmentMethodOnVolumeAttentions\AssesmentMethodOnVolumeAttentionsViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.AssesmentMethodOnVolumeAttentions
{
    public class AssesmentMethodOnVolumeAttentionsViewModel : TestBase
    {
        public override event EventHandler<Results> Results;

        private AssesmentMethodOnVolumeAttentionsControl control;
        private ISamples _samples;
        public AssesmentMethodOnVolumeAttentionsViewModel(ISamples samples, PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("AssesmentMethodOnVolumeAttentions");
            Manager.TraningTime = new TimeSpan(0, 0, 40);
            _samples = samples;
        }

        public override FrameworkElement GetTestControl()
        {
            return new AssesmentMethodOnVolumeAttentionsControl(_samples, LearningTasksExtension.TestMode.Manual);
        }

        public override void TestManual()
        {
            control = new AssesmentMethodOnVolumeAttentionsControl(_samples, LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            control = new AssesmentMethodOnVolumeAttentionsControl(_samples);
            TestCurrentView = control;
            control.Start();
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override void Start()
        {
            control = new AssesmentMethodOnVolumeAttentionsControl(_samples);
            TestCurrentView = control;
            control.Results += Control_Results;
            control.Start();
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        public override void Stop()
        {
            base.Stop();
            if (control != null)
            {
                control.Results -= Control_Results;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AssesmentMethodOnVolumeAttentions\ISamples.cs


using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.AssesmentMethodOnVolumeAttentions
{
    public interface ISamples
    {
         List<Sample> SampleValues { get; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AssesmentMethodOnVolumeAttentions\MatrixControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;

namespace Updk7.Tests.Wpf.Psychophysical.AssesmentMethodOnVolumeAttentions
{
    public class MatrixControl : NotifyViewModelBase
    {
        public event EventHandler<int> Result;
        public event EventHandler<State> ChangeState;
        public Canvas Canva
        {
            get { return (Canvas)GetValue(CanvaProperty); }
            set { SetValue(CanvaProperty, value); }
        }
        
        public static readonly DependencyProperty CanvaProperty =
            DependencyProperty.Register("Canva", typeof(Canvas), typeof(MatrixControl), new PropertyMetadata(null));

        public List<PointChecker> Cells { get; set; } = new List<PointChecker>();
        private List<Point> pointViews;
        private DispatcherTimer _timer = new DispatcherTimer();
        private TimeSpan? _timeQuest = null;

        private State state;
        public State State
        {
            get { return state; }
            set
            {
                state = value;
                ChangeState?.Invoke(this, state);
            }
        }

        private TestMode mode;

        public TestMode Mode
        {
            get { return mode; }
            set { mode = value; }
        }


        public MatrixControl(string pointsStringRowLine, TimeSpan timeQuest, TestMode mode = TestMode.Normal)
        {
            _timeQuest = timeQuest;
            pointViews = PointsPositions.GetDots(pointsStringRowLine);
            Mode = mode;
            GenerateMartix(4, 4);
        }

        public void Freezing()
        {
            ShowMatrix();
            IsHitTestVisible = false;
        }

        public void Stop()
        {
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
            UnsubscribeCells();
        }

        public void Start()
        {
            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick += _timer_Tick;
            State = State.Preview1;
            IsHitTestVisible = false;
            foreach (var cell in Cells)
                if (cell.Position != null)
                    cell.IsChecked = true;
            if (Mode != TestMode.Manual)
                _timer.Start();
        }

        public void ShowMatrix()
        {
            Opacity = 1.0;
        }

        public void HideMatrix()
        {
            Opacity = 0.0;
        }

        public void Preview1State()
        {
            _timer.Interval = TimeSpan.FromSeconds(3);
            HideMatrix();
            State = State.Pause1;
        }

        public void Pause1State()
        {
            _timer.Interval = TimeSpan.FromSeconds(1);
            ShowMatrix();
            State = State.Preview2;
        }

        public void Preview2State()
        {
            _timer.Interval = TimeSpan.FromSeconds(3);
            HideMatrix();
            State = State.Pause2;
        }

        public void Pause2State()
        {
            _timer.Interval = _timeQuest.Value;
            foreach (var cell in Cells)
                if (cell.Position != null)
                    cell.IsChecked = false;
            if(Mode!= TestMode.Manual)
            IsHitTestVisible = true;
            ShowMatrix();
            State = State.Quest;
        }

        public void QuestState()
        {
            HideMatrix();
            if (Mode != TestMode.Manual)
            {
                _timer.Stop();
                ReturnResult();
            }
        }

        public void StateChanged(State state)
        {
            switch (state)
            {
                case State.Preview1:
                    Preview1State();
                    break;
                case State.Pause1:
                    Pause1State();
                    break;
                case State.Preview2:
                    Preview2State();
                    break;
                case State.Pause2:
                    Pause2State();
                    break;
                case State.Quest:
                    QuestState();
                    break;
            }
        }
        
        private void _timer_Tick(object sender, EventArgs e)
        {
            StateChanged(State);
        }

        private void GenerateMartix(int rows, int columns)
        {
            var canvas = new Canvas();
            var grid = new Grid();
            grid.Height = grid.Width = 360;
            canvas.Height = canvas.Width = 360;
            for (int i = 0; i < rows + 1; i++)
            {
                var horizontalLine = new Line();
                horizontalLine.Height = 1.44;
                horizontalLine.Width = canvas.Width;
                horizontalLine.X1 = 0;
                horizontalLine.Y1 = 0;
                horizontalLine.X2 = horizontalLine.Width;
                horizontalLine.Y2 = 0;
                horizontalLine.Stroke = Brushes.Black;
                horizontalLine.StrokeThickness = 1.44;
                horizontalLine.SetValue(Canvas.LeftProperty, 0.0);
                horizontalLine.SetValue(Canvas.TopProperty, i * canvas.Height / rows);
                canvas.Children.Add(horizontalLine);
                for (int j = 0; j < columns + 1; j++)
                {
                    var verticalLine = new Line();
                    verticalLine.Height = canvas.Height;
                    verticalLine.Width = 1.44;
                    verticalLine.X1 = 0;
                    verticalLine.Y1 = 0;
                    verticalLine.X2 = 0;
                    verticalLine.Y2 = canvas.Height;
                    verticalLine.Stroke = Brushes.Black;
                    verticalLine.StrokeThickness = 1.44;
                    verticalLine.SetValue(Canvas.LeftProperty, j * canvas.Width / columns);
                    verticalLine.SetValue(Canvas.TopProperty, 0.0);
                    canvas.Children.Add(verticalLine);
                }
            }

            for (int i = 0; i < rows; i++)
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(canvas.Width / 4, GridUnitType.Pixel) });
            for (int j = 0; j < columns; j++)
                grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(canvas.Height / 4, GridUnitType.Pixel) });
            canvas.Children.Add(grid);

            int indexPoints = 0;
            for (int i = 0; i < rows; i++)
            {
                for (int j = 0; j < columns; j++)
                {
                    var cell = new PointChecker();
                    var possiblePointPosition = pointViews.Where(f => f.X == i && f.Y == j);
                    if (pointViews.Count != 0 && possiblePointPosition.Count() != 0)
                        cell.Position = pointViews[indexPoints];
                    cell.Height = canvas.Height / 4;
                    cell.Width = canvas.Width / 4;
                    cell.SetValue(Grid.RowProperty, i);
                    cell.SetValue(Grid.ColumnProperty, j);
                    cell.MouseDown += Cell_MouseDown;
                    Cells.Add(cell);
                    grid.Children.Add(cell);
                }
            }
            canvas.Background = Brushes.White;
            Canva = canvas;
        }

        private void UnsubscribeCells()
        {
            foreach (var cell in Cells)
                cell.MouseDown -= Cell_MouseDown;
        }

        private bool _isBlockedActive = false;
        private void Cell_MouseDown(object sender, MouseButtonEventArgs e)
        {
            var cell = sender as PointChecker;
            if (cell != null)
            {
                cell.IsChecked = !cell.IsChecked;
                if (Cells.Where(f => f.IsChecked).Count() == pointViews.Count() && pointViews.Count != 0 && !_isBlockedActive)
                {
                    _isBlockedActive = true;
                    foreach (var currCell in Cells)
                        if (!currCell.IsChecked)
                            currCell.IsBlocked = true;
                }
                else if (Cells.Where(f => f.IsChecked).Count() < pointViews.Count() && pointViews.Count != 0 && _isBlockedActive)
                {
                    _isBlockedActive = false;
                    foreach (var currCell in Cells)
                        currCell.IsBlocked = false;
                }
            }
        }

        private void ReturnResult()
        {
            var countCorrectlySetPoints = (Cells.Where(f => f.IsChecked && f.Position != null)).Count();
            Result?.Invoke(this, countCorrectlySetPoints);
        }
    }

    /// <summary>
    /// Местоположения точек
    /// </summary>
    public static class PointsPositions
    {
        public static List<Point> GetDots(string dots)
        {
            var pattern = @"(?<Point>[\w\d]+)";
            var patternStrokePair = @"(?<Row>[R]\d)(?<Column>[C]\d)";
            var value = @"(?<Value>\d)";
            Regex r = new Regex(pattern);
            Regex rCell = new Regex(patternStrokePair);
            Regex rValue = new Regex(value);
            var rowColumnPairs = new List<string>();
            var points = new List<Point>();
            var matchesStroke = r.Matches(dots);
            if (matchesStroke.Count != 0)
                foreach (Match match in matchesStroke)
                {
                    var cellMatches = rCell.Matches(match.Groups["Point"].Value);
                    if (cellMatches.Count != 0)
                    {
                        foreach (Match matchCell in cellMatches)
                        {
                            try
                            {
                                var row = Convert.ToInt32(rValue.Matches(matchCell.Groups["Row"].Value)[0].Value);
                                var column = Convert.ToInt32(rValue.Matches(matchCell.Groups["Column"].Value)[0].Value);
                                var curPoint = new Point(row, column);
                                points.Add(curPoint);
                            }
                            catch
                            {
                                return new List<Point>();
                            }
                        }
                    }
                    else return new List<Point>();
                }
            return points;
        }
    }
    public enum State
    {
        Preview1,
        Pause1,
        Preview2,
        Pause2,
        Quest
    }
}


*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AssesmentMethodOnVolumeAttentions\PointChecker.cs


using System.Windows;

namespace Updk7.Tests.Wpf.Psychophysical.AssesmentMethodOnVolumeAttentions
{
    public class PointChecker:NotifyViewModelBase
    {
        private bool _isChecked;
        public bool IsChecked
        {
            get { return _isChecked; }
            set
            {
                _isChecked = value;
                OnPropertyChanged();
            }
        }

        private Point? _position;
        public Point? Position
        {
            get { return _position; }
            set
            {
                _position = value;
                OnPropertyChanged();
            }
        }

        private bool _isBlocked;
        public bool IsBlocked
        {
            get { return _isBlocked; }
            set
            {
                _isBlocked = value;
                OnPropertyChanged();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AssesmentMethodOnVolumeAttentions\Samples.cs


using System;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.AssesmentMethodOnVolumeAttentions
{
    public class Samples: ISamples
    {
        public List<Sample> SampleValues { get; private set; } = new List<Sample>()
        {
            new Sample(
                new string[4]
                   {
                        "R0C0 R2C3",
                        "R0C3 R3C1",
                        "R1C0 R3C3",
                        "R0C2 R3C0"
                   },
                TimeSpan.FromSeconds(15)),
              new Sample(
                 new string[4]
                   {
                       "R1C0 R2C2 R3C1",
                       "R0C2 R1C0 R2C1",
                       "R0C2 R1C1 R2C3",
                       "R1C2 R2C3 R3C1"
                   },
                TimeSpan.FromSeconds(15)),
               new Sample(
                 new string[4]
                   {
                       "R0C0 R1C2 R2C0 R2C1",
                       "R0C1 R0C3 R1C1 R2C2",
                       "R1C2 R1C3 R2C1 R3C3",
                       "R1C1 R2C2 R3C0 R3C2"
                   },
                TimeSpan.FromSeconds(15)),
               new Sample(
                 new string[4]
                   {
                       "R0C0 R1C0 R1C2 R2C2 R3C1",
                       "R0C2 R0C3 R1C0 R2C1 R2C2",
                       "R0C2 R1C1 R2C1 R2C3 R3C3",
                       "R1C1 R1C2 R2C3 R3C0 R3C1"
                   },
                TimeSpan.FromSeconds(15)),
               new Sample(
                 new string[4]
                   {
                       "R0C1 R0C2 R1C2 R2C0 R2C3 R3C1",
                       "R0C1 R1C0 R1C3 R2C2 R2C3 R3C1",
                       "R0C2 R1C0 R1C3 R2C1 R3C1 R3C2",
                       "R0C2 R1C0 R1C1 R2C0 R2C3 R3C2"
                   },
                TimeSpan.FromSeconds(15)),
               new Sample(
                 new string[4]
                   {
                       "R0C1 R0C3 R1C2 R2C1 R2C2 R2C3 R3C0",
                       "R0C1 R0C3 R1C2 R2C1 R2C2 R2C3 R3C0",
                       "R0C3 R1C0 R1C1 R1C2 R2C1 R3C0 R3C2",
                       "R0C0 R0C2 R1C1 R1C2 R2C0 R2C2 R3C3"
                   },
                TimeSpan.FromSeconds(20)),
                new Sample(
                 new string[4]
                   {
                       "R0C1 R0C3 R1C1 R1C2 R2C0 R2C2 R3C1 R3C3",
                       "R0C1 R1C0 R1C2 R1C3 R2C1 R2C2 R3C0 R3C3",
                       "R0C0 R0C2 R1C1 R1C3 R2C1 R2C2 R3C0 R3C2",
                       "R0C0 R0C3 R1C1 R1C2 R2C0 R2C1 R2C3 R3C2"
                   },
                TimeSpan.FromSeconds(20)),
                 new Sample(
                new string[4]
                   {
                       "R0C1 R0C2 R1C0 R1C2 R1C3 R2C1 R3C1 R3C2 R3C3",
                       "R0C2 R1C0 R1C1 R1C3 R2C0 R2C2 R2C3 R3C0 R3C2",
                       "R0C0 R0C1 R0C2 R1C2 R2C0 R2C1 R2C3 R3C1 R3C2",
                       "R0C1 R0C3 R1C0 R1C1 R1C3 R2C0 R2C2 R2C3 R3C1"
                   },
                TimeSpan.FromSeconds(25)),
        };
    }

    public class Sample
    {
        public Sample(string[] variants, TimeSpan time)
        {
            Variants = variants;
            Time = time;
        }

        public TimeSpan Time { get; private set; }
        public string[] Variants { get; private set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AssesmentMethodOnVolumeAttentions\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.AssesmentMethodOnVolumeAttentions"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:MatrixControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:MatrixControl">
                    <ContentControl Content="{TemplateBinding Canva}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="local:PointChecker">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:PointChecker">
                    <Border BorderBrush="Black" BorderThickness="0.1">
                        <Grid Background="#00000000">
                            <Border x:Name="CheckedBorder" Opacity="0.0">
                                <Ellipse Height="22.5" Width="22.5" Fill="Black" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="1"/>
                            </Border>
                            <Border x:Name="BlockableBorder" Opacity="0.0"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource Self}}" Value="True">
                            <Setter TargetName="CheckedBorder" Property="Opacity" Value="1.0"/>
                        </DataTrigger>

                        <DataTrigger Binding="{Binding IsBlocked, RelativeSource={RelativeSource Self}}" Value="True">
                            <Setter TargetName="BlockableBorder" Property="Opacity" Value="1.0"/>
                            <Setter Property="IsHitTestVisible" Value="False"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:AssesmentMethodOnVolumeAttentionsControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AssesmentMethodOnVolumeAttentionsControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920" Height="1080">
                                    <ContentControl Width="360" Height="360" SnapsToDevicePixels="True" Content="{Binding MatrixView,
                                        RelativeSource={RelativeSource FindAncestor, 
                                        AncestorType={x:Type local:AssesmentMethodOnVolumeAttentionsControl}}}"/>
                                    <ContentPresenter Content="{Binding LearningPanel,
                                        RelativeSource={RelativeSource AncestorType={x:Type local:AssesmentMethodOnVolumeAttentionsControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:AssesmentMethodOnVolumeAttentionsViewModel">
        <Setter Property="Background" Value="White"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AssesmentMethodOnVolumeAttentionsViewModel">
                    <ContentControl>
                        <Grid Background="{DynamicResource Default.Background.Dark}">
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel, 
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:AssesmentMethodOnVolumeAttentionsViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AssessmentOfPropensityToTakeRisks\AssessmentOfPropensityToTakeRisksControl.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.AssessmentOfPropensityToTakeRisks
{
    public class AssessmentOfPropensityToTakeRisksControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<List<Dictionary<string, object>>> Results;
        private List<double> _d1 = new List<double>() { 80, 90, 100 };
        private List<double> _d2 = new List<double>() { 110, 120, 130 };
        private List<double> _d3 = new List<double>() { 150, 160, 170 };

        public string NumberTest
        {
            get { return (string)GetValue(NumberTestProperty); }
            set { SetValue(NumberTestProperty, value); }
        }

        public static readonly DependencyProperty NumberTestProperty =
            DependencyProperty.Register("NumberTest", typeof(string), typeof(AssessmentOfPropensityToTakeRisksControl), new PropertyMetadata(""));
        public bool IsCompletedControl { get; private set; } = false;

        private int _numberQuest;
        public int NumberQuest
        {
            get { return _numberQuest; }
            set
            {
                _numberQuest = value;
                if (_numberQuest > 0)
                {
                    NumberTest = $"{_numberQuest} из 3";
                }
                OnPropertyChanged();
            }
        }


        private Viewbox viewboxForCanvas;

        public Viewbox ViewboxForCanvas
        {
            get { return viewboxForCanvas; }
            set 
            {
                viewboxForCanvas = value;
                OnPropertyChanged();
            }
        }


        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }
        private bool _isStudyQuest;
        public bool IsStudyQuest
        {
            get { return _isStudyQuest; }
            set
            {
                _isStudyQuest = value;
                OnPropertyChanged();
            }
        }

        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();

        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private List<Dictionary<string, object>> RegisteredResults = new List<Dictionary<string, object>>();

        //private double size_multiplier = 5.0;//эта штука появилась дабы не ломать логику теста, просто умножает размеры(говорит во сколько раз) объекты теста,
                                             //эллипсы, пути эллипсов

        private Ellipse el1, el2, el3; //пути передвижения эллипсов
        private Ellipse elMove1, elMove2, elMove3;//передвигаемые анимацией эллипсы
        private Ellipse elStatic1, elStatic2, elStatic3;//статичные эллипсы
        private double el1MaxSpeed = 100, el2MaxSpeed = 150, el3MaxSpeed = 200;
        Random rnd = new Random();
        DispatcherTimer _timerShowMessage = new DispatcherTimer();
        DispatcherTimer _transitionBetweenCirclesTimer = new DispatcherTimer();
        public AssessmentOfPropensityToTakeRisksControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            Initialize();
        }

        private void Initialize()
        {
            _timerShowMessage.Interval = TimeSpan.FromSeconds(2);
            _timerShowMessage.Tick += _timerShowMessage_Tick;
            _transitionBetweenCirclesTimer.Interval = TimeSpan.FromSeconds(2);
            _transitionBetweenCirclesTimer.Tick += _transitionBetweenCirclesTimer_Tick;
            var canvas = new Canvas
            {
                Width = 200,
                Height = 200
            };
            Canva = canvas;
            ViewboxForCanvas = new Viewbox
            {
                Height = 1000,
                Width = 1000,
                Child = Canva
            };
            generateScene();
            TestMethods.Add("Start", () => Start());
            TestMethods.Add("HideAll", () => HideAll());
            TestMethods.Add("ShowRedCircle1", () => ShowRedCircle1());
            TestMethods.Add("ShowRedCircle2", () => ShowRedCircle2());
            TestMethods.Add("ShowRedCircle3", () => ShowRedCircle3());
            TestMethods.Add("ShowGreenCircle1", () => ShowGreenCircle1());
            TestMethods.Add("ShowGreenCircle2", () => ShowGreenCircle2()); 
            TestMethods.Add("ShowGreenCircle3", () => ShowGreenCircle3());
            TestMethods.Add("NextCircleOrReturnResult", () => NextCircleOrReturnResult());
            TestMethods.Add("ChangeAcceleration20Percent", () => ChangeAcceleration20Percent());
            TestMethods.Add("ChangeAcceleration50Percent", () => ChangeAcceleration50Percent());
            TestMethods.Add("ChangeAcceleration100Percent", () => ChangeAcceleration100Percent());
            TestMethods.Add("ChangeAcceleration0Percent", () => ChangeAcceleration0Percent());
        }

        private void _transitionBetweenCirclesTimer_Tick(object sender, EventArgs e)
        {
            _transitionBetweenCirclesTimer.Stop();
            NextCircleOrReturnResult();
        }

        private void _timerShowMessage_Tick(object sender, EventArgs e)
        {
            _timerShowMessage.Stop();
            _isShowingMessage = false;
            Message = null;
        }

        private bool _isShowingMessage = false;
        private void ShowMessage(string message)
        {
            Message = message;
            _isShowingMessage = true;
            _timerShowMessage.Start();
        }

        private List<Ellipse> elPaths;
        private List<Ellipse> elMoves;
        private List<Ellipse> elStatics;
        private void generateScene()
        {
            if (Mode == TestMode.Manual)
            {
                _d1 = new List<double>() { _d1[0] };
                _d2 = new List<double>() { _d2[0] };
                _d3 = new List<double>() { _d3[0] };
            }
            el1 = generatePathEllipse(_d1);
            el2 = generatePathEllipse(_d2);
            el3 = generatePathEllipse(_d3);
            elStatic1 = generateStaticEllipse(el1, 90);
            elStatic2 = generateStaticEllipse(el2, 90);
            elStatic3 = generateStaticEllipse(el3, 90);
            elMove1 = generateMoveEllipse();
            elMove2 = generateMoveEllipse();
            elMove3 = generateMoveEllipse();
            elPaths = new List<Ellipse>() { el1, el2, el3 };
            elMoves = new List<Ellipse>() { elMove1, elMove2, elMove3 };
            elStatics = new List<Ellipse>() { elStatic1, elStatic2, elStatic3 };
            
            AddUsedElement("el1", el1);
            AddUsedElement("el2", el2);
            AddUsedElement("el3", el3);
            AddUsedElement("elStatic1", elStatic1);
            AddUsedElement("elStatic2", elStatic2);
            AddUsedElement("elStatic3", elStatic3);
            AddUsedElement("elMove1", elMove1);
            AddUsedElement("elMove2", elMove2);
            AddUsedElement("elMove3", elMove3);
            HideAll();
        }

        private void AddUsedElement(string name, FrameworkElement element)
        {
            element.Name = name;
            UsedElements.Add(element);
        }

        private void HideAll()
        {
            foreach (var elM in elMoves)
                elM.Opacity = 0.0;
            foreach (var elS in elStatics)
                elS.Opacity = 0.0;
        }

        #region only for Instruction
        private void ShowRedCircle1()
        {
            elStatic1.Opacity = 1.0;
        }

        private void ShowRedCircle2()
        {
            elStatic2.Opacity = 1.0;
        }

        private void ShowRedCircle3()
        {
            elStatic3.Opacity = 1.0;
        }

        private void ShowGreenCircle1()
        {
            elMove1.Opacity = 1.0;
        }

        private void ShowGreenCircle2()
        {
            elMove2.Opacity = 1.0;
        }

        private void ShowGreenCircle3()
        {
            elMove3.Opacity = 1.0;
        }

        private void ChangeAcceleration20Percent()
        {
            ChangeAcceleration(0.2);
        }

        private void ChangeAcceleration50Percent()
        {
            ChangeAcceleration(0.5);
        }

        private void ChangeAcceleration100Percent()
        {
            ChangeAcceleration(1.0);
        }

        private void ChangeAcceleration0Percent()
        {
            ChangeAcceleration(0.0);
        }

        #endregion

        private double _maxCoefSpeed;
        private DateTime _startTimeDeceleration;
        private bool _isStartDeceletationAfterFullCircle = false;//Торможение после прохода полного круга
        private bool _isNotStoppedCircle = false;//Эллипс не был остановлен
        private List<ChangeSpeedAndAngle> _listSpeeds = new List<ChangeSpeedAndAngle>();//Изменения скорости
        private List<TimeSpan> _ListTimeSpeeds = new List<TimeSpan>();
        //private List<double> speedTimePlaces = new List<double>();
        private DateTime? _startTimeSpeed;
        private bool _isComplete = false;
        public bool IsCompleteTimeoutTimerTransitionCircle { get; set; } = true;
        private double _offsetCoef = 0.05;//коэфициент для старта
        private bool _switchOverOffset = false;//переход через стартовый коэфициэнт
        private double _multiplier = 1;
        private double _currentMaxSpeed;
        private bool _startDeceleration = false;
        //private double? oldCoefSpeed;
        /// <summary>
        /// Изменение коэфициента ускорения
        /// </summary>
        /// <param name="_coefSpeed"></param>
        public void ChangeAcceleration(double _coefSpeed)
        {
            try
            {
                if (_indexCurrentAnimation <= 2)
                {
                    if (!WaitingZeroState)
                    {
                        if (!_isComplete)
                        {
                            if (!_isShowingMessage)
                            {
                                if (_coefSpeed > _offsetCoef && !_switchOverOffset)
                                {
                                    _switchOverOffset = true;
                                }

                                if (_switchOverOffset)
                                {
                                    var curSpeed = _coefSpeed * GetSpeed();
                                    var angle = Math.Round(GetAngle());
                                    if (angle < 0)
                                        angle = 180 + (180 + angle);
                                    if (angle < 90)
                                        angle = 360 - 90 + angle;
                                    else
                                        angle = angle - 90;
                                    if (_multiplier == 2)
                                        angle = angle + 360;
                                    _listSpeeds.Add(new ChangeSpeedAndAngle(curSpeed, angle));
                                }

                                if (_startTimeSpeed != null)
                                {
                                    var time = DateTime.Now - _startTimeSpeed.Value;
                                    _ListTimeSpeeds.Add(time);

                                    _startTimeSpeed = DateTime.Now;
                                }
                                else
                                {
                                    _startTimeSpeed = DateTime.Now;
                                }
                                if (_maxCoefSpeed < _coefSpeed)
                                {

                                    _maxCoefSpeed = _coefSpeed;
                                    if (_isFullCircleComplete)
                                        _isStartDeceletationAfterFullCircle = true;
                                }

                                if (_currentMaxSpeed > Math.Round(_coefSpeed) && !_startDeceleration)
                                {
                                    _startDeceleration = true;
                                    _startTimeDeceleration = DateTime.Now;
                                    Debug.WriteLine($"StartTime deceleration: {_startTimeDeceleration}");

                                }
                                else if (_currentMaxSpeed < Math.Round(_coefSpeed))
                                {
                                    Debug.WriteLine($"Update speed");
                                    _currentMaxSpeed = Math.Round(_coefSpeed, 2);
                                    _startDeceleration = false;
                                }


                                var currentAnimation = _listAnimations[_indexCurrentAnimation];
                                if (_coefSpeed > 0.001)
                                {
                                    currentAnimation.Resume();
                                    currentAnimation.SetSpeedRatio(_coefSpeed);
                                }
                                else
                                {
                                    currentAnimation.Pause();
                                    CheckStopEndNextCircle();
                                }
                            }
                        }
                    }
                    else
                    {
                        if (_coefSpeed == 0)
                        {
                            if (IsCompleteTimeoutTimerTransitionCircle)
                            {
                                WaitingZeroState = false;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                
            }
        }

        private void ReturnResult()
        {
            IsCompletedControl = true;
            if (Mode != TestMode.Manual)
            {
                Stop();
                _isComplete = true;
                Results?.Invoke(this, RegisteredResults);
            }
        }

        /// <summary>
        /// Создает передвигаемый объект
        /// </summary>
        /// <returns></returns>
        private Ellipse generateMoveEllipse()
        {
            var elMove = new Ellipse();
            elMove.Width = 5;
            elMove.Height = 5;
            elMove.StrokeThickness = 0.4;
            elMove.Stroke = Brushes.White;
            elMove.Fill = Common.Drawing.GetColor(Common.ColorsCircle.Green);
            elMove.SetValue(Canvas.LeftProperty, -elMove.Width / 2);
            elMove.SetValue(Canvas.TopProperty, -elMove.Height / 2);
            Canva.Children.Add(elMove);
            return elMove;
        }

        /// <summary>
        /// Создает статический объект
        /// </summary>
        /// <param name="elPath">Эллипс на котором будет объект</param>
        /// <param name="angle">Угол отклонения(в градусах), 0 градусов это Х(горизонталь с правой стороны)</param>
        /// <returns></returns>
        private Ellipse generateStaticEllipse(Ellipse elPath, double angle)
        {
            Ellipse elStatic = new Ellipse();
            elStatic.Width = 5;
            elStatic.Height = 5;
            elStatic.Fill = Brushes.Red;
            var x = (elPath.Width / 2) * Math.Cos(toRadians(angle));
            var y = (elPath.Height / 2) * Math.Sin(toRadians(angle));
            x = x + (Canva.Width / 2) - (elStatic.Width / 2);
            y = y + (Canva.Height / 2) - (elStatic.Height / 2);
            elStatic.SetValue(Canvas.LeftProperty, x);
            elStatic.SetValue(Canvas.TopProperty, y);
            Canva.Children.Add(elStatic);
            return elStatic;
        }

        /// <summary>
        /// Градусы в радианы
        /// </summary>
        /// <param name="angle"></param>
        /// <returns></returns>
        private double toRadians(double angle)
        {
            return (Math.PI * angle) / 180;
        }

        private double toAngle(double radians)
        {
            return (radians * 180) / Math.PI;
        }
       
        private int _indexCurrentAnimation = 0;
        List<Storyboard> _listAnimations = new List<Storyboard>();
        DateTime _startTime;
        public void Start()
        {
            PrevLoadAnimation();
        }

        public void Stop()
        {
            foreach (var animation in _listAnimations)
                animation.Pause();
        }

        /// <summary>
        /// Предзагрузка анимации
        /// </summary>
        private void PrevLoadAnimation()
        {
            CreateAnimation(elMove1, el1, el1MaxSpeed);
            CreateAnimation(elMove2, el2, el2MaxSpeed);
            CreateAnimation(elMove3, el3, el3MaxSpeed);

            SubscribeChangeTranslateTransform(
                                 elPaths[_indexCurrentAnimation],
                                 elMoves[_indexCurrentAnimation],
                                 elStatics[_indexCurrentAnimation]);
        }

        private TranslateTransform _currentTransform;
        private Ellipse _currentElMove;
        private Ellipse _currentElPath;
        private Ellipse _currentElStatic;

        private void SubscribeChangeTranslateTransform(Ellipse elPath, Ellipse elMove,Ellipse elStatic)
        {
            DefaultValues();//Восстанавливает флаги в исходное состояние

            if (_currentElMove != null)
                _currentElMove.Opacity = 0.0;
            if (_currentElStatic != null)
                _currentElStatic.Opacity = 0.0;

            var group = elMove.RenderTransform as TransformGroup;
            var tTransform = group.Children.FirstOrDefault(f => f is TranslateTransform);
            _currentTransform = tTransform as TranslateTransform;
            _currentElPath = elPath;
            _currentElStatic = elStatic;
            _currentElMove = elMove;

            if (Mode != TestMode.Manual)
            {
                if (_currentElMove != null)
                    _currentElMove.Opacity = 1.0;
                if (_currentElStatic != null)
                    _currentElStatic.Opacity = 1.0;
            }

            tTransform.Changed += TTransform_Changed;
        }

        /// <summary>
        /// Восстанавливает поля в исходное состояние
        /// </summary>
        private void DefaultValues()
        {
            _isNotStoppedCircle = false;
            _isStartDeceletationAfterFullCircle = false;
            _isPossibleStop = false;
            _isFullCircleComplete = false;
            _maxCoefSpeed = 0;
            _listSpeeds = new List<ChangeSpeedAndAngle>();
            _ListTimeSpeeds = new List<TimeSpan>();
            _switchOverOffset = false;
        }

        private bool _isPossibleStop = false;
        private bool _isNotStartedPosition = false;
        private bool _isFullCircleComplete = false; //Флаг, что прошел полный оборот
        private void TTransform_Changed(object sender, EventArgs e)
        {
            if (_isNotStartedPosition)
            {
                double angle = GetAngle();
                if (angle < 0)
                    angle = 180 + (180 + angle);
                if (angle > 180)
                    _isPossibleStop = true;

                if (angle > 90 && angle < 180 && _isPossibleStop && !_isFullCircleComplete)
                {
                    _isFullCircleComplete = true;
                    _multiplier = 2;
                }
                if (angle > 180 && _isFullCircleComplete)
                {
                    _isNotStoppedCircle = true;
                    var currentAnimation = _listAnimations[_indexCurrentAnimation];
                    currentAnimation.Pause();
                    CheckStopEndNextCircle();
                }
            }
            else
                _isNotStartedPosition = true;
        }
        
        private void CheckStopEndNextCircle()
        {
            if (_isPossibleStop)
            {
                _isComplete = true;//Завершаем вычисление текущей скорости(по сути дабы не отправлять команду на пульт выставляем этот флаг в false 
                                   //и события не будут приходить в контрол, а пульт будет активен и на следующем круге стартует на той же скорости, 
                                   //если не останавливали движение)
                UnSubscribeChangeTranslateTransform();
                _ListTimeSpeeds.Add(DateTime.Now - _startTimeSpeed.Value);

                if (Mode != TestMode.Manual)
                {
                    CalculateResult();
                    _transitionBetweenCirclesTimer.Start();
                    IsCompleteTimeoutTimerTransitionCircle = false;
                }
            }
        }
       
        private void NextCircleOrReturnResult()
        {
            _indexCurrentAnimation++;
            if (_indexCurrentAnimation > 2)
                ReturnResult();
            else
            {
                SubscribeChangeTranslateTransform(
                    elPaths[_indexCurrentAnimation],
                    elMoves[_indexCurrentAnimation],
                    elStatics[_indexCurrentAnimation]);
                IsCompleteTimeoutTimerTransitionCircle = true;
                _isComplete = false;
            }
        }

        private double GetAngle()
        {
            var p = GetPoint(_currentElMove, _currentTransform);
            var x = p.X - (Canva.Width / 2) - (_currentElStatic.Width / 2);
            var y = p.Y - (Canva.Height / 2) - (_currentElStatic.Height / 2);
            Vector v = new Vector(1, 0);
            Vector vNew = new Vector(x, y);
            var angle = Vector.AngleBetween(v, vNew);
            return angle;
        }
        
        private void CalculateResult()
        {
            var timeCircle = DateTime.Now - _startTime;

            ChangeSpeedAndAngle change = _listSpeeds[0];
           
            for (int i = 1; i < _listSpeeds.Count; i++)
            {
                if (_listSpeeds[i - 1].Speed <= _listSpeeds[i].Speed)
                    change = _listSpeeds[i];
            }

            var xMove = _currentTransform.Value.OffsetX + Canvas.GetLeft(_currentElMove);//получаем местоположение эллипса
            var yMove = _currentTransform.Value.OffsetY + Canvas.GetTop(_currentElMove);
            var xStatic = Canvas.GetLeft(_currentElStatic);
            var yStatic = Canvas.GetTop(_currentElStatic);

            var distance = Math.Sqrt(Math.Pow(xMove - xStatic, 2) + Math.Pow(yMove - yStatic, 2));//вычисляем расстояние между эллипсами, по левому верхнему углу контейнеров эллипсов
            
            var vectorAngle = (Vector.AngleBetween(new Vector(xMove - Canvas.GetLeft(elPaths[_indexCurrentAnimation]) - (elPaths[_indexCurrentAnimation].Width / 2),
                                                yMove - Canvas.GetTop(elPaths[_indexCurrentAnimation]) - (elPaths[_indexCurrentAnimation].Height / 2)),
                                     new Vector(xStatic - Canvas.GetLeft(elPaths[_indexCurrentAnimation]) - (elPaths[_indexCurrentAnimation].Width / 2),
                                     yStatic - Canvas.GetTop(elPaths[_indexCurrentAnimation]) - (elPaths[_indexCurrentAnimation].Height / 2))));
            
            if (vectorAngle < 0)
            {
                vectorAngle = 360 + vectorAngle;
            }
            var angle = GetAngle();
            if (angle > 90)
                vectorAngle = 360 - vectorAngle;
            var vectorDistance = (((Math.PI * (elPaths[_indexCurrentAnimation].Width / 2)) / 180) * vectorAngle);

            if (change.Angle <= 360)
                angle = 360 - change.Angle;
            else
            {
                angle = change.Angle - 360;
                _isStartDeceletationAfterFullCircle = true; //торможение после полного круга
            }
            var deceleration = (Math.PI * (elPaths[_indexCurrentAnimation].Width / 2) * (angle)) / 180;//расстояние между началом торможения и красной точкой(эллипсом)


            var timeDeceleration = DateTime.Now - _startTimeDeceleration;//Время торможения
            Debug.WriteLine($"Time deceleration: {timeDeceleration}");

            int speed = GetSpeed();
            bool _isNotFullCircle = false;
            var acceletationDeceleration = (_maxCoefSpeed * speed) / timeDeceleration.TotalSeconds;
            var averageSpeed = _listSpeeds.Average(a=>a.Speed);
            int points = 0;
            bool _isNotPossibleCircle = false;
            _isNotFullCircle = CheckNotPossibleCircle(vectorAngle);
            if (_indexCurrentAnimation == 0 && (averageSpeed < 60 || vectorDistance > 15 && _isNotFullCircle))
            {
                if (averageSpeed < 60 && vectorDistance > 15 && _isNotFullCircle)
                {
                    ShowMessage("Вы не выполняете инструкцию по скорости и точности");
                    _isNotPossibleCircle = true;
                }
                else if (averageSpeed < 60)
                {
                    ShowMessage("Вы не выполняете инструкцию по скорости движения");
                    _isNotPossibleCircle = true;
                }
                else if (vectorDistance > 15 && _isNotFullCircle)
                {
                    ShowMessage("Вы не выполняете инструкцию по точности остановки");
                    _isNotPossibleCircle = true;
                }

            }
            else if (_indexCurrentAnimation == 1 && (averageSpeed < 90 || vectorDistance > 18 && _isNotFullCircle))
            {
                if (averageSpeed < 9 && vectorDistance > 1.8 && _isNotFullCircle)
                {
                    ShowMessage("Вы не выполняете инструкцию по скорости и точности");
                    _isNotPossibleCircle = true;
                }
                else if (averageSpeed < 90)
                {
                    ShowMessage("Вы не выполняете инструкцию по скорости движения");
                    _isNotPossibleCircle = true;
                }
                else if (vectorDistance > 18 && _isNotFullCircle)
                {
                    ShowMessage("Вы не выполняете инструкцию по точности остановки");
                    _isNotPossibleCircle = true;
                }
            }
            else if (_indexCurrentAnimation == 2 && (averageSpeed < 110 || vectorDistance > 20 && _isNotFullCircle))
            {
                if (averageSpeed < 110 && vectorDistance > 20 && _isNotFullCircle)
                {
                    ShowMessage("Вы не выполняете инструкцию по скорости и точности");
                    _isNotPossibleCircle = true;
                }
                else if (averageSpeed < 110)
                {
                    ShowMessage("Вы не выполняете инструкцию по скорости движения");
                    _isNotPossibleCircle = true;
                }
                else if (vectorDistance > 20 && _isNotFullCircle)
                {
                    ShowMessage("Вы не выполняете инструкцию по точности остановки");
                    _isNotPossibleCircle = true;
                }
            }

            if (!_isNotPossibleCircle)
            {
                if (_isNotStoppedCircle || _isStartDeceletationAfterFullCircle)
                {
                    points = points + 1;
                }
                else
                {
                    if (_indexCurrentAnimation == 0 && (averageSpeed >= 75 && Math.Abs(deceleration) <= 17))
                    {
                        points = points + 1;
                    }
                    else if (_indexCurrentAnimation == 1 && (averageSpeed >= 125 && Math.Abs(deceleration) <= 18))
                    {
                        points = points + 1;
                    }
                    else if (_indexCurrentAnimation == 2 && (averageSpeed >= 170 && Math.Abs(deceleration) <= 18))
                    {
                        points = points + 1;
                    }
                }
            }
            if (!IsStudyQuest)
                SetResult(timeCircle, vectorDistance, deceleration, timeDeceleration, acceletationDeceleration, points, _isNotPossibleCircle);
            else WaitingZeroState = true;
        }

        private bool CheckNotPossibleCircle(double vectorAngle)
        {
            bool _isNotPossibleCircle = false;
            if (!_isFullCircleComplete)
                _isNotPossibleCircle = true;
            return _isNotPossibleCircle;
        }

        private bool waitingZeroState;
        public bool WaitingZeroState//Ожидание перевода в ноль
        {
            get { return waitingZeroState; }
            set
            {
                waitingZeroState = value;
                if (!waitingZeroState)
                    _startTime = DateTime.Now;
            }
        }

        private void SetResult(TimeSpan timeCircle, double distance, double deceleration, TimeSpan timeDeceleration, double acceletationDeceleration, int points, bool isNotPossibleCircle)
        {
            WaitingZeroState = true;
            double lastValue = _listSpeeds[0].Speed;
            int downUp = 0;
            int prevValueDownUp = 0;
            int maxPeaks = 0;
            for (int i = 1; i < _listSpeeds.Count; i++)
            {
                var currentValue = _listSpeeds[i].Speed;
                if (lastValue <= currentValue)
                {
                    prevValueDownUp = downUp;
                    downUp = 1;
                }
                else
                {
                    prevValueDownUp = downUp;
                    downUp = 0;
                }
                if (downUp > prevValueDownUp)
                    maxPeaks++;
                lastValue = currentValue;
            }


            RegisteredResults.Add(new Dictionary<string, object>()
            {
                ["Время прохождения круга"] = (float)timeCircle.TotalSeconds,
                ["Средняя скорость движения по кругу"] = (float)_listSpeeds.Average(a=>a.Speed) / 10,
                ["Ускорение торможения"] = (float)acceletationDeceleration / 10,
                ["Расстояние до финиша"] = (float)deceleration / 10,
                ["Точность остановки на месте старта"] = (float)distance / 10,
                ["Время торможения"] = (float)timeDeceleration.TotalSeconds,
                ["Число пиков максимума скорости"] = maxPeaks,
                ["Количество баллов"] = points,
                ["Недостоверный круг"] = isNotPossibleCircle,
                ["Номер задания"] = NumberQuest,
                ["Номер круга в задании"] = _indexCurrentAnimation + 1,
            });
            _listSpeeds.Clear();
            _multiplier = 1;
        }

        private int GetSpeed()
        {
            int speed = 0;
            if (_indexCurrentAnimation == 0)
                speed = 100;
            else if (_indexCurrentAnimation == 1)
                speed = 150;
            else if (_indexCurrentAnimation == 2)
                speed = 200;
            return speed;
        }

        private void UnSubscribeChangeTranslateTransform()
        {
            if (_currentTransform != null)
            {
                _currentTransform.Changed -= TTransform_Changed;

            }
        }

        private Point GetPoint(Ellipse elMove,TranslateTransform translateTransform)
        {
            var x = translateTransform.Value.OffsetX + elMove.Width/2;
            var y = translateTransform.Value.OffsetY + elMove.Height/2;
            return new Point(x, y);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="elMove">Передвигаемы объект по пути</param>
        /// <param name="elPath"> Путь передвигаемого объекта</param>
        /// <param name="elMaxSpeed">Максимальная скорость передвигаемого объекта</param>
        private void CreateAnimation(Ellipse elMove, Ellipse elPath, double elMaxSpeed)
        {
            var elTime = TimeSpan.FromSeconds(((Math.PI * elPath.Width)) / (elMaxSpeed));
            var sb = CalculateAnimation(elMove, elPath, elTime);
            animationSeek(sb, TimeSpan.FromSeconds(elTime.TotalSeconds / 4));
            _listAnimations.Add(sb);
        }

        /// <summary>
        /// Сдвиг анимации по времени(запуск пауза сдвиг)
        /// </summary>
        /// <param name="animation"></param>
        /// <param name="offset"></param>
        private void animationSeek(Storyboard animation, TimeSpan offset)
        {
            animation.Begin();
            animation.Pause();
            animation.Seek(offset);
        }

        /// <summary>
        /// Создаёт эллиптическую анимацию анимацию(по кругу или по эллипсу)
        /// </summary>
        /// <param name="elMove">Передвигаемый объект</param>
        /// <param name="elPath">Объект для передвижения(путь)</param>
        /// <param name="time">Время полной анимации</param>
        /// <returns></returns>
        private Storyboard CalculateAnimation(Ellipse elMove, Ellipse elPath, Duration time)
        {
            elMove.RenderTransformOrigin = new System.Windows.Point(0.5, 0.5);
            TransformGroup tg = new TransformGroup();
            tg.Children.Add(new ScaleTransform());
            tg.Children.Add(new SkewTransform());
            tg.Children.Add(new RotateTransform());
            tg.Children.Add(new TranslateTransform());
            elMove.RenderTransform = tg;

            PathGeometry pG = new PathGeometry();

            Geometry gm = elPath.RenderedGeometry.GetFlattenedPathGeometry();
            pG.Transform = new TranslateTransform((Canva.Width - elPath.Width) / 2, (Canva.Height - elPath.Height) / 2);
            pG.AddGeometry(gm);

            DoubleAnimationUsingPath DAUPX = new DoubleAnimationUsingPath
            {
                PathGeometry = pG,
                Duration = time,
                Source = PathAnimationSource.X
            };
            Storyboard.SetTarget(DAUPX, elMove);
            Storyboard.SetTargetProperty(DAUPX,
                new PropertyPath("(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)"));

            DoubleAnimationUsingPath DAUPY = new DoubleAnimationUsingPath
            {
                PathGeometry = pG,
                Duration = time,
                Source = PathAnimationSource.Y
            };
            Storyboard.SetTarget(DAUPY, elMove);
            Storyboard.SetTargetProperty(DAUPY,
                new PropertyPath("(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"));
            Storyboard _animation = new Storyboard
            {
                RepeatBehavior = RepeatBehavior.Forever,
                Children = new TimelineCollection() { DAUPX, DAUPY }
            };
            //_animation.SetValue(Timeline.DesiredFrameRateProperty, 60);
            return _animation;
        }

        
        /// <summary>
        /// Генерит путь(Создает эллипс с высотой и шириной выбирая рандомом из списка диаметров)
        /// </summary>
        /// <param name="elDiameters">Список диаметров эллипсов</param>
        /// <returns></returns>
        private Ellipse generatePathEllipse(List<double> elDiameters)
        {
            var sizeEl = generateSizeEllipse(elDiameters);
            var el = new Ellipse();

            el.Width = sizeEl.Width;
            el.Height = sizeEl.Height;
            el.Stroke = Brushes.White;
            el.StrokeThickness = 0.3;
            el.SetValue(Canvas.LeftProperty, (Canva.Width - el.Width) / 2);
            el.SetValue(Canvas.TopProperty, (Canva.Height - el.Height) / 2);
            Canva.Children.Add(el);
            return el;
        }

        private Size generateSizeEllipse(List<double> listDiameters)
        {
            var sizeParameter = rnd.Next(0, listDiameters.Count);
            return new Size(listDiameters[sizeParameter], listDiameters[sizeParameter]);
        }
    }
    public class ChangeSpeedAndAngle
    {
        public double Speed { get; private set; }
        public double Angle { get; private set; }
        public ChangeSpeedAndAngle(double speed, double angle)
        {
            Speed = speed;
            Angle = angle;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AssessmentOfPropensityToTakeRisks\AssessmentOfPropensityToTakeRisksViewModel.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.AssessmentOfPropensityToTakeRisks
{
    public class AssessmentOfPropensityToTakeRisksViewModel : TestBase
    {
        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                OnPropertyChanged();
            }
        }

        public override event EventHandler<Results> Results;

        private Pult.PultResistors Resistors;
        private AssessmentOfPropensityToTakeRisksControl control;

        private bool _leftRightResistor = false;
        private bool _isSelectedresistor = false;
        private bool _isMessageShowed = false;
        private bool _isResistorsDefaultPosition = false;

        public AssessmentOfPropensityToTakeRisksViewModel(EnumTests testType, PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            Manager.TraningTime = new TimeSpan(0, 0, 50);
            SetInstructions("AssessmentOfPropensityToTakeRisks");
            TestType = testType;
        }

        public override FrameworkElement GetTestControl()
        {
            return new AssessmentOfPropensityToTakeRisksControl(LearningTasksExtension.TestMode.Manual);
        }

        public override void TestManual()
        {
            control = new AssessmentOfPropensityToTakeRisksControl(LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            _isSelectedresistor = false;
            _isMessageShowed = false;
            _isResistorsDefaultPosition = false;
            _leftRightResistor = false;
            Resistors = Pult as PultResistors;
            Resistors.UpdateInterval = TimeSpan.FromMilliseconds(20);
            Resistors.NotifyOnChange = false;
            Resistors.ResistorsValuesChanged += Resistors_ResistorsValuesChanged;
            Resistors.Disconnected += Resistors_Disconnected;
            Resistors.Start();
            CreateControl(countResultsControl + 1, true);
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Resistors_Disconnected(object sender, Pult.DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        public override void ToDefault()
        {
            base.ToDefault();
            countResultsControl = 0;
        }

        public override void Start()
        {
            _isSelectedresistor = false;
            _isMessageShowed = false;
            _isResistorsDefaultPosition = false;
            _leftRightResistor = false;
            Resistors = Pult as PultResistors;
            Resistors.UpdateInterval = TimeSpan.FromMilliseconds(20);
            Resistors.NotifyOnChange = false;
            Resistors.ResistorsValuesChanged += Resistors_ResistorsValuesChanged;
            Resistors.Disconnected += Resistors_Disconnected;
            Resistors.Start();
            CreateControl(countResultsControl + 1);
        }

        private void CreateControl(int numberQuest, bool isTestStart = false)
        {
            Debug.WriteLine($"Control_Results_TestStart {isTestStart}");
            _isLoadedControl = false;
            control = new AssessmentOfPropensityToTakeRisksControl();
            control.IsStudyQuest = isTestStart;
            control.NumberQuest = numberQuest;
            control.Loaded += Control_Loaded;
            TestCurrentView = control;
            if (!isTestStart)
                control.Results += Control_Results;
            else
                control.Results += Control_Results_TestStart;
            control.WaitingZeroState = true;
        }
        private void Control_Results_TestStart(object sender, List<Dictionary<string, object>> e)
        {
            UnsubscribeControl();
            CreateControl(countResultsControl + 1, true);

        }

        private bool _isLoadedControl = false;
        private int countResultsControl = 0;
        private void Control_Loaded(object sender, RoutedEventArgs e)
        {
            if (!_isLoadedControl)
            {
                control.Loaded -= Control_Loaded;
                control.Start();
                _isLoadedControl = true;
            }
        }

        private void UnsubscribeControl()
        {
            control.Results -= Control_Results_TestStart;
            control.Results -= Control_Results;
            control.Loaded -= Control_Loaded;
        }

        private List<List<Dictionary<string, object>>> RegisteredResults = new List<List<Dictionary<string, object>>>();
        private void Control_Results(object sender, List<Dictionary<string, object>> e)
        {
            countResultsControl++;
            RegisteredResults.Add(e);
            if (countResultsControl != 3)
            {
                UnsubscribeControl();
                CreateControl(countResultsControl + 1);
            }
            else
            {
                UnsubscribeControl();
                int numberCircle = 0;
                int notPossibleCircles = 0;
                int points = 0;
                List<float> timesCircles = new List<float>();//Время прохождения кругов
                List<float> averageTimes = new List<float>();
                List<float> accelerationDecelerations = new List<float>();
                List<float> toFinishDistantions = new List<float>();
                List<float> accuracyStopAtStarts = new List<float>();
                List<float> timesDecelerations = new List<float>();
                List<int> numbersPeaksMaxSpeeds = new List<int>();
                foreach (var res in RegisteredResults)
                {
                    numberCircle++;
                    foreach (var curRes in res)
                    {
                        var curPoints = curRes.FirstOrDefault(f => f.Key == "Количество баллов").Value;
                        var notPossibleCircle = Convert.ToBoolean(curRes.FirstOrDefault(f => f.Key == "Недостоверный круг").Value);
                        if (notPossibleCircle)
                            notPossibleCircles = notPossibleCircles + 1;
                        points = points + Convert.ToInt32(curPoints);

                        timesCircles.Add((float)curRes.FirstOrDefault(f => f.Key == "Время прохождения круга").Value);
                        averageTimes.Add((float)curRes.FirstOrDefault(f => f.Key == "Средняя скорость движения по кругу").Value);
                        accelerationDecelerations.Add((float)curRes.FirstOrDefault(f => f.Key == "Ускорение торможения").Value);
                        toFinishDistantions.Add((float)curRes.FirstOrDefault(f => f.Key == "Расстояние до финиша").Value);
                        accuracyStopAtStarts.Add((float)curRes.FirstOrDefault(f => f.Key == "Точность остановки на месте старта").Value);
                        timesDecelerations.Add((float)curRes.FirstOrDefault(f => f.Key == "Время торможения").Value);
                        numbersPeaksMaxSpeeds.Add((int)curRes.FirstOrDefault(f => f.Key == "Число пиков максимума скорости").Value);
                    }
                }


                Results?.Invoke(this, new Results(new Dictionary<string, object>()
                {
                    ["Количество баллов"] = points,
                    ["Количество недостоверных кругов"] = notPossibleCircles,
                    ["Время прохождения круга"] = timesCircles.ToArray(),
                    ["Средняя скорость движения по кругу"] = averageTimes.ToArray(),
                    ["Ускорение торможения"] = accelerationDecelerations.ToArray(),
                    ["Расстояние до финиша"] = toFinishDistantions.ToArray(),
                    ["Точность остановки на месте старта"] = accuracyStopAtStarts.ToArray(),
                    ["Время торможения"] = timesDecelerations.ToArray(),
                    ["Число пиков максимума скорости"] = numbersPeaksMaxSpeeds.ToArray()
                    //["Круги"] = RegisteredResults
                }));
            }
        }

        private void Resistors_ResistorsValuesChanged(object sender, Pult.ResistorsValueChangedEventArgs e)
        {
            if (!_isSelectedresistor)
            {
#if DEBUG
                Debug.WriteLine($"L-{e.Values[0]} R-{e.Values[1]}");
#endif
                if (e.Values[0] >= 5 || e.Values[1] >= 5)
                {
                    if (!_isMessageShowed)
                    {
                        Message = "Установите ручки в положение 0";
                        _isMessageShowed = true;
                    }
                    else if (_isMessageShowed && _isResistorsDefaultPosition && (e.Values[0] != 0 || e.Values[1] != 0))
                    {
                        if (e.Values[0] > 0)
                            _leftRightResistor = false;
                        else
                            _leftRightResistor = true;
                        _isSelectedresistor = true;
                        onePercentDevice = maxValue / 100.0;
                        controlOnePercent = 1 / 100.0;
                    }
                }
                else
                {
                    _isResistorsDefaultPosition = true;
                    _isMessageShowed = true;
                    Message = null;
                }
            }

            if (control.WaitingZeroState)
            {
                if (e.Values[0] == 0 && e.Values[1] == 0 && control.IsCompleteTimeoutTimerTransitionCircle)
                    control.WaitingZeroState = false;
            }

            if (_isSelectedresistor)
            {
                var value = !_leftRightResistor ? e.Values[0] : e.Values[1];
                if (control != null && !control.IsCompletedControl)
                    control.ChangeAcceleration(GetAdaptativeValue(value));
            }
        }
        private double onePercentDevice;
        private double controlOnePercent;
        private double maxValue = 255;
        private double GetAdaptativeValue(int value)
        {
            if (value < 5)
                value = 0;
            var percentValueInDevide = value / onePercentDevice;
            return percentValueInDevide * controlOnePercent;
        }

        public override void Stop()
        {
            base.Stop();
            if (control != null)
            {
                control?.Stop();
                UnsubscribeControl();
            }
            if (Resistors != null)
            {
                Resistors.ResistorsValuesChanged -= Resistors_ResistorsValuesChanged;
                Resistors.Disconnected -= Resistors_Disconnected;
                Resistors?.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AssessmentOfPropensityToTakeRisks\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.AssessmentOfPropensityToTakeRisks"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Converters"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:AssessmentOfPropensityToTakeRisksControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AssessmentOfPropensityToTakeRisksControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920" Height="1080">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition Width="3*"/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <ContentControl
                                        Grid.ColumnSpan="3"
                                        Focusable="False"
                                                    Margin="5"
                                                    Content="{Binding ViewboxForCanvas,
                                        RelativeSource={RelativeSource FindAncestor,
                                        AncestorType={x:Type local:AssessmentOfPropensityToTakeRisksControl}}}"/>
                                    <TextBlock
                                        Grid.ColumnSpan="3"
                                        HorizontalAlignment="Center"
                                        Foreground="White"
                                        VerticalAlignment="Center"
                                        TextAlignment="Center"
                                        FontSize="32"
                                        Text="{TemplateBinding NumberTest}"/>
                                    
                                    <tests:MessageBoxControl Grid.ColumnSpan="3"
                                                             VerticalAlignment="Center"
                                                             HorizontalAlignment="Center"
                                        Message="{Binding Message,
                                        RelativeSource={RelativeSource FindAncestor,
                                        AncestorType={x:Type local:AssessmentOfPropensityToTakeRisksControl}}}" />
                                    
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                        RelativeSource={RelativeSource AncestorType={x:Type local:AssessmentOfPropensityToTakeRisksControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                    
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:AssessmentOfPropensityToTakeRisksViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AssessmentOfPropensityToTakeRisksViewModel">
                    <ContentControl>
                        <Grid Background="{DynamicResource Default.Background.Dark}">
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <tests:MessageBoxControl
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Message="{Binding Message,
                                          RelativeSource={RelativeSource FindAncestor,
                                          AncestorType={x:Type local:AssessmentOfPropensityToTakeRisksViewModel}}}" />
                            <ContentPresenter Content="{Binding ContinueViewModel, 
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:AssessmentOfPropensityToTakeRisksViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AttentionDistribution\AttentionDistributionControl.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.AttentionDistribution
{
    public class AttentionDistributionControl:NotifyViewModelBase, ILearning, IDisposable
    {
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler FirstComplete;
        public event EventHandler<bool> ResetTimer;

        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (isShowErrorMessages)
                {
                    if (_message != "")
                    {
                        _timer.Stop();
                        _messageTimer.Start();
                    }
                    OnPropertyChanged();
                }
            }
        }

        private object _figure1;
        public object Figure1
        {
            get { return _figure1; }
            set
            {
                _figure1 = value;
                OnPropertyChanged();
            }
        }

        private object _figure2;
        public object Figure2
        {
            get { return _figure2; }
            set
            {
                _figure2 = value;
                OnPropertyChanged();
            }
        }
        
        DispatcherTimer _messageTimer = new DispatcherTimer();
        private List<FiguresPair> figuresPairs;
        public List<FiguresPair> FiguresPairs
        {
            get { return figuresPairs; }
            set
            {
                figuresPairs = value;
                OnPropertyChanged();
            }

        }
        private List<NumberSoundPair> numberSoundPairs;
        public List<NumberSoundPair> NumberSoundPairs
        {
            get { return numberSoundPairs; }
            set
            {
                numberSoundPairs = value;
                OnPropertyChanged();
            }
        }

        private int _currentTime;
        public int CurrentTime
        {
            get { return _currentTime; }
            set
            {
                _currentTime = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        DispatcherTimer _timer = new DispatcherTimer();
        DispatcherTimer _timeOutTimer = new DispatcherTimer();
        DispatcherTimer _timeOutSoundTimer = new DispatcherTimer();

        NumberSoundsPresenter nsPresenter = new NumberSoundsPresenter();
        int timeOutSeconds = 3;
        Random rnd = new Random();
        private bool isShowErrorMessages = false;
        private Series _serie;
        private int _currentSoundPairIndex = 0;
        public AttentionDistributionControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            Initialize();
        }
        private void Initialize()
        {
            _timer.Interval = TimeSpan.FromMilliseconds(500);
            _timer.Tick += _timer_Tick;
            _timeOutTimer.Interval = new TimeSpan(0, 0, 1);
            _timeOutTimer.Tick += _timeOutTimer_Tick;
            TestMethods.Add("StartPart1", () => StartPart1());
            TestMethods.Add("StartPart2", () => StartPart2());
            TestMethods.Add("_timer_Tick__Interval_500ms", () => _timer_Tick(this, new EventArgs()));
        }

        private void StartPart1()
        {
            ManualGenerateFiguresPart1();
            _serie = Series.One;
        }

        private void StartPart2()
        {
            ManualGenerateFiguresPart2();
            ManualGenerateSoundPairs();
            _serie = Series.Two;
        }

        private void ManualGenerateFiguresPart1()
        {
            FiguresPairs = new List<FiguresPair>();
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rhombus, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rectangle, FiguresEnum.Hexagon));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Hexagon, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Cylinder, FiguresEnum.Hexagon));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rhombus, FiguresEnum.Rhombus));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rhombus, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rectangle, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Hexagon, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Cylinder, FiguresEnum.Hexagon));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rhombus, FiguresEnum.Rectangle));
        }

        private void ManualGenerateFiguresPart2()
        {
            FiguresPairs = new List<FiguresPair>();
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rhombus, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rectangle, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Hexagon, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Cylinder, FiguresEnum.Hexagon));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rhombus, FiguresEnum.Rhombus));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rhombus, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rectangle, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Hexagon, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Cylinder, FiguresEnum.Hexagon));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rhombus, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rhombus, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rectangle, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Hexagon, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Cylinder, FiguresEnum.Hexagon));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rhombus, FiguresEnum.Rhombus));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rhombus, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rectangle, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Hexagon, FiguresEnum.Rectangle));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Cylinder, FiguresEnum.Hexagon));
            FiguresPairs.Add(new FiguresPair(FiguresEnum.Rhombus, FiguresEnum.Rectangle));
        }

        private void ManualGenerateSoundPairs()
        {
            NumberSoundPairs = new List<NumberSoundPair>();
            NumberSoundPairs.Add(new NumberSoundPair(1, 2) { TimePresent = 1 });
        }

        /// <summary>
        /// if this is true, sound stimulus playback is activated
        /// </summary>
        /// <param name="isSecondaryPartQuest"></param>
        public void Start(bool isSecondaryPartQuest = false, bool isTestStart = false)
        {
            isShowErrorMessages = isTestStart;
            if (isShowErrorMessages)
            {
                _messageTimer.Interval = TimeSpan.FromSeconds(1.8);
                _messageTimer.Tick += _messageTimer_Tick;
            }
           
            if (!isSecondaryPartQuest)
            {
                _serie = Series.One;
            }
            else
                _serie = Series.Two;

            if (_serie == Series.One)
            {
                if (Mode != TestMode.Manual)
                {
                    generatePairs();
                    _timer.Start();
                }
            }
            else if (_serie == Series.Two)
            {
                ActivatingSecondaryPartQuest();
                _timeOutSoundTimer.Interval = TimeSpan.FromSeconds(timeOutSeconds);
                _timeOutSoundTimer.Tick += _timeOutSoundTimer_Tick;
            }
        }

        

        private bool _isExistReactionSameSound = false; //Реагировал ли на одинаковые звуки
       
        private void _timeOutSoundTimer_Tick(object sender, EventArgs e)
        {
            _timeOutSoundTimer.Stop();
            if (!_isExistReactionSameSound && NumberSoundPairs[_currentSoundPairIndex].Number1 == NumberSoundPairs[_currentSoundPairIndex].Number2)
            {
                _countPassesSounds++;
            }
            if (_currentSoundPairIndex < NumberSoundPairs.Count - 1)
                _currentSoundPairIndex++;
        }

        private void _timeOutTimer_Tick(object sender, EventArgs e)
        {
            Message = "Вы не отреагировали на одинаковые фигуры!";

            _timeOutTimer.Stop();

            if (_serie == Series.One)
                _countPassesSerie1++;
            else if (_serie == Series.Two)
                _countPassesSerie2++;
            
            _isSameFigures = false;
        }

        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _messageTimer.Stop();
            if (Mode != TestMode.Manual)
                _timer.Start();
        }

        public void Stop()
        {
            _timeOutSoundTimer.Stop();
            _timeOutTimer.Stop();
            _timer.Stop();
        }

        #region generate
        public void generatePairs(bool isTwoSeries = false)
        {
            if (figuresPairs != null)
                FiguresPairs.Clear();
            var currentFiguresPairs = new List<FiguresPair>();
            for (int i = 0; i < 180; i++)
            {
                var leftFigure = rnd.Next(0, 10);
                int rightFigure = 0;
                while (true)
                {
                    rightFigure = rnd.Next(0, 10);
                    if (leftFigure != rightFigure)
                        break;
                }
                var pair = new FiguresPair((FiguresEnum)leftFigure, (FiguresEnum)rightFigure);
                currentFiguresPairs.Add(pair);
            }

            var indexes = new List<int>();
            try
            {
                for (int i = 0; i < 20; i++)
                {
                    while (true)
                    {
                        var index = rnd.Next(0, currentFiguresPairs.Count);
                        if (!indexes.Any(a => a == index) && index > 2)
                        {
                            if (index - 1 >= 0 && index + 1 < currentFiguresPairs.Count)
                            {
                                if (!currentFiguresPairs[index - 1].IsSame() && !currentFiguresPairs[index + 1].IsSame())
                                {
                                    if (index - 2 >= 0 && index + 2 < currentFiguresPairs.Count)
                                    {
                                        if (!currentFiguresPairs[index - 2].IsSame() && !currentFiguresPairs[index + 2].IsSame())
                                        {
                                            AddSameFigures(currentFiguresPairs, indexes, index);
                                            break;
                                        }
                                    }
                                    else if (index - 2 < 0 && index + 2 < currentFiguresPairs.Count)
                                    {
                                        if (!currentFiguresPairs[index + 2].IsSame())
                                        {
                                            AddSameFigures(currentFiguresPairs, indexes, index);
                                            break;
                                        }
                                    }
                                    else if (index - 2 >= 0 && index + 2 > currentFiguresPairs.Count)
                                    {
                                        if (!currentFiguresPairs[index - 2].IsSame())
                                        {
                                            AddSameFigures(currentFiguresPairs, indexes, index);
                                            break;
                                        }
                                    }
                                }
                            }
                            else if (index - 1 < 0 && index + 1 < currentFiguresPairs.Count)
                            {
                                if (!currentFiguresPairs[index + 1].IsSame())
                                {
                                    AddSameFigures(currentFiguresPairs, indexes, index);
                                    break;
                                }
                            }
                            else if (index - 1 >= 0 && index + 1 > currentFiguresPairs.Count)
                            {
                                if (!currentFiguresPairs[index - 1].IsSame())
                                {
                                    AddSameFigures(currentFiguresPairs, indexes, index);
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
            }

            FiguresPairs = currentFiguresPairs;
            if (isTwoSeries)
            {
                List<NumberSoundPair> soundPairs = GenerateSoundPairs();
                NumberSoundPairs = Desynchronize(soundPairs);
            }
        }

        private void AddSameFigures(List<FiguresPair> fuguresPairs, List<int> indexes, int index)
        {
            var figure = rnd.Next(0, 10);
            var curPair = fuguresPairs[index];
            curPair.Figure1 = (FiguresEnum)figure;
            curPair.Figure2 = (FiguresEnum)figure;
            indexes.Add(index);
        }

        private int delta = 0;
        /// <summary>
        /// Рассинхронизация звуков и одинаковых пар фигур по времени
        /// </summary>
        private List<NumberSoundPair> Desynchronize(List<NumberSoundPair> soundPairs)
        {
            var sames = FindAllSames();
            var intervals = GetBetweenSameIntervals(sames);
            int soundIndex = 0;
            while (soundIndex < soundPairs.Count)
            {
                for (int j = 0; j < intervals.Count; j++)
                {
                    var soundPair = soundPairs[soundIndex];
                    soundPair.TimePresent = intervals[j].From + delta;
                    intervals[j].From = intervals[j].From + timeOutSeconds + delta;
                    soundIndex++;
                    if (soundIndex >= soundPairs.Count)
                        break;
                }
                intervals = intervals.Where(w => (w.To - w.From) > timeOutSeconds + delta).OrderBy(o => o.From).ToList();
            }
            soundPairs = soundPairs.OrderBy(o => o.TimePresent).ToList();
            return soundPairs;
        }

        public List<IntervalBetweenSame> GetBetweenSameIntervals(List<int> sameIndexes)
        {
            var res = new List<IntervalBetweenSame>();
            int oldIndex = 3;
            for (int i = 0; i < sameIndexes.Count; i++)
            {
                if (((sameIndexes[i] - 1) - (oldIndex + 1)) > timeOutSeconds)
                    res.Add(new IntervalBetweenSame()
                    {
                        From = oldIndex + 1,
                        To = sameIndexes[i] - 1
                    });

                oldIndex = sameIndexes[i];
            }

            if (((180 - 1) - (oldIndex + 1)) > timeOutSeconds)
                res.Add(new IntervalBetweenSame()
                {
                    From = oldIndex + 1,
                    To = 180 - 1
                });

            res = res.Where(w => w.From < w.To).OrderBy(o => o.From).ToList();
            return res;
        }

        private List<int> FindAllSames()
        {
            var sames = new List<int>();
            for (int i = 0; i < FiguresPairs.Count; i++)
            {
                if (IsSame(FiguresPairs[i]))
                    sames.Add(i);
            }
            return sames;
        }

        private bool IsSame(FiguresPair pair)
        {
            if (pair.Figure1 == pair.Figure2)
                return true;
            return false;
        }
        
        private List<NumberSoundPair> GenerateSoundPairs()
        {
            var soundPairs = new List<NumberSoundPair>();
            TimeSpan oldTime = new TimeSpan(0, 0, 0);
            NumberSoundPair lastNotSameNumbersPair = null;
            for (int i = 0; i < 30; i++)
            {
                var sPair = generateNotSameNumberSoundsPair();
                if (lastNotSameNumbersPair == null)
                {
                    soundPairs.Add(sPair);
                    lastNotSameNumbersPair = sPair;
                    continue;
                }

                if (lastNotSameNumbersPair != null)
                {
                    if (lastNotSameNumbersPair.Number1 == sPair.Number1 && lastNotSameNumbersPair.Number2 == sPair.Number2)
                    {
                        while (lastNotSameNumbersPair.Number1 == sPair.Number1 && lastNotSameNumbersPair.Number2 == sPair.Number2)
                            sPair = generateNotSameNumberSoundsPair();
                    }
                    soundPairs.Add(sPair);
                    lastNotSameNumbersPair = sPair;
                    continue;
                }
            }

            int lastSameNumber = 0; 
            for (int i = 0; i < 12; i++)
            {
                var number = Common._rnd.Next(1, 10);
                if (lastSameNumber == 0)
                {
                    soundPairs[i].Number1 = number;
                    soundPairs[i].Number2 = number;
                    lastSameNumber = number;
                    continue;
                }

                if (lastSameNumber != 0)
                {
                    if (lastSameNumber == number)
                    {
                        while (lastSameNumber == number)
                            number = Common._rnd.Next(1, 10);
                    }
                    soundPairs[i].Number1 = number;
                    soundPairs[i].Number2 = number;
                    lastSameNumber = number;
                    continue;
                }
               
            }
            Common.Shuffle(soundPairs);
          
            return soundPairs;
        }

        /// <summary>
        /// Создает пары разных звуков
        /// </summary>
        /// <returns></returns>
        private NumberSoundPair generateNotSameNumberSoundsPair()
        {
            var number1 = Common._rnd.Next(1, 10);
            int number2 = 0;
            while (true)
            {
                number2 = Common._rnd.Next(1, 10);
                if (number2 != number1)
                    break;
            }
            return new NumberSoundPair(number1, number2);
        }
        #endregion


        bool _isShowingFigures = false;
        int _indexShowingPairFigures = -1;
        private void _timer_Tick(object sender, EventArgs e)
        {
            if (_isShowingFigures)
            {
                Figure1 = null;
                Figure2 = null;

                _isShowingFigures = false;
                Message = "";
            }
            else
            {
                Message = "";

                _indexShowingPairFigures++;

                if (_indexShowingPairFigures < FiguresPairs.Count)
                {
                    Figure1 = FiguresPairs[_indexShowingPairFigures].Figure1;
                    Figure2 = FiguresPairs[_indexShowingPairFigures].Figure2;
                    var same = Figure1.ToString() == Figure2.ToString();
                    if (same)
                        _isSameFigures = true;

                    if (_serie == Series.Two && NumberSoundPairs.FirstOrDefault(f => f.TimePresent == _indexShowingPairFigures) != null)
                    {
                        _isExistReactionSameSound = false;
                        nsPresenter.Start(NumberSoundPairs[_currentSoundPairIndex]);
                        if (Mode != TestMode.Manual)
                            _timeOutSoundTimer.Start();
                    }

                    if (_isSameFigures)
                    {
                        if (Mode != TestMode.Manual)
                        {
                            ResetTimer?.Invoke(this, true);
                            _timeOutTimer.Start();
                        }
                    }
                    _isShowingFigures = true;
                    CurrentTime = _indexShowingPairFigures;
                }
                else
                {

                    Stop();
                    if (_serie == Series.One)
                        FirstComplete?.Invoke(this, new EventArgs());
                    else
                    {
                        Stop();
                        if (Mode != TestMode.Manual)
                            ReturnResult();
                    }
                    // ActivatingSecondaryPartQuest();
                }
            }
        }

        private void ActivatingSecondaryPartQuest()
        {
            _timer.Stop();
            generatePairs(true);
            _indexShowingPairFigures = -1;
            if (Mode != TestMode.Manual)
                _timer.Start();
        }

        private void ReturnResult()
        {
            var CountNon_ReactSoundPairs = _countPassesSounds;
            var CountPressCorrect1 = _reactions1.Count;
            var CountPressCorrect2 = _reactions2.Count;
            var CountPressCorrectSounds = CountRightSoundAnswers;
            var average1 = (_reactions1.Count > 0 ? _reactions1.Sum() / _reactions1.Count : 0.0)/ 1000;
            var average2 = (_reactions2.Count > 0 ? _reactions2.Sum() / _reactions2.Count : 0.0)/ 1000;
            //var countIncorrectClicks = ShowErrors;//Количество неправильных нажатий на зрительные стимулы
            var countIncorrectClicksSounds = _countReactionsNoSameSounds;//Количество неправильных нажатий на слуховые стимулы
            var res = new Dictionary<string, object>()
            {
                ["Среднее время реагирования в задании №1"] = (float)average1,
                ["Количество правильных ответов на зрительные стимулы в задании №1"] = CountPressCorrect1,
                ["Разница средних времен реагирования между заданием №2 и заданием №1"] = (float)(average2 - average1),
                ["Количество правильных ответов на слуховые стимулы в задании №2"] = CountPressCorrectSounds,
                ["Разница количества правильных ответов на зрительные стимулы (№1 - №2)"] = CountPressCorrect1 - CountPressCorrect2,
                //["Количество ошибочных ответов на зрительные стимулы"] = countIncorrectClicks,
                ["Количество ошибочных ответов на слуховые стимулы"] = countIncorrectClicksSounds,
                ["Среднее время реагирования в задании №2 на зрительные стимулы"] = (float)average2,
                ["Количество правильных реагирований на зрительные стимулы в задании № 2"] = CountPressCorrect2,
                ["Количество реагирований при отсутствии сигнала в задании № 1 на зрительные стимулы"] = _countReactionsNoSameSerie1,
                ["Количество реагирований при отсутствии сигнала в задании № 2 на зрительные стимулы"] = _countReactionsNoSameSerie2
            };
            Results?.Invoke(this, res);
        }

        bool _isSameFigures = false;
        List<double> _reactions1 = new List<double>();
        List<double> _reactions2 = new List<double>();
        int _countReactionsNoSameSerie1 = 0;//Количество реагирований при отсутствии сигнала в 1-ой части задания(реагирование на неодинаковые фигуры или без фигур) 
        int _countReactionsNoSameSerie2 = 0;//Количество реагирований при отсутствии сигнала в 2-ой части задания(реагирование на неодинаковые фигуры или без фигур(любой кнопкой))
        int _countReactionsNoSameSounds = 0;//Количество реакций при разных звуках 
        int _countErrorPressWhiteButton = 0;//Количество пустых нажатий на белую кнопку
        int _countPassesSerie1 = 0;//Количество пропусков одинаковых фигур в 1-ой части задания
        int _countPassesSerie2 = 0;//Количество пропусков одинаковых фигур во 2-ой части задания
        int _countPassesSounds = 0;//Количество пропусков одинаковых пар звуков
        int CountRightSoundAnswers = 0;

        public void PressButton(Buttons button, int time)
        {
            var calculatedTime = TimeSpan.FromSeconds(time / 10000.0).TotalMilliseconds;
            if (button == Buttons.Blue)
            {
                if (_isSameFigures)
                {
                    _timeOutTimer.Stop();
                    if (_serie == Series.One)
                        _reactions1.Add(calculatedTime);
                    else if (_serie == Series.Two)
                        _reactions2.Add(calculatedTime);
                }
                else
                {
                    Message = "Фигуры не одинаковы!";
                    if (_serie == Series.One)
                        _countReactionsNoSameSerie1++;
                    else if (_serie == Series.Two)
                        _countReactionsNoSameSerie2++;
                }
            }
            else if (button == Buttons.White && _serie == Series.Two)
            {
                try
                {
                    if (NumberSoundPairs[_currentSoundPairIndex].Number1 != NumberSoundPairs[_currentSoundPairIndex].Number2)
                        _countReactionsNoSameSounds++;
                    else if (NumberSoundPairs[_currentSoundPairIndex].Number1 == NumberSoundPairs[_currentSoundPairIndex].Number2 && !_isExistReactionSameSound)
                    {
                        CountRightSoundAnswers++;
                        _isExistReactionSameSound = true;
                    }
                    else
                    {
                        _countErrorPressWhiteButton++;
                    }
                }
                catch (Exception ex)
                {
                    
                }
            }
            
            else if (button == Buttons.White && _serie == Series.One)
            {
                Message = "Вы нажали не на ту кнопку!";
            }
            _isSameFigures = false;
        }

        public void Dispose()
        {
            nsPresenter.Dispose();
        }
    }

    public class IntervalBetweenSame
    {
        public int From { get; set; }
        public int To { get; set; }
    }

    /// <summary>
    /// Задание
    /// </summary>
    public enum Series
    {
        One,
        Two
    }

    public enum Buttons
    {
        Blue,
        White
    }

    public class NumberSoundPair 
    {
        public int Number1 { get; set; }
        public int Number2 { get; set; }
        public int TimePresent { get; set; }
        public NumberSoundPair(int number1, int number2)
        {
            Number1 = number1;
            Number2 = number2;
        }
    }

    public class FiguresPair
    {
        public FiguresEnum Figure1 { get; set; }
        public FiguresEnum Figure2 { get; set; }
        public FiguresPair(FiguresEnum figure1, FiguresEnum figure2)
        {
            Figure1 = figure1;
            Figure2 = figure2;
        }

        public bool IsSame()
        {
            if (Figure1 == Figure2)
                return true;
            else return false;
        }
    }

    public enum FiguresEnum
    {
        Rhombus,
        Rectangle,
        Cylinder,
        Triangle,
        Square,
        Trapezoid,
        Circle,
        Star,
        Hexagon,
        Parallelogram
    }

    public class FigureTemplateSelector : DataTemplateSelector
    {
        public DataTemplate Rhombus { get; set; }
        public DataTemplate Rectangle { get; set; }
        public DataTemplate Cylinder { get; set; }
        public DataTemplate Triangle { get; set; }
        public DataTemplate Square { get; set; }
        public DataTemplate Trapezoid { get; set; }
        public DataTemplate Circle { get; set; }
        public DataTemplate Star { get; set; }
        public DataTemplate Hexagon { get; set; }
        public DataTemplate Parallelogram { get; set; }

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item != null)
            {
                switch ((FiguresEnum)item)
                {
                    case FiguresEnum.Rhombus:
                        return Rhombus;
                    case FiguresEnum.Rectangle:
                        return Rectangle;
                    case FiguresEnum.Cylinder:
                        return Cylinder;
                    case FiguresEnum.Triangle:
                        return Triangle;
                    case FiguresEnum.Square:
                        return Square;
                    case FiguresEnum.Trapezoid:
                        return Trapezoid;
                    case FiguresEnum.Circle:
                        return Circle;
                    case FiguresEnum.Star:
                        return Star;
                    case FiguresEnum.Hexagon:
                        return Hexagon;
                    case FiguresEnum.Parallelogram:
                        return Parallelogram;
                    default:
                        return null;
                }
            }
            else
            {
                return null;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AttentionDistribution\AttentionDistributionViewModel.cs

using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.AttentionDistribution
{
    public class AttentionDistributionViewModel : TestBase
    {
        public override event EventHandler<Results> Results;

        private int _numberInstruction;
        public int NumberInstruction
        {
            get { return _numberInstruction; }
            set
            {
                _numberInstruction = value;
                OnPropertyChanged();
            }
        }

        private PultButtons Buttons;
        public AttentionDistributionControl control;

        public AttentionDistributionViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("AttentionDistribution_1", 1);
            Manager.TraningTime = TimeSpan.FromSeconds(40);
            NumberInstruction = 1;
        }

        public override FrameworkElement GetTestControl()
        {
            return new AttentionDistributionControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new AttentionDistributionControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }
        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override void TestStart()
        {
            control = new AttentionDistributionControl();
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start(isTestStart: true);
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        public override void Start()
        {
            switch (NumberInstruction)
            {
                case 1:
                    control = new AttentionDistributionControl();
                    TestCurrentView = control;
                    Buttons = Pult as PultButtons;
                    Buttons.ButtonPressed += Buttons_ButtonPressed;
                    Buttons.Disconnected += Buttons_Disconnected;
                    control.Results += TestCurrentView_Results;
                    control.ResetTimer += Control_ResetTimer;
                    control.FirstComplete += Control_FirstComplete;
                    Buttons.Start();
                    control.Start(false);
                    break;
                case 2:
                    control.LearningPanel = null;
                    control = _testControl;
                    TestCurrentView = control;
                    Buttons.ButtonPressed += Buttons_ButtonPressed;
                    Buttons.Disconnected += Buttons_Disconnected;
                    control.Results += TestCurrentView_Results;
                    control.ResetTimer += Control_ResetTimer;
                    control.FirstComplete += Control_FirstComplete;
                    Buttons.Start();
                    control.Start(true);
                    break;
            }
        }

        private void Control_FirstComplete(object sender, EventArgs e)
        {
            SetInstructions("AttentionDistribution_2", 2, true);
            Buttons.ButtonPressed -= Buttons_ButtonPressed;
            control.Results -= TestCurrentView_Results;
            control.ResetTimer -= Control_ResetTimer;
            control.FirstComplete -= Control_FirstComplete;
            Buttons.Disconnected -= Buttons_Disconnected;
            _testControl = control;
            NumberInstruction = 2;
            Buttons.Stop();
            Manager.ToInstruction();
        }

        private AttentionDistributionControl _testControl = null;

        private void Control_ResetTimer(object sender, bool e)
        {
            Buttons.Start();
        }

        private void TestCurrentView_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Blue)
            {
                control.PressButton(AttentionDistribution.Buttons.Blue, e.Time);
            }
            else if (e.Button == PultButton.White)
            {
                control.PressButton(AttentionDistribution.Buttons.White, e.Time);
            }
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.FirstComplete -= Control_FirstComplete;
                control.Results -= TestCurrentView_Results;
                control.ResetTimer -= Control_ResetTimer;
                control.Stop();
                control.Dispose();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AttentionDistribution\NumberSoundsPresenter.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Media;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;

namespace Updk7.Tests.Wpf.Psychophysical.AttentionDistribution
{
    public class NumberSoundsPresenter : IDisposable
    {
        //private SoundPlayer _player = new SoundPlayer();
        private SynchronizationContext _context;
        public NumberSoundsPresenter()
        {
            _context = SynchronizationContext.Current;
            TimerCallback timerCallback = new TimerCallback(IntervalDone);
            _timer = new Timer(new TimerCallback(IntervalDone), null, Timeout.Infinite, Timeout.Infinite);
        }
        Timer _timer;
        private NumberSoundPair _currentPair;
        Stopwatch sw = new Stopwatch();
        public void Start(NumberSoundPair pair)
        {
            _context.Post(_ =>
            {
                _currentPair = pair;
                PlayFirstNumber();
                _timer.Change(TimeSpan.FromSeconds(0.7), TimeSpan.Zero);
                _isStarted = true;
                sw.Restart();
                
            }, null);
        }

        private void IntervalDone(object timerState)
        {
            _context.Post(_ =>
            {
                if (_isStarted)
                {
                    Stop();
                    PlaySecondNumber();
                    Console.WriteLine(sw.ElapsedMilliseconds);
                }
                else
                    _timer.Change(Timeout.Infinite, Timeout.Infinite);
            },
            null);

        }

        private bool _isStarted = false;
        public void Stop()
        {
            _context.Post(_ =>
            {
                _isStarted = false;
            }, null);
        }

        private MemoryStream _ms;
        private NAudio.Wave.WaveFileReader reader;
        private NAudio.Wave.WaveOut _player;
        public void PlayNumbersPair(int number)
        {
            _ms?.Close();
            _player?.Dispose();
            var byteArray = SoundResources.GetSoundArray(GetPathNumberSoundFile(number).OriginalString);
            _ms = new MemoryStream(byteArray);
            reader = new NAudio.Wave.WaveFileReader(_ms);
            _player = new NAudio.Wave.WaveOut();
            _player.Init(reader);
            _player.Play();
            // _player.Stream = _ms;
            //_player.Play();
        }

        public void PlayFirstNumber()
        {
            PlayNumbersPair(_currentPair.Number1);
        }

        public void PlaySecondNumber()
        {
            PlayNumbersPair(_currentPair.Number2);
        }

        private Uri GetPathNumberSoundFile(int number)
        {
            try
            {
                return new Uri($@"pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/AttentionDistribution/Sounds/{number}.wav");
            }
            catch
            {
                throw new Exception($"Файл {number}.wav не существует!");
            }
        }

        private bool _disposed = false;
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this); //говорим сборщику мусора, что наш объект уже освободил ресурсы
        }

        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                //нельзя вызвать метод Dispose для объекта дважды
                return;
            }
            if (disposing)
            {
                //тут освобождаем все ресурсы. В нашем случае он только один.
                Close();
            }
            _disposed = true; //помечаем флаг что метод Dispose уже был вызван
        }

        private void Close()
        {
            _player?.Dispose();
            _timer?.Dispose();
            _ms?.Close();
        }
    }
}


*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\AttentionDistribution\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.AttentionDistribution"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <SolidColorBrush x:Key="Figures.Background" Color="#FFE4EFFF"/>
    <local:FigureTemplateSelector x:Key="FigureTemplateSelector">
        <local:FigureTemplateSelector.Rhombus>
            <DataTemplate>
                <Path Data="M48.33252,1.3333323 L23.000255,47.999815 47.332562,98.665919 70.99823,47.666485 z" Height="100" Stretch="Fill"  Width="50" Fill="{StaticResource Figures.Background}"/>
            </DataTemplate>
        </local:FigureTemplateSelector.Rhombus>
        <local:FigureTemplateSelector.Rectangle>
            <DataTemplate>
                <Rectangle Height="50" Width="100" Stroke="{x:Null}" Fill="{StaticResource Figures.Background}"/>
            </DataTemplate>
        </local:FigureTemplateSelector.Rectangle>
        <local:FigureTemplateSelector.Cylinder>
            <DataTemplate>
                <Canvas Height="100" Width="100" >
                    <Path Data="M19.666667,12.666667 C22.499666,29.833358 77.499664,29.166922 79.499666,11.833 80.499664,31.834345 81.499664,72.169266 80.499664,82.503575 79.16654,102.17246 23.333012,102.83739 19.499666,83.170279 18.99922,62.503046 19.666667,12.666667 19.666667,12.666667 z" Height="86.754" Canvas.Left="19.314" Stretch="Fill" Canvas.Top="11.833" Width="62.6">
                        <Path.Fill>
                            <SolidColorBrush Color="#FFE4EFFF"/>
                        </Path.Fill>
                    </Path>
                    <Path Data="M19.875,11.5 C20.5,-4.1256624 71.25,-8.25 79.375,11.75 77,28.999978 20.75,29.874905 19.875,11.5 z" Height="27.758" Canvas.Left="19.875" Stretch="Fill" Canvas.Top="-1.773" Width="60.5">
                        <Path.Fill>
                            <SolidColorBrush Color="#FF424E60"/>
                        </Path.Fill>
                    </Path>
                </Canvas>
            </DataTemplate>
        </local:FigureTemplateSelector.Cylinder>
        <local:FigureTemplateSelector.Triangle>
            <DataTemplate>
                <Path Data="M49,4 L2.5,86 94,85.5 z" Height="100" Stretch="Fill" Stroke="{x:Null}" Width="100" Fill="{StaticResource Figures.Background}"/>
            </DataTemplate>
        </local:FigureTemplateSelector.Triangle>
        <local:FigureTemplateSelector.Square>
            <DataTemplate>
                <Rectangle Height="100" Width="100" Stroke="{x:Null}" Fill="{StaticResource Figures.Background}"/>
            </DataTemplate>
        </local:FigureTemplateSelector.Square>
        <local:FigureTemplateSelector.Trapezoid>
            <DataTemplate>
                <Path Data="M25.25,21.25 L71.5,21.5 86,55.5 7,55.5 z" Height="50" Stretch="Fill" Stroke="{x:Null}" Width="100" Fill="{StaticResource Figures.Background}"/>
            </DataTemplate>
        </local:FigureTemplateSelector.Trapezoid>
        <local:FigureTemplateSelector.Circle>
            <DataTemplate>
                <Ellipse Height="90" Width="90" Stroke="{x:Null}" Fill="{StaticResource Figures.Background}"/>
            </DataTemplate>
        </local:FigureTemplateSelector.Circle>
        <local:FigureTemplateSelector.Star>
            <DataTemplate>
                <ed:RegularPolygon Height="100" InnerRadius="0.47211" PointCount="5" Stretch="Fill" Stroke="{x:Null}" Width="100" Fill="{StaticResource Figures.Background}"/>
            </DataTemplate>
        </local:FigureTemplateSelector.Star>
        <local:FigureTemplateSelector.Hexagon>
            <DataTemplate>
                <ed:RegularPolygon Height="100" InnerRadius="1" PointCount="6" Stretch="Fill" Stroke="{x:Null}" Width="100" RenderTransformOrigin="0.5,0.5" Fill="{StaticResource Figures.Background}"/>
            </DataTemplate>
        </local:FigureTemplateSelector.Hexagon>
        <local:FigureTemplateSelector.Parallelogram>
            <DataTemplate>
                <Path Height="50" Width="100" Data="M30,0 L100,0 L70,50 L0,50Z" Fill="{StaticResource Figures.Background}"/>
            </DataTemplate>
        </local:FigureTemplateSelector.Parallelogram>
    </local:FigureTemplateSelector>
    <DataTemplate x:Key="figureTemplate">
        <Viewbox>
            <ContentControl Height="100" Width="100" Content="{Binding}" ContentTemplateSelector="{StaticResource FigureTemplateSelector}"/>
        </Viewbox>
    </DataTemplate>
    <Style TargetType="local:AttentionDistributionControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AttentionDistributionControl">
                    <Border Background="{TemplateBinding Background}">
                        <Viewbox>
                            <Grid 
                          Width="1920"
                          Height="1080">
                                <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="1*"/>
                                        <ColumnDefinition Width="7cm"/>
                                        <ColumnDefinition Width="2.5cm"/>
                                        <ColumnDefinition Width="7cm"/>
                                        <ColumnDefinition Width="1*"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="1*"/>
                                        <RowDefinition Height="7cm"/>
                                        <RowDefinition Height="1*"/>
                                    </Grid.RowDefinitions>
                                    <Border Grid.Column="1" Grid.Row="1" BorderThickness="4" CornerRadius="15" Background="#FF777F8C">
                                        <ContentPresenter Margin="20"
                                  Content="{Binding Figure1, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:AttentionDistributionControl}}}" 
                                  ContentTemplate="{DynamicResource figureTemplate}"/>
                                    </Border>
                                    <Border Grid.Column="3" Grid.Row="1" BorderThickness="4" CornerRadius="15" Background="#FF777F8C">
                                        <ContentPresenter Margin="20"
                                  Content="{Binding Figure2, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:AttentionDistributionControl}}}"
                                  ContentTemplate="{DynamicResource figureTemplate}"/>
                                    </Border>
                                </Grid>
                                <Grid HorizontalAlignment="Center" VerticalAlignment="Bottom" Height="40" Width="200">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock x:Name="figureTbx1" Grid.Column="0"/>
                                    <TextBlock x:Name="figureTbx2" Grid.Column="1"/>
                                </Grid>
                                <tests:MessageBoxControl Message="{Binding Message, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:AttentionDistributionControl}}}" />

                                <ContentPresenter Grid.ColumnSpan="3"
                                          Content="{Binding LearningPanel,
                                          RelativeSource={RelativeSource AncestorType={x:Type local:AttentionDistributionControl}}}">
                                    <ContentPresenter.Resources>
                                        <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                            <panels:CanvasPanelView Margin="5"
                                                            DataContext="{Binding}"
                                                            Background="{Binding Background}"
                                                            BorderBrush="{Binding BorderBrush}"
                                                            BorderThickness="{Binding BorderThickness}"/>
                                        </DataTemplate>
                                    </ContentPresenter.Resources>
                                </ContentPresenter>
                            </Grid>
                        </Viewbox>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:AttentionDistributionViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AttentionDistributionViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:AttentionDistributionViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ComplexMotorReaction\ColorIndicatorState.cs


namespace Updk7.Tests.Wpf.Psychophysical.ComplexMotorReaction
{
    public enum ColorIndicatorState
    {
        Alpfa,
        Yellow,
        Green,
        Red
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ComplexMotorReaction\ComplexMotorReactionControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.ComplexMotorReaction
{
    public class ComplexMotorReactionControl : NotifyViewModelBase, ILearning
    {

        public event EventHandler ResetTimer;

        public event EventHandler<Dictionary<string, object>> Results;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (_isShowedMessages)
                {
                    if (_message != "")
                    {
                        _isButtonsEnabled = false;
                        _timer.Stop();
                        _messageTimer.Start();
                    }
                    OnPropertyChanged();
                }
            }
        }

        public ColorIndicatorState State
        {
            get { return _state; }
            set
            {
                OldState = _state;
                _state = value;
                OnPropertyChanged();
            }
        }


        private int _pressButtonCounter;

        public int PressButtonCounter
        {
            get { return _pressButtonCounter; }
            set
            {
                _pressButtonCounter = value;
                OnPropertyChanged();
            }
        }

        private SolidColorBrush _buttonColor;

        public SolidColorBrush ButtonColor
        {
            get { return _buttonColor; }
            set
            {
                _buttonColor = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }


        private int _countErrors = 0;

        private int _countNullPresses = 0;

        private int _countPasses = 0;

        private int _indexState = 0;

        private bool _isButtonsEnabled = true;

        private bool _isShowedMessages = false;

        private string _message;

        private DispatcherTimer _messageTimer = new DispatcherTimer();

        private List<double> _reactions = new List<double>();

        private ColorIndicatorState _state;

        private List<ColorIndicatorState> _states = new List<ColorIndicatorState>();

        private DispatcherTimer _timer = new DispatcherTimer();

        private ColorIndicatorState OldState = ColorIndicatorState.Green;

        private Random rnd = new Random();

        public ComplexMotorReactionControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
                LearningInterfaceInitialize();
        }

        public void Start(int countStates = 100, bool isTestStart = false)
        {
            _isShowedMessages = isTestStart;
            Initialize(countStates);
            if (Mode != TestMode.Manual)
                _timer.Start();
        }

        private void Initialize(int countStates)
        {
            _messageTimer.Tick += _messageTimer_Tick;
            _messageTimer.Interval = TimeSpan.FromSeconds(1.5);

            State = ColorIndicatorState.Alpfa;
            OldState = ColorIndicatorState.Green;
            _timer.Tick += _timer_Tick;
            _timer.Interval = TimeSpan.FromSeconds(2);
            int middleCountStates = countStates / 2;
            generateStatesIndicator(middleCountStates, middleCountStates);

        }

        private void LearningInterfaceInitialize()
        {
            TestMethods.Add("ShowGreenSignal", () => ShowGreenSignal());
            TestMethods.Add("ShowRedSignal", () => ShowRedSignal());
            TestMethods.Add("ShowYellowSignal", () => ShowYellowSignal());
            TestMethods.Add("HideSignal", () => HideSignal());
        }

        private void ShowGreenSignal()
        {
            State = ColorIndicatorState.Green;
        }

        private void ShowRedSignal()
        {
            State = ColorIndicatorState.Red;
        }

        private void ShowYellowSignal()
        {
            State = ColorIndicatorState.Yellow;
        }

        private void HideSignal()
        {
            State = ColorIndicatorState.Alpfa;
        }

        public void PressButton(ColorIndicatorState button, int time)
        {
            PressButtonCounter++;
            switch (button)
            {
                case ColorIndicatorState.Alpfa:
                    break;
                case ColorIndicatorState.Yellow:
                    break;
                case ColorIndicatorState.Green:
                    ButtonColor = new SolidColorBrush(Colors.Green);
                    break;
                case ColorIndicatorState.Red:
                    ButtonColor = new SolidColorBrush(Colors.Red);
                    break;
            }

            if (_isButtonsEnabled)
            {
                if (State == ColorIndicatorState.Red || State == ColorIndicatorState.Green)
                {
                    if (button == ColorIndicatorState.Red || button == ColorIndicatorState.Green)
                    {
                        var curTime = TimeSpan.FromSeconds(time / 10000.0);
                        _reactions.Add(curTime.TotalSeconds);
                        if (button != State)
                        {
                            if (State == ColorIndicatorState.Green)
                                Message = "Вы неправильно отреагировали на зеленый сигнал!";
                            else if (State == ColorIndicatorState.Red)
                                Message = "Вы неправильно отреагировали на красный сигнал!";
                            _countErrors++;
                        }
                        State = ColorIndicatorState.Alpfa;
                        _timer.Interval = TimeSpan.FromSeconds(2);
                    }
                }
                else if (State == ColorIndicatorState.Yellow || State == ColorIndicatorState.Alpfa)
                {
                    if (State == ColorIndicatorState.Yellow)
                        Message = "На желтый сигнал реагировать не надо!";
                    else if (State == ColorIndicatorState.Alpfa)
                        Message = "Вы отреагировали на пустой сигнал!";
                    _countNullPresses++;
                }
            }
        }

        public void Stop()
        {
            _messageTimer.Tick -= _messageTimer_Tick;
            _messageTimer.Stop();
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
        }

        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _messageTimer.Stop();
            if (Mode != TestMode.Manual)
                _timer.Start();
            _isButtonsEnabled = true;
        }
        private void _timer_Tick(object sender, EventArgs e)
        {
            switch (State)
            {
                case ColorIndicatorState.Alpfa:
                    if (OldState == ColorIndicatorState.Yellow)
                    {
                        if (_indexState < _states.Count)
                        {
                            State = _states[_indexState];
                            _indexState++;
                            ResetTimer?.Invoke(this, new EventArgs());
                            _timer.Interval = TimeSpan.FromSeconds(2);
                        }
                        else
                        {
                            _timer.Stop();
                            ReturnResult();
                        }
                    }
                    else if (OldState == ColorIndicatorState.Green || OldState == ColorIndicatorState.Red)
                    {
                        State = ColorIndicatorState.Yellow;
                        _timer.Interval = TimeSpan.FromSeconds(2);
                    }
                    break;
                case ColorIndicatorState.Yellow:
                    State = ColorIndicatorState.Alpfa;
                    _timer.Interval = TimeSpan.FromSeconds(Common.GetRandomNumber(1.5, 4));
                    break;
                case ColorIndicatorState.Green:
                    State = ColorIndicatorState.Alpfa;
                    _reactions.Add(2);
                    Message = "Вы не отреагировали на зеленый сигнал!";
                    _countPasses++;
                    _timer.Interval = TimeSpan.FromSeconds(2);
                    break;
                case ColorIndicatorState.Red:
                    State = ColorIndicatorState.Alpfa;
                    _reactions.Add(2);
                    Message = "Вы не отреагировали на красный сигнал!";
                    _countPasses++;
                    _timer.Interval = TimeSpan.FromSeconds(2);
                    break;
            }
        }

        private void generateStatesIndicator(int countPresentingRed = 50, int countPresentingGreen = 50)
        {
            for (int i = 0; i < countPresentingRed; i++)
                _states.Add(ColorIndicatorState.Red);
            for (int i = 0; i < countPresentingGreen; i++)
                _states.Add(ColorIndicatorState.Green);
            Common.Shuffle(_states);
        }
        private void ReturnResult()
        {
            var ValuesTimeReactions = _reactions;
            var AverageTimeREactions = _reactions.Count > 0 ? _reactions.Average() : 0.0;
            var Errors = _countErrors;
            var Passes = _countPasses;

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Среднее время реагирования"] = (float)AverageTimeREactions,
                ["Количество ошибок"] = Errors,
                ["Количество пропусков"] = Passes,
                ["Количество пустых нажатий"] = _countNullPresses,
                ["Все значения времён реагирования на сигналы"] = ValuesTimeReactions.Select(s => Convert.ToSingle(s)).ToArray()
            });
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ComplexMotorReaction\ComplexMotorReactionViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.ComplexMotorReaction
{
    public class ComplexMotorReactionViewModel : TestBase
    {
        public override event EventHandler<Results> Results;
        
        private PultButtons Buttons;
        private ComplexMotorReactionControl control;
        private SDRType _sDRtype;
        public ComplexMotorReactionViewModel(SDRType sDRType, PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            _sDRtype = sDRType;
            Manager.TraningTime = new TimeSpan(0, 0, 30);
            SetInstructions("ComplexMotorReaction");
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override FrameworkElement GetTestControl()
        {
            return new ComplexMotorReactionControl(mode: LearningTasksExtension.TestMode.Manual);
        }

        public override void TestManual()
        {
            control = new ComplexMotorReactionControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }
        public override void TestStart()
        {
            control = new ComplexMotorReactionControl();
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start((int)_sDRtype, true);
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        public override void Start()
        {
            control = new ComplexMotorReactionControl();
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.Results += Control_Results;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start((int)_sDRtype);
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Green)
            {
                control.PressButton(ColorIndicatorState.Green, e.Time);
            }
            else if (e.Button == PultButton.Red)
            {
                control.PressButton(ColorIndicatorState.Red, e.Time);
            }
        }

        public override void Stop()
        {
            base.Stop();
            if (control != null)
            {
                control.Results -= Control_Results;
                control.ResetTimer -= Control_ResetTimer;
                control.Stop();
            }
            if (Buttons != null)
            {
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.Stop();
            }
        }
    }

    public enum SDRType
    {
        _100 = 100,
        _30 = 30
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ComplexMotorReaction\StateToBrushConverter.cs


using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
using static Updk7.Tests.Wpf.Psychophysical.Common.Drawing;

namespace Updk7.Tests.Wpf.Psychophysical.ComplexMotorReaction
{
    public class StateToBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                var state = (ColorIndicatorState)value;
                switch (state)
                {
                    case ColorIndicatorState.Yellow:
                        return GetColor(Common.ColorsCircle.Yellow);
                    case ColorIndicatorState.Green:
                        return GetColor(Common.ColorsCircle.Green);
                    case ColorIndicatorState.Red:
                        return GetColor(Common.ColorsCircle.Red);
                    case ColorIndicatorState.Alpfa:
                        return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF969696"));
                }
            }
            return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF969696"));
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ComplexMotorReaction\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.ComplexMotorReaction"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <local:StateToBrushConverter x:Key="StateToBrushConverter"/>
    <Style TargetType="local:ComplexMotorReactionControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ComplexMotorReactionControl">
                    <Border Background="{TemplateBinding Background}">
                        <Viewbox>
                            <Grid Width="1920" Height="1080">
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Ellipse Grid.RowSpan="2" Height="3cm" Width="3cm" Stroke="White" 
                                 Fill="{Binding State,
                                        RelativeSource={RelativeSource FindAncestor, 
                                        AncestorType={x:Type local:ComplexMotorReactionControl}},
                                        Converter={StaticResource StateToBrushConverter}}"/>
                                <tests:MessageBoxControl Message="{Binding Message,
                                                                   RelativeSource={RelativeSource FindAncestor,
                                                                   AncestorType={x:Type local:ComplexMotorReactionControl}}}"/>
                                <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                        RelativeSource={RelativeSource 
                                        AncestorType={x:Type local:ComplexMotorReactionControl}}}">
                                    <ContentPresenter.Resources>
                                        <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                            <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                        </DataTemplate>
                                    </ContentPresenter.Resources>
                                </ContentPresenter>
                            </Grid>
                        </Viewbox>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ComplexMotorReactionViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ComplexMotorReactionViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                RelativeSource={RelativeSource FindAncestor,
                                AncestorType={x:Type local:ComplexMotorReactionViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ComplexMotorReaction_M\ComplexMotorReactionMControl.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using static Updk7.Tests.Wpf.Psychophysical.Common.Drawing;

namespace Updk7.Tests.Wpf.Psychophysical.ComplexMotorReaction_M
{
    public class ComplexMotorReactionMControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler ResetTimer;
        public event EventHandler FirstComplete;

        private ColorIndicatorState _state;
        public ColorIndicatorState State
        {
            get { return _state; }
            set
            {
                OldState = _state;
                _state = value;
                OnPropertyChanged();
            }
        }

        private ColorIndicatorState OldState = ColorIndicatorState.Green;

        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (_isShowedMessages)
                {
                    if (_message != "")
                    {
                        _isButtonsEnabled = false;
                        _timer.Stop();
                        _messageTimer.Start();
                    }
                    OnPropertyChanged();
                }
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private bool _isButtonsEnabled = true;
        private bool _isShowedMessages = false;
        private DispatcherTimer _timer = new DispatcherTimer();
        private DispatcherTimer _messageTimer = new DispatcherTimer();
        private Random rnd = new Random();
        private List<ColorIndicatorState> _states1 = new List<ColorIndicatorState>();//Список сгенерированных статусов(первая часть)
        private List<ColorIndicatorState> _states2 = new List<ColorIndicatorState>();//Список сгенерированных статусов(вторая часть)
        private int _indexState = 0;//Индекс в списке статусов
        private int Id;
        public ComplexMotorReactionMControl(TestMode mode = TestMode.Normal)
        {
            Id = Common._rnd.Next(12, 23434131);
            Mode = mode;
            if (Mode == TestMode.Manual)
                LearningInterfaceInitialize();
        }

        private void LearningInterfaceInitialize()
        {
            TestMethods.Add("ShowGreenSignal", () => ShowGreenSignal());
            TestMethods.Add("ShowRedSignal", () => ShowRedSignal());
            TestMethods.Add("ShowYellowSignal", () => ShowYellowSignal());
            TestMethods.Add("HideSignal", () => HideSignal());
        }

        private void ShowGreenSignal()
        {
            State = ColorIndicatorState.Green;
        }

        private void ShowRedSignal()
        {
            State = ColorIndicatorState.Red;
        }

        private void ShowYellowSignal()
        {
            State = ColorIndicatorState.Yellow;
        }

        private void HideSignal()
        {
            State = ColorIndicatorState.Alpfa;
        }

        private bool _isSecondaryQuest = false;
        private List<double> currentListReactions;
        public void Start(bool isSecondaryQuest = false, bool isTestStart = false)
        {
            _isShowedMessages = isTestStart;
            if (_isShowedMessages)
            {
                _messageTimer.Tick += _messageTimer_Tick;
                _messageTimer.Interval = TimeSpan.FromSeconds(1.5);
            }
            _isSecondaryQuest = isSecondaryQuest;
            if (_isSecondaryQuest)
            {
                _indexState = 0;
                generateStatesIndicator(_states2, 12, 12);
                currentListReactions = _reactions2;
                _currentStates = _states2;
            }
            else
            {
                _timer.Tick += _timer_Tick;
                _timer.Interval = TimeSpan.FromSeconds(2);
                generateStatesIndicator(_states1, 12, 0);
                currentListReactions = _reactions1;
                _currentStates = _states1;
            }

            State = ColorIndicatorState.Alpfa;
            OldState = ColorIndicatorState.Green;
            if (Mode != TestMode.Manual)
                _timer.Start();

        }

        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _messageTimer.Stop();
            if (Mode != TestMode.Manual)
                _timer.Start();
            _isButtonsEnabled = true;
        }

        public void Stop()
        {
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
        }

        private void generateStatesIndicator(List<ColorIndicatorState> _states, int countRed = 0, int countGreen = 0)
        {
            for (int i = 0; i < countRed; i++)
                _states.Add(ColorIndicatorState.Red);
            for (int i = 0; i < countGreen; i++)
                _states.Add(ColorIndicatorState.Green);
            if (_states.Count != 0)
                Common.Shuffle(_states);
        }
        
        private List<double> _reactions1 = new List<double>();
        private List<double> _reactions2 = new List<double>();
        private int _countPasses1 = 0;
        private int _countErrors1 = 0;
        private int _countPasses2 = 0;
        private int _countErrors2 = 0;
        private List<ColorIndicatorState> _currentStates;
        private int _countPasses = 0;
        private int _countErrors = 0;
        private int _countNullPresses = 0;
        private void _timer_Tick(object sender, EventArgs e)
        {
            switch (State)
            {
                case ColorIndicatorState.Alpfa:
                    if (OldState == ColorIndicatorState.Yellow)
                    {
                        if (_indexState < _currentStates.Count)
                        {
                            State = _currentStates[_indexState];
                            _indexState++;
                            ResetTimer?.Invoke(this, new EventArgs());
                            _timer.Interval = TimeSpan.FromSeconds(2);
                        }
                        else
                        {
                            _timer.Stop();
                            if (!_isSecondaryQuest)
                                FirstComplete?.Invoke(this, new EventArgs());
                            else
                                ReturnResult();
                        }
                    }
                    else if (OldState == ColorIndicatorState.Green || OldState == ColorIndicatorState.Red)
                    {
                        State = ColorIndicatorState.Yellow;
                        _timer.Interval = TimeSpan.FromSeconds(2);
                    }
                    break;
                case ColorIndicatorState.Yellow:
                    State = ColorIndicatorState.Alpfa;
                    _timer.Interval = TimeSpan.FromSeconds(Common.GetRandomNumber(1.5, 4));
                    break;
                case ColorIndicatorState.Green:
                    State = ColorIndicatorState.Alpfa;
                    currentListReactions.Add(2);
                    if (_isShowedMessages)
                        Message = "Вы не отреагировали на зеленый сигнал!";
                    _countPasses++;
                    _timer.Interval = TimeSpan.FromSeconds(2);
                    break;
                case ColorIndicatorState.Red:
                    State = ColorIndicatorState.Alpfa;
                    currentListReactions.Add(2); 
                    if (_isShowedMessages)
                        Message = "Вы не отреагировали на красный сигнал!";
                    _countPasses++;
                    _timer.Interval = TimeSpan.FromSeconds(2);
                    break;
            }
            Debug.WriteLine($" Timer_Tick_State - {State} Id - {Id}");
        }

        private void ReturnResult()
        {
            var ValuesTimeReactions1 = _reactions1;
            var AverageTimeREactions1 = _reactions1.Count > 0 ? _reactions1.Average() : 0.0;
            var ValuesTimeReactions2 = _reactions2;
            var AverageTimeREactions2 = _reactions2.Count > 0 ? _reactions2.Average() : 0.0;
            var Errors1 = _countErrors1;
            var Passes1 = _countPasses1;
            var Errors2 = _countErrors2;
            var Passes2 = _countPasses2;

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Среднее время реагирования в задании №1"] = (float)AverageTimeREactions1,
                ["Количество ошибок в задании №2"] = _countErrors,
                ["Время выбора"] = (float)(AverageTimeREactions2 - AverageTimeREactions1),
                ["Количество нажатий на кнопку при отсутствии сигнала"] = _countNullPresses,
                ["Среднее время реагирования в задании №2"] = (float)(AverageTimeREactions2)

                //["Значения времён реагирования на сигналы, сек 1"] = ValuesTimeReactions1,
                //["Количество ошибок 1"] = Errors1,
                //["Количество пропусков 1"] = Passes1,
                //["Значения времён реагирования на сигналы, сек 2"] = ValuesTimeReactions2,
                //["Количество пропусков 2"] = Passes2
            });
        }

        public void PressButton(ColorIndicatorState button, int time)
        {
            if (_isButtonsEnabled)
            {
                Debug.WriteLine($"{State} Id - {Id}");
                if (State == ColorIndicatorState.Red || State == ColorIndicatorState.Green)
                {
                    if (button == ColorIndicatorState.Red || button == ColorIndicatorState.Green)
                    {
                        if (_isSecondaryQuest)
                        {
                            var curTime = TimeSpan.FromSeconds(time / 10000.0);
                            currentListReactions.Add(curTime.TotalSeconds);
                            if (button != State)
                            {
                                if (State == ColorIndicatorState.Green)
                                    if (_isShowedMessages)
                                        Message = "Вы неправильно отреагировали на зеленый сигнал!";
                                else if (State == ColorIndicatorState.Red)
                                        if (_isShowedMessages)
                                            Message = "Вы неправильно отреагировали на красный сигнал!";
                                _countErrors++;
                            }
                            State = ColorIndicatorState.Alpfa;
                            _timer.Interval = TimeSpan.FromSeconds(2);
                        }
                        else if (button == ColorIndicatorState.Red && State == ColorIndicatorState.Red)
                        {
                            var curTime = TimeSpan.FromSeconds(time / 10000.0);
                            currentListReactions.Add(curTime.TotalSeconds);
                            State = ColorIndicatorState.Alpfa;
                            _timer.Interval = TimeSpan.FromSeconds(2);
                        }
                    }
                }
                else if (State == ColorIndicatorState.Yellow || State == ColorIndicatorState.Alpfa)
                {
                    if (State == ColorIndicatorState.Yellow)
                        if (_isShowedMessages)
                            Message = "На желтый сигнал реагировать не надо!";
                    else if (State == ColorIndicatorState.Alpfa)
                            if (_isShowedMessages)
                                Message = "Вы отреагировали на пустой сигнал!";
                    _countNullPresses++;
                }
            }
        }
    }
    public class StateToBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                var state = (ColorIndicatorState)value;
                switch (state)
                {
                    case ColorIndicatorState.Yellow:
                        return GetColor(Common.ColorsCircle.Yellow);
                    case ColorIndicatorState.Green:
                        return GetColor(Common.ColorsCircle.Green);
                    case ColorIndicatorState.Red:
                        return GetColor(Common.ColorsCircle.Red);
                    case ColorIndicatorState.Alpfa:
                        return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF969696"));
                }
            }
            return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF969696"));
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    public enum ColorIndicatorState
    {
        Alpfa,
        Yellow,
        Green,
        Red
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ComplexMotorReaction_M\ComplexMotorReactionMViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.ComplexMotorReaction_M
{
    public class ComplexMotorReactionMViewModel : TestBase
    {
        public override event EventHandler<Results> Results;

        private int _numberInstruction;
        public int NumberInstruction
        {
            get { return _numberInstruction; }
            set
            {
                _numberInstruction = value;
                OnPropertyChanged();
            }
        }

        private PultButtons Buttons;
        private ComplexMotorReactionMControl control;
        public ComplexMotorReactionMViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("complexMotorReaction_M_instruction1", 1);
            Manager.TraningTime = Common.GetSeconds(30);
            NumberInstruction = 1;
        }

        public override FrameworkElement GetTestControl()
        {
            return new ComplexMotorReactionMControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new ComplexMotorReactionMControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override void TestStart()
        {
            control = new ComplexMotorReactionMControl();
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start(isTestStart: true);
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }
        public override void DisconnectedPult(Exception e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
            base.DisconnectedPult(e);
        }

        public override void Start()
        {
            switch (NumberInstruction)
            {
                case 1:
                    control = new ComplexMotorReactionMControl();
                    TestCurrentView = control;
                    Buttons = Pult as PultButtons;
                    Buttons.ButtonPressed += Buttons_ButtonPressed;
                    Buttons.Disconnected += Buttons_Disconnected;
                    control.Results += Control_Results;
                    control.ResetTimer += Control_ResetTimer;
                    control.FirstComplete += Control_FirstComplete;
                    Buttons.Start();
                    control.Start(isSecondaryQuest: false);
                    break;

                case 2:
                    control.LearningPanel = null;
                    control = _testControl;
                    TestCurrentView = control;
                    Buttons.ButtonPressed += Buttons_ButtonPressed;
                    Buttons.Disconnected += Buttons_Disconnected;
                    control.Results += Control_Results;
                    control.ResetTimer += Control_ResetTimer;
                    control.FirstComplete += Control_FirstComplete;
                    Buttons.Start();
                    control.Start(isSecondaryQuest: true);
                    break;
            }
        }

        private void Control_FirstComplete(object sender, EventArgs e)
        {
            SetInstructions("complexMotorReaction_M_instruction2", 2, true);
            Buttons.ButtonPressed -= Buttons_ButtonPressed;
            Buttons.Disconnected -= Buttons_Disconnected;
            control.Results -= Control_Results;
            control.ResetTimer -= Control_ResetTimer;
            control.FirstComplete -= Control_FirstComplete;
            _testControl = control;
            NumberInstruction = 2;
            Buttons.Stop();
            Manager.ToInstruction();
        }
        private ComplexMotorReactionMControl _testControl = null;

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Green)
                control.PressButton(ColorIndicatorState.Green, e.Time);
            else if (e.Button == PultButton.Red)
                control.PressButton(ColorIndicatorState.Red, e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.FirstComplete -= Control_FirstComplete;
                control.ResetTimer -= Control_ResetTimer;
                control.Results -= Control_Results;
                control.Stop();
            }
        }
    }
}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ComplexMotorReaction_M\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.ComplexMotorReaction_M"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <local:StateToBrushConverter x:Key="StateToBrushConverter"/>
    <Style TargetType="local:ComplexMotorReactionMControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ComplexMotorReactionMControl">
                    <Border Background="{TemplateBinding Background}">
                        <Viewbox>
                            <Grid Width="1920"
                                  Height="1080">
                                <Ellipse Height="3cm"
                                         Width="3cm" 
                                         Stroke="White" 
                                 Fill="{Binding State,
                                        RelativeSource={RelativeSource FindAncestor,
                                        AncestorType={x:Type local:ComplexMotorReactionMControl}},
                                        Converter={StaticResource StateToBrushConverter}}"/>
                            <tests:MessageBoxControl Message="{Binding Message,
                                                              RelativeSource={RelativeSource FindAncestor,
                                                              AncestorType={x:Type local:ComplexMotorReactionMControl}}}"/>
                                <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:ComplexMotorReactionMControl}}}">
                                    <ContentPresenter.Resources>
                                        <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                            <panels:CanvasPanelView Margin="5"
                                                                    DataContext="{Binding}"
                                                                    Background="{Binding Background}"
                                                                    BorderBrush="{Binding BorderBrush}"
                                                                    BorderThickness="{Binding BorderThickness}"/>
                                        </DataTemplate>
                                    </ContentPresenter.Resources>
                                </ContentPresenter>
                            </Grid>
                        </Viewbox>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ComplexMotorReactionMViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ComplexMotorReactionMViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                RelativeSource={RelativeSource FindAncestor,
                                AncestorType={x:Type local:ComplexMotorReactionMViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ConcentrationAttention\ConcentrationAttentionControl.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.ConcentrationAttention
{
    public class ConcentrationAttentionControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler ResetTimer;

        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public Canvas _buttonsCanvas;
        public Canvas ButtonsCanvas
        {
            get { return _buttonsCanvas; }
            set
            {
                _buttonsCanvas = value;
                OnPropertyChanged();
            }
        }

        private bool _isButtonBlock;
        public bool IsButtonBlock
        {
            get { return _isButtonBlock; }
            set
            {
                if (_isButtonBlock != value && !value)
                {
                    if (Mode != TestMode.Manual)
                        ResetTimer?.Invoke(this, new EventArgs());
                }
                _isButtonBlock = value;
                OnPropertyChanged();
            }
        }

        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (_isShowedMessages)
                {
                    if (_message != "")
                    {
                        _isButtonsEnabled = false;
                        _timer.Stop();
                        _messageTimer.Start();
                    }
                    OnPropertyChanged();
                }
            }
        }

        private List<RowRings> _rowsRings = new List<RowRings>();
        public List<RowRings> RowsRings
        {
            get { return _rowsRings; }
            set
            {
                _rowsRings = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private bool _isButtonsEnabled = true;
        private bool _isShowedMessages = false;
        private int _indexCurrentRow = 0;
        private int _indexLastShowedRow = -1;
        private List<RowRings> _currentRows = new List<RowRings>();
        private List<NumberButton> _buttons = new List<NumberButton>();
        private RowRings _currentActiveRow;
        private double HeightWidthRing;
        private int _indexCurrentButton = 4;
        private DateTime _startQuest;
        private DispatcherTimer _timer = new DispatcherTimer();

        private DispatcherTimer _messageTimer = new DispatcherTimer();
        Random rnd = new Random();
        public ConcentrationAttentionControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            generateScene(new Size(500, 500));

            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("FirstRing", () => FirstRing());
                TestMethods.Add("AllCorrectRings", () => AllCorrectRings());
                TestMethods.Add("AllCorrectClear", () => AllCorrectClear());
                TestMethods.Add("UpButton", () => UpButton());
                TestMethods.Add("DownButton", () => DownButton());
                TestMethods.Add("ClickButton", () => ClickButton());
            }
        }

        public void Start(bool isTestQuest = false)
        {
            _isShowedMessages = isTestQuest;
            if (!isTestQuest && Mode != TestMode.Manual)
            {
                Cursor = Cursors.None;
            }
            if (_isShowedMessages)
            {
                _messageTimer.Tick += _messageTimer_Tick;
                _messageTimer.Interval = TimeSpan.FromSeconds(1.5);
            }
            _timer.Interval = TimeSpan.FromMinutes(8);
            _timer.Tick += _timer_Tick;

            _startQuest = DateTime.Now;

            if (Mode != TestMode.Manual)
            {
                ResetTimer?.Invoke(this, new EventArgs());
                _timer.Start();
            }
        }

        #region Use only in ILearning interface
        private void FirstRing()
        {
            Ring firstRing = _currentActiveRow.Rings[0];
            firstRing.RingColor = Brushes.OrangeRed;
        }

        private List<Ring> _correctRings = new List<Ring>();
        private void AllCorrectRings()
        {
            Ring firstRing = _currentActiveRow.Rings[0];
            for (int i = 1; i < _currentActiveRow.Rings.Count; i++)
            {
                if (firstRing.Angle == _currentActiveRow.Rings[i].Angle)
                {
                    Ring correctRing = _currentActiveRow.Rings[i];
                    correctRing.RingColor = Brushes.LightGreen;
                    _correctRings.Add(correctRing);
                }
            }
            firstRing.RingColor = Brushes.LightGreen;
            _correctRings.Add(firstRing);
          
        }

        private void AllCorrectClear()
        {
            for (int i = 0; i < _correctRings.Count; i++)
            {
                _correctRings[i].RingColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFDAE3F2"));
            }
        }

        private void UpButton()
        {
            PressUpButton();
        }

        private void DownButton()
        {
            PressDownButton();
        }

        private void ClickButton()
        {
            PressEnter(100);
        }

        #endregion

        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _messageTimer.Stop();
            if (Mode != TestMode.Manual)
                _timer.Start();
            _isButtonsEnabled = true;
        }

        public void Stop()
        {
            _isButtonBlock = true;
            _isCompleted = true;
            _messageTimer.Stop();
            _timer.Stop();
            _messageTimer.Tick -= _messageTimer_Tick;
            _timer.Tick -= _timer_Tick;
        }

        private void generateLearningRowRings()
        {
            int j = 0;
            int[] countInRowsSameCircles = GenerateCountsSameRingsIn5Strocks();
            for (int i = 0; i < 30; i++)
            {
                j++;
                if (i == 0)
                {
                    var rRings = new RowRings(countInRowsSameCircles[j - 1], TestMode.Manual);
                    _rowsRings.Add(rRings);
                }
                else
                {
                    var rRings = new RowRings(countInRowsSameCircles[j - 1]);
                    _rowsRings.Add(rRings);
                }
                if (j == 5)
                {
                    countInRowsSameCircles = GenerateCountsSameRingsIn5Strocks();
                    j = 0;
                }

            }
            OnPropertyChanged(nameof(RowsRings));
        }

        private void generateRowRings()
        {
            int j = 0;
            int[] countInRowsSameCircles = GenerateCountsSameRingsIn5Strocks();
            for (int i = 0; i < 30; i++)
            {
                j++;
                var rRings = new RowRings(countInRowsSameCircles[j - 1]);
                _rowsRings.Add(rRings);
                if (j == 5)
                {
                    countInRowsSameCircles = GenerateCountsSameRingsIn5Strocks();
                    j = 0;
                }

            }
            OnPropertyChanged(nameof(RowsRings));
        }

        private int[] GenerateCountsSameRingsIn5Strocks()
        {
            var counts = new List<int>() { 9, 9, 9, 9, 9 };
            int countIn5Strocks = 27;
            for (int i = 0; i < 5; i++)
            {
                var value = rnd.Next(0, 8);
                counts[i] = counts[i] - value;
            }
            while (true)
            {

                var sum = counts.Sum();
                if (sum == countIn5Strocks)
                    break;
                else if (sum < countIn5Strocks)
                {
                    var min = counts.Min();
                    var newValue = min + 1;
                    counts[counts.IndexOf(min)] = newValue;
                }
                else if (sum > countIn5Strocks)
                {
                    var max = counts.Max();
                    var newValue = max - 1;
                    counts[counts.IndexOf(max)] = newValue;
                }
            }
            return counts.ToArray();
        }

       
        private void generateScene(Size size)
        {

            HeightWidthRing = size.Width / 30;
            if (Mode != TestMode.Manual)
                generateRowRings();
            else
            {
                generateLearningRowRings();
            }

            var canvas = new Canvas();
            canvas.ClipToBounds = true;
            canvas.Height = HeightWidthRing * 12;
            canvas.Width = HeightWidthRing * 30;
            //генерация начального состояния
            for (int i = 0; i < 10; i++, _indexLastShowedRow++)
            {
                var _curentRow = _rowsRings[i];
                _curentRow.Height = HeightWidthRing;
                _curentRow.Width = canvas.Width;
                _curentRow.SetValue(Canvas.TopProperty, Convert.ToDouble(i * HeightWidthRing));
                canvas.Children.Add(_curentRow);
                _currentRows.Add(_curentRow);

            }
            Canva = canvas;

            for (int i = 1; i < _currentRows.Count; i++)
            {
                var _curentRow = _currentRows[i];
                _curentRow.SetValue(Canvas.TopProperty, Convert.ToDouble((i + 1) * HeightWidthRing));
            }
            _currentActiveRow = _currentRows[0];

            ButtonsCanvas = new Canvas();
            ButtonsCanvas.Height = size.Height;
            var heightButton = size.Height / 9; //9 потому что 9 кнопок
            ButtonsCanvas.Width = heightButton;
            for (int i = 1; i < 10; i++)
            {
                var button = new NumberButton() { Number = $"{i}", Height = heightButton, Width = heightButton };

                button.SetValue(Canvas.TopProperty, (i - 1) * heightButton);
                button.SetValue(FontSizeProperty, 50.0);
                ButtonsCanvas.Children.Add(button);
                _buttons.Add(button);
            }
            _buttons[_indexCurrentButton].IsActive = true;

        }

        private bool _isCompleted = false;
        private void _timer_Tick(object sender, EventArgs e)
        {
            _timer.Stop();
            IsButtonBlock = true;
            _isCompleted = true;
            ReturnResult();
        }

        public void PressUpButton()
        {
            if (_isButtonsEnabled)
            {
                if (!IsButtonBlock && !_isCompleted)
                {
                    _buttons[_indexCurrentButton].IsActive = false;
                    _indexCurrentButton--;
                    if (_indexCurrentButton < 0)
                        _indexCurrentButton = 0;
                    _buttons[_indexCurrentButton].IsActive = true;
                }
            }
        }

        public void PressDownButton()
        {
            if (_isButtonsEnabled)
            {
                if (!IsButtonBlock && !_isCompleted)
                {
                    _buttons[_indexCurrentButton].IsActive = false;
                    _indexCurrentButton++;
                    if (_indexCurrentButton > _buttons.Count - 1)
                        _indexCurrentButton = _buttons.Count - 1;
                    _buttons[_indexCurrentButton].IsActive = true;
                }
            }
        }

        private List<RowResult> _results = new List<RowResult>();

        public void PressEnter(int time)
        {
            if (_isButtonsEnabled)
            {
                if (!IsButtonBlock && !_isCompleted)
                {
                    var errors = Math.Abs(Convert.ToInt32(_buttons[_indexCurrentButton].Number) - _currentActiveRow.CountRightCircles);
                    if (errors != 0)
                    {
                        if (Mode != TestMode.Manual)
                            Message = "Неправильный ответ!";
                    }

                    _results.Add(new RowResult(
                        _indexCurrentRow + 1,
                        (TimeSpan.FromSeconds(time / 10000.0)).TotalSeconds, errors));

                    PlayAnimationCurrentRow();
                    _buttons[_indexCurrentButton].IsActive = false;
                    _indexCurrentButton = 4;
                    _buttons[_indexCurrentButton].IsActive = true;
                    _indexCurrentRow++;
                }

                if (_indexCurrentRow == _rowsRings.Count)
                {
                    _timer.Stop();
                    IsButtonBlock = true;
                    _isCompleted = true;
                    ReturnResult();
                }
            }
        }

        #region animation
        private void ReturnResult()
        {
            var timeQuest = DateTime.Now - _startQuest;
            var countReviewedRows = _indexCurrentRow;
            var totalErrors = _results.Select(f => f.Errors).Sum();

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Время выполнения теста"] = (int)timeQuest.TotalSeconds,
                ["Количество просмотренных строк"] = countReviewedRows,
                ["Время просмотра каждой строки"] = _results.Select(s => (float)s.Time).ToArray(),
                ["Количество ошибок в каждой строке"] = _results.Select(s => (float)s.Errors).ToArray(),
                ["Допущено ошибок"] = totalErrors
                //["Время и количество ошибок в каждой строке"] = _results
            });
        }

        private void PlayAnimationCurrentRow()
        {
            if (_currentRows.Count != 0)
            {
                IsButtonBlock = true;
                Storyboard animationCurrentRow = new Storyboard();

                DoubleAnimationUsingKeyFrames DAUKF = new DoubleAnimationUsingKeyFrames();
                EasingDoubleKeyFrame EDKFStart = new EasingDoubleKeyFrame(Canvas.GetTop(_currentActiveRow), new TimeSpan(0, 0, 0));
                EasingDoubleKeyFrame EDKFEnd = new EasingDoubleKeyFrame(-_currentActiveRow.Height, TimeSpan.FromSeconds(0.5));
                DAUKF.KeyFrames.Add(EDKFStart);
                DAUKF.KeyFrames.Add(EDKFEnd);
                Storyboard.SetTarget(DAUKF, _currentActiveRow);
                Storyboard.SetTargetProperty(DAUKF, new PropertyPath(Canvas.TopProperty));

                if (_currentRows.Count > 1)
                {
                    var newCurrentRow = _currentRows[1];
                    DoubleAnimationUsingKeyFrames DAUKFStart = new DoubleAnimationUsingKeyFrames();
                    EasingDoubleKeyFrame S_EDKFStart = new EasingDoubleKeyFrame(Canvas.GetTop(newCurrentRow), new TimeSpan(0, 0, 0));
                    EasingDoubleKeyFrame S_EDKFEnd = new EasingDoubleKeyFrame(Canvas.GetTop(newCurrentRow) - 2 * newCurrentRow.Height, new TimeSpan(0, 0, 1));
                    DAUKFStart.KeyFrames.Add(S_EDKFStart);
                    DAUKFStart.KeyFrames.Add(S_EDKFEnd);
                    Storyboard.SetTarget(DAUKFStart, newCurrentRow);
                    Storyboard.SetTargetProperty(DAUKFStart, new PropertyPath(Canvas.TopProperty));
                    animationCurrentRow.Children = new TimelineCollection() { DAUKF, DAUKFStart };
                }
                else
                    animationCurrentRow.Children = new TimelineCollection() { DAUKF };

                animationCurrentRow.Completed += PlayAnimationCurrentRow_Completed;
                animationCurrentRow.Begin();
            }
        }

        private void PlayAnimationCurrentRow_Completed(object sender, EventArgs e)
        {
            (sender as ClockGroup).Completed -= PlayAnimationCurrentRow_Completed;
            _currentRows.Remove(_currentRows.First());
            if (_currentRows.Count != 0)
            {
                _currentActiveRow = _currentRows[0];
                PlayOffsetAnimaion();
            }
            if (_rowsRings.IndexOf(_currentActiveRow) == _rowsRings.IndexOf(_rowsRings.Last()))
            {
                IsButtonBlock = false;
            }
        }

        private void PlayOffsetAnimaion()
        {
            Storyboard animationCurrentRow = new Storyboard();
            animationCurrentRow.Children = new TimelineCollection();
            for (int i = 1; i < _currentRows.Count; i++)
            {
                var row = _currentRows[i];
                DoubleAnimationUsingKeyFrames DAUKF = new DoubleAnimationUsingKeyFrames();
                EasingDoubleKeyFrame EDKFStart = new EasingDoubleKeyFrame(Canvas.GetTop(row), new TimeSpan(0, 0, 0));
                EasingDoubleKeyFrame EDKFEnd = new EasingDoubleKeyFrame(Canvas.GetTop(row) - row.Height, new TimeSpan(0, 0, 1));
                DAUKF.KeyFrames.Add(EDKFStart);
                DAUKF.KeyFrames.Add(EDKFEnd);
                Storyboard.SetTarget(DAUKF, row);
                Storyboard.SetTargetProperty(DAUKF, new PropertyPath(Canvas.TopProperty));
                animationCurrentRow.Children.Add(DAUKF);
            }
            animationCurrentRow.Completed += PlayOffsetAnimation_Completed;
            animationCurrentRow.Begin();
        }

        private void PlayOffsetAnimation_Completed(object sender, EventArgs e)
        {
            (sender as ClockGroup).Completed -= PlayOffsetAnimation_Completed;
            PlayLastRowShowed();
        }

        private void PlayLastRowShowed()
        {
            if (_indexLastShowedRow < _rowsRings.Count - 1)
            {
                _indexLastShowedRow++;
                var _currentRowRings = _rowsRings[_indexLastShowedRow];
                _currentRowRings.Loaded += _currentRowRings_Loaded;
                _currentRowRings.Height = HeightWidthRing;
                _currentRowRings.Width = Canva.Width;
                _currentRowRings.Opacity = 0.0;
                _currentRowRings.SetValue(Canvas.TopProperty, Convert.ToDouble(10 * HeightWidthRing));
                Canva.Children.Add(_currentRowRings);
                _currentRows.Add(_currentRowRings);
            }
            else
            {
                IsButtonBlock = false;
            }
        }

        private void _currentRowRings_Loaded(object sender, RoutedEventArgs e)
        {
            var rowRings = sender as RowRings;
            rowRings.Loaded -= _currentRowRings_Loaded;
            Storyboard _opacityLastRowAnimation = new Storyboard();
            DoubleAnimationUsingKeyFrames DAUKF = new DoubleAnimationUsingKeyFrames();
            EasingDoubleKeyFrame EDKFStart = new EasingDoubleKeyFrame(0.0, new TimeSpan(0, 0, 0));
            EasingDoubleKeyFrame EDKFEnd = new EasingDoubleKeyFrame(1.0, new TimeSpan(0, 0, 1));
            DAUKF.KeyFrames.Add(EDKFStart);
            DAUKF.KeyFrames.Add(EDKFEnd);
            Storyboard.SetTarget(DAUKF, rowRings);
            Storyboard.SetTargetProperty(DAUKF, new PropertyPath(OpacityProperty));
            _opacityLastRowAnimation.Children = new TimelineCollection() { DAUKF };
            _opacityLastRowAnimation.Completed += _opacityLastRowAnimation_Completed;
            _opacityLastRowAnimation.Begin();
        }

        private void _opacityLastRowAnimation_Completed(object sender, EventArgs e)
        {
            var clockGroup = sender as ClockGroup;
            var sB = (clockGroup.Timeline as Storyboard);
            var row = Storyboard.GetTarget(sB.Children.First()) as RowRings;

            clockGroup.Completed -= _opacityLastRowAnimation_Completed;
            row.Opacity = 1.0;
            IsButtonBlock = false;
        }
        #endregion
    }
    public class RowResult
    {
        public int NumberRow { get; private set; }
        public double Time { get; private set; }
        public int Errors { get; private set; }
        public RowResult(int numberRow, double time, int errors)
        {
            NumberRow = numberRow;
            Time = time;
            Errors = errors;
        }
    }
}


*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ConcentrationAttention\ConcentrationAttentionViewModel.cs

using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.ConcentrationAttention
{
    public class ConcentrationAttentionViewModel : TestBase
    {
        public override event EventHandler<Results> Results;

        private PultButtons Buttons;
        public ConcentrationAttentionControl control;
        public ConcentrationAttentionViewModel(EnumTests testType, PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("concentrationAttention");
            TestType = testType;
            Manager.TraningTime = Common.GetSeconds(60);
        }

        public override FrameworkElement GetTestControl()
        {
            return new ConcentrationAttentionControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new ConcentrationAttentionControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            control = new ConcentrationAttentionControl();
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start(true);
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception=e.Exception});
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        public override void Start()
        {
            control = new ConcentrationAttentionControl();
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.Results += TestCurrentView_Results;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start();
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void TestCurrentView_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Buttons_ButtonPressed(object sender, Pult.ButtonPressedEventArgs e)
        {
            switch (e.Button)
            {
                case PultButton.Yellow:
                    control.PressUpButton();
                    break;
                case PultButton.Red:
                    control.PressEnter(e.Time);
                    break;
                case PultButton.Black:
                    control.PressDownButton();
                    break;
            }
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.Results -= TestCurrentView_Results;
                control.ResetTimer -= Control_ResetTimer;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ConcentrationAttention\NumberButton.cs


namespace Updk7.Tests.Wpf.Psychophysical.ConcentrationAttention
{
    public class NumberButton:NotifyViewModelBase
    {
        private string _number;
        public string Number
        {
            get { return _number; }
            set
            {
                _number = value;
                OnPropertyChanged();
            }
        }

        private bool _isActive;
        public bool IsActive
        {
            get { return _isActive; }
            set
            {
                _isActive = value;
                OnPropertyChanged();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ConcentrationAttention\Ring.cs


using System;
using System.Windows;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.ConcentrationAttention
{
    public class Ring:NotifyViewModelBase
    {
        public double Angle
        {
            get { return (double)GetValue(AngleProperty); }
            set { SetValue(AngleProperty, value); }
        }

        public static readonly DependencyProperty AngleProperty =
            DependencyProperty.Register("Angle", typeof(double), typeof(Ring), new PropertyMetadata(0.0, AngleFieldChanged));

        private static void AngleFieldChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue != null && e.NewValue != e.OldValue)
                (d as Ring).CurrentAngle = Convert.ToDouble(e.NewValue);
        }

        public Brush RingColor
        {
            get { return (Brush)GetValue(RingColorProperty); }
            set { SetValue(RingColorProperty, value); }
        }

        public static readonly DependencyProperty RingColorProperty =
            DependencyProperty.Register("RingColor", typeof(Brush), typeof(Ring), new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFDAE3F2"))));

        private double _currentAngle;
        public double CurrentAngle
        {
            get { return _currentAngle; }
            set
            {
                _currentAngle = value;
                OnPropertyChanged();
            }
        }
    }
 }


*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ConcentrationAttention\RowRings.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;

namespace Updk7.Tests.Wpf.Psychophysical.ConcentrationAttention
{
    public class RowRings : NotifyViewModelBase
    {
        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public int CountRightCircles { get; private set; }
        private int _countSame = 1;
        public RowRings(int countSame = 1, TestMode mode = TestMode.Normal)
        {
            _countSame = countSame;
            generateRowRings(mode);
        }
        
        private List<double> _angles = new List<double>() { 45, 135, 225, 315 };
        public List<Ring> Rings = new List<Ring>();

        private void generateRowRings(TestMode mode = TestMode.Normal)
        {
            double HeightWidth = 120;
            var c = new Canvas();
            c.Width = HeightWidth * 30;
            c.Height = HeightWidth;
            var angleMain = _angles[Common._rnd.Next(0, 4)];
            var ring = new Ring();
            if (mode != TestMode.Manual)
                ring.Angle = angleMain;
            else if (mode == TestMode.Manual)
                ring.Angle = _angles[0];

            if (mode != TestMode.Manual)
            {
                var moddedAngles = _angles.Where(w => w != angleMain).ToList();

                int index = 0;
                for (int i = 0; i < 29; i++)
                {
                    var curRing = new Ring();
                    curRing.Angle = moddedAngles[index];
                    Rings.Add(curRing);
                    index++;
                    if (index == moddedAngles.Count)
                        index = 0;
                }

                Common.Shuffle(Rings);

                List<int> indexes = new List<int>();//индексы в строке
                for (int i = 0; i < _countSame - 1; i++)
                {
                    while (true)
                    {
                        var possibleIndex = Common._rnd.Next(0, 29);
                        if (!indexes.Any(a => a == possibleIndex) && possibleIndex != 0)
                        {
                            if (!indexes.Any(a => a == possibleIndex - 1) && !indexes.Any(a => a == possibleIndex + 1))
                            {
                                indexes.Add(possibleIndex);
                                break;
                            }
                        }
                    }
                }

                foreach (var curIndex in indexes)
                    Rings[curIndex].Angle = angleMain;

                Rings.Insert(0, ring);
            }
            else
            {
                Rings.Add(ring);
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[0]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[0]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[0]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[0]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                Rings.Add(CreateRing(_angles[1]));
                _countSame = 5;
            }

            for (int i = 0; i < Rings.Count; i++)
            {
                Rings[i].SetValue(Canvas.LeftProperty, Convert.ToDouble(i * HeightWidth));
                c.Children.Add(Rings[i]);
            }

            CountRightCircles = _countSame;

            Canva = c;
        }

        private Ring CreateRing(double angle)
        {
            return new Ring
            {
                Angle = angle
            };
        }
    }
}


*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ConcentrationAttention\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.ConcentrationAttention"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    <Style TargetType="local:NumberButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:NumberButton">
                    <ContentControl>
                        <Grid Margin="1">
                            <Rectangle x:Name="backRect" Fill="#FF4E73B3"/>
                            <TextBlock x:Name="tbxNumber" 
                                           HorizontalAlignment="Center"
                                           VerticalAlignment="Center"
                                           TextAlignment="Center"
                                           Text="{Binding Number, RelativeSource={RelativeSource FindAncestor, 
                                    AncestorType={x:Type local:NumberButton}}}" Foreground="#FFFEFEFE"/>
                            <Border Margin="0" x:Name="border" BorderBrush="#FFC040" BorderThickness="2" Visibility="Hidden" />
                        </Grid>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource Self}}" Value="true">
                            <Setter TargetName="tbxNumber" Property="Foreground" Value="LightGreen"/>
                            <Setter TargetName="border" Property="Visibility" Value="Visible"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:Ring">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Ring">
                    <Grid>
                        <Path Height="100"
                              Width="100"
                              Data="M35,0 L35,16.079163 34.826054,16.16038 C23.095163,21.812901 15,33.815586 15.000001,
                              47.709 15,67.038964 30.670034,82.709 50,82.709 69.329964,82.709 85,67.038964 85,47.709 85,33.815586 76.904839,
                              21.812901 65.173943,16.16038 L65,16.079163 65,0 66.036453,0.33649653 C85.784821,
                              7.0193107 100,25.704197 100,47.709202 100,75.323326 77.614235,97.709 50,97.709 22.385763,97.709 -7.4505797E-07,
                              75.323326 2.928796E-14,47.709202 -7.4505797E-07,25.704197 14.215178,7.0193107 33.963543,0.33649653 z" 
                              Fill="{TemplateBinding RingColor}"
                              Stretch="Fill"
                              RenderTransformOrigin="0.5,0.5">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform/>
                                    <SkewTransform/>
                                    <RotateTransform Angle="{Binding CurrentAngle, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Ring}}}"/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:RowRings">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:RowRings">
                    <Viewbox>
                        <ContentControl Margin="20,0,0,0" Content="{Binding Canva, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:RowRings}}}"/>
                    </Viewbox>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ConcentrationAttentionControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ConcentrationAttentionControl">
                    <Border Background="{TemplateBinding Background}">
                        <Viewbox>
                            <Grid Width="1920"
                                  Height="1080">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Viewbox>
                                    <ContentControl Content="{Binding Canva, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ConcentrationAttentionControl}}}"/>
                                </Viewbox>
                                <Viewbox Grid.Column="1" Margin="15">
                                    <Grid>
                                        <ContentControl Content="{Binding ButtonsCanvas, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ConcentrationAttentionControl}}}"/>
                                        <Border Background="#5AFF7A7A" Visibility="{Binding IsButtonBlock, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ConcentrationAttentionControl}},Converter={StaticResource BooleanToVisibilityConverter}}"/>
                                    </Grid>
                                </Viewbox>
                                <tests:MessageBoxControl Message="{Binding Message, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ConcentrationAttentionControl}}}"/>
                                <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:ConcentrationAttentionControl}}}">
                                    <ContentPresenter.Resources>
                                        <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                            <panels:CanvasPanelView Margin="5"
                                                                    DataContext="{Binding}"
                                                                    Background="{Binding Background}"
                                                                    BorderBrush="{Binding BorderBrush}"
                                                                    BorderThickness="{Binding BorderThickness}"/>
                                        </DataTemplate>
                                    </ContentPresenter.Resources>
                                </ContentPresenter>
                            </Grid>
                        </Viewbox>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ConcentrationAttentionViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ConcentrationAttentionViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                RelativeSource={RelativeSource FindAncestor,
                                AncestorType={x:Type local:ConcentrationAttentionViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Controls\BooleanToMediaStateConverter.cs

using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Psychophysical.Controls
{
    public class BooleanToMediaStateConverter : MarkupExtension, IValueConverter
    {
        private static BooleanToMediaStateConverter _converter;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var boolValue = (bool)value;
            if (boolValue)
                return MediaPlayerState.Restart;
            else
                return MediaPlayerState.Stop;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new BooleanToMediaStateConverter();
            return _converter;

        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Controls\InstructionsMediaPlayer.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.Controls.InstructionsMediaPlayer"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid>
        <MediaElement Name="playerElement"
                      Stretch="Uniform"
                      ScrubbingEnabled="True"
                      MediaEnded="playerElement_MediaEnded"
                      MediaOpened="playerElement_MediaOpened" LoadedBehavior="Manual"
                      MediaFailed="playerElement_MediaFailed"/>
    </Grid>
</UserControl>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Controls\InstructionsMediaPlayer.xaml.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.Controls
{
    public partial class InstructionsMediaPlayer : UserControl, INotifyPropertyChanged
    {
        public string InstructionName
        {
            get { return (string)GetValue(InstructionNameProperty); }
            set { SetValue(InstructionNameProperty, value); }
        }

        public static readonly DependencyProperty InstructionNameProperty =
            DependencyProperty.Register("InstructionName", typeof(string), typeof(InstructionsMediaPlayer), new PropertyMetadata("", InstructionNameChanged));

        private static void InstructionNameChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var player = (d as InstructionsMediaPlayer);
            var newPath = e.NewValue.ToString();
            player.FilePath = newPath;
        }

        public bool EndFile
        {
            get { return (bool)GetValue(EndFileProperty); }
            set { SetValue(EndFileProperty, value); }
        }

        public static readonly DependencyProperty EndFileProperty =
            DependencyProperty.Register("EndFile", typeof(bool), typeof(InstructionsMediaPlayer), new PropertyMetadata(false));



        public MediaPlayerState PlayerState
        {
            get { return (MediaPlayerState)GetValue(PlayerStateProperty); }
            set { SetValue(PlayerStateProperty, value); }
        }

        public static readonly DependencyProperty PlayerStateProperty =
            DependencyProperty.Register("PlayerState", typeof(MediaPlayerState), typeof(InstructionsMediaPlayer), new PropertyMetadata(MediaPlayerState.None, PlayerStateChanged));

        private static void PlayerStateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var player = (d as InstructionsMediaPlayer);
            var state = (MediaPlayerState)e.NewValue;
            switch (state)
            {
                case MediaPlayerState.Play:
                    player.Play();
                    break;
                case MediaPlayerState.Stop:
                    player.Stop();
                    break;
                case MediaPlayerState.Restart:
                    player.Restart();
                    break;
                case MediaPlayerState.None:
                    player.Stop();
                    break;
            }
        }

        private string filePath;

        public string FilePath
        {
            get { return filePath; }
            set
            {
                filePath = value;
                OnPropertyChanged();
            }
        }

        public InstructionsMediaPlayer()
        {
            InitializeComponent();
        }

        public void Play()
        {
            if (!string.IsNullOrEmpty(filePath))
            {
                playerElement.Stop();
                playerElement.Position = new TimeSpan(0, 0, 0);
                playerElement.Play();
            }
        }

        public void Stop()
        {
            playerElement.Stop();
        }

        public void Restart()
        {
            if (!string.IsNullOrEmpty(filePath))
            {
                var path = new Uri($@"{filePath}", UriKind.Relative);
                playerElement.Source = path;
                playerElement.Position = new TimeSpan(0, 0, 0);
                playerElement.Play();
            }
        }

        private void playerElement_MediaOpened(object sender, RoutedEventArgs e)
        {
            EndFile = false;
        }

        private void playerElement_MediaEnded(object sender, RoutedEventArgs e)
        {
            EndFile = true;
        }

        private void playerElement_MediaFailed(object sender, ExceptionRoutedEventArgs e)
        {

        }

        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged([CallerMemberName] string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Controls\MapTestTypeToMediaFile.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Updk7.Tests.Wpf.Psychophysical;

namespace Updk7.Tests.Wpf.Psychophysical.Controls
{
    public static class MapTestTypeToMediaFile
    {
        public static Dictionary<EnumTests, string> TestTypeToString = new Dictionary<EnumTests, string>() 
        {
            [EnumTests.AssessmentOfPropensityToTakeRisks] = "VideoResources/OSR.mp4",
            [EnumTests.EmotionalStability] = "VideoResources/EU.mp4",
            [EnumTests.ReadinessAssessmentTesting] = "VideoResources/GKT.mp4",
            [EnumTests.ConcentrationAttention] = "VideoResources/KV.mp4",
            [EnumTests.VigilanceAssessment] = "VideoResources/OB.mp4",
            [EnumTests.EstimationOfStabilityOfAttention] = "VideoResources/ODR.mp4",
            [EnumTests.AccurateEye] = "VideoResources/OG.mp4",
            [EnumTests.EstimationOfStabilityToMonotonistance] = "VideoResources/OMU.mp4",
            [EnumTests.LevelOfPerceptionOfSpeedAndDistance] = "VideoResources/UVSR.mp4"
        };
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Controls\MediaPlayerState.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.Controls
{
    public enum MediaPlayerState
    {
        Play,
        Stop,
        Restart,
        None
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Controls\SubMenuButton.cs

using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.Controls
{
    public class SubMenuButton : Button
    {
        public Brush RectangleFill
        {
            get { return (Brush)GetValue(RectangleFillProperty); }
            set { SetValue(RectangleFillProperty, value); }
        }

        public static readonly DependencyProperty RectangleFillProperty =
            DependencyProperty.Register("RectangleFill", typeof(Brush), typeof(SubMenuButton), new PropertyMetadata(null));

        public string Description
        {
            get { return (string)GetValue(DescriptionProperty); }
            set { SetValue(DescriptionProperty, value); }
        }

        public static readonly DependencyProperty DescriptionProperty =
            DependencyProperty.Register("Description", typeof(string), typeof(SubMenuButton), new PropertyMetadata(""));


    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Controls\TextTimerViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;

namespace Updk7.Tests.Wpf.Psychophysical.Controls
{
    public class TextTimerViewModel : NotifyBase
    {
        private string text;

        public string Text
        {
            get { return text; }
            set 
            { 
                text = value;
                OnPropertyChanged();
                IsTextChanged = false;
                IsTextChanged = true;
            }
        }

        private bool _isTextChanged;

        public bool IsTextChanged
        {
            get { return _isTextChanged; }
            set 
            { 
                _isTextChanged = value; 
                OnPropertyChanged(); 
            }
        }

        private TimeSpan _interval = TimeSpan.FromSeconds(1.0);

        public TimeSpan Interval
        {
            get { return _interval; }
            set 
            {
                _interval = value;
                _timer.Interval = _interval;
                OnPropertyChanged();
            }
        }

        private DispatcherTimer _timer = new DispatcherTimer();
        private List<string> _texts;
        public TextTimerViewModel(List<string> texts)
        {
            _texts = texts;
            _timer.Interval = Interval;
            _timer.Tick += _timer_Tick;
        }

        public void Start()
        {
            counter = 0;
            _timer.Start();
        }

        public void Stop()
        {
            counter = 0;
            Text = "";
            _timer.Stop();
        }

        private int counter = 0;
        private void _timer_Tick(object sender, EventArgs e)
        {
            if (counter < _texts.Count)
            {
                Text = _texts[counter];
                counter++;
            }
            else
                Stop();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Converters\BooleanToVisibilityConverterEx.cs


using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Psychophysical.Converters
{
    public class BooleanToVisibilityConverterEx : MarkupExtension, IValueConverter
    {
        private static BooleanToVisibilityConverterEx _converter;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var boolValue = (bool)value;
            if (boolValue)
                return Visibility.Visible;
            else
                return Visibility.Hidden;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var visibilityValue = (Visibility)value;
            if (visibilityValue == Visibility.Visible)
                return true;
            else
                return false;
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new BooleanToVisibilityConverterEx();
            return _converter;

        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Converters\StringOrEmptyConverter.cs


using System;
using System.Globalization;
using System.Windows.Data;

namespace Updk7.Tests.Wpf.Psychophysical.Converters
{
    public class StringOrEmptyConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                return string.IsNullOrEmpty(value.ToString());
            }
            return true;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Converters\TestConverter.cs


using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Psychophysical.Converters
{
    public class TestConverter : MarkupExtension, IValueConverter
    {
        private TestConverter _converter;
        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new TestConverter();
            return _converter;
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\CorrectiveTestSample\CorrectiveTestSampleControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.CorrectiveTestSample
{
    public class CorrectiveTestSampleControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;

        #region Fields and Properties
        private Canvas _canva;

        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public Canvas _buttonsCanvas;

        public Canvas ButtonsCanvas
        {
            get { return _buttonsCanvas; }
            set
            {
                _buttonsCanvas = value;
                OnPropertyChanged();
            }
        }

        private bool _isButtonBlock;

        public bool IsButtonBlock
        {
            get { return _isButtonBlock; }
            set
            {
                if (_isButtonBlock != value && !value)
                    _startTime = DateTime.Now;
                _isButtonBlock = value;

                OnPropertyChanged();
            }
        }
        public bool IsBoundedCursor { get; set; } = false;

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private Random rnd = new Random();
        private string _message;

        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (_isShowedMessages)
                {
                    if (_message != "")
                    {
                        _isButtonsEnabled = false;
                        _timer.Stop();
                        _messageTimer.Start();
                    }
                    OnPropertyChanged();
                }
            }
        }

        private bool _isButtonsEnabled = true;
        private bool _isShowedMessages = false;

        private DispatcherTimer _messageTimer = new DispatcherTimer();
        private int _indexCurrentRow = 0;
        private int _indexLastShowedRow = 0;
        private List<RowLetters> _currentRows = new List<RowLetters>();
        private List<NumberButton> _buttons = new List<NumberButton>();
        private RowLetters _currentActiveRow;
        private double HeightWidthRing;
        private DateTime _startQuest;
        private DateTime _startTime;
        private DispatcherTimer _timer = new DispatcherTimer();
        #endregion
        public CorrectiveTestSampleControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            generateScene(new Size(500, 500));
            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("FirstRing", () => FirstLetter());
                TestMethods.Add("AllCorrectRings", () => AllCorrectLetters());
                TestMethods.Add("AllCorrectClear", () => AllCorrectClear());
                TestMethods.Add("ClickButton", () => ClickButton());
            }
        }

        public void Start(bool isTestQuest = false)
        {
            _isShowedMessages = isTestQuest;
            if (_isShowedMessages)
            {
                _messageTimer.Tick += _messageTimer_Tick;
                _messageTimer.Interval = TimeSpan.FromSeconds(1.5);
            }
        }

        #region Use only in ILearning interface
        private void FirstLetter()
        {
            Letter firstLetter = _currentActiveRow.Letters[0];
            firstLetter.LetterColor = Brushes.OrangeRed;
        }

        private List<Letter> _correctLetters = new List<Letter>();
        private void AllCorrectLetters()
        {
            Letter firstLetter = _currentActiveRow.Letters[0];
            for (int i = 1; i < _currentActiveRow.Letters.Count; i++)
            {
                if (firstLetter.LetterString == _currentActiveRow.Letters[i].LetterString)
                {
                    Letter correctletter = _currentActiveRow.Letters[i];
                    correctletter.LetterColor = Brushes.LightGreen;
                    _correctLetters.Add(correctletter);
                }
            }
            firstLetter.LetterColor = Brushes.LightGreen;
            _correctLetters.Add(firstLetter);

        }

        private void AllCorrectClear()
        {
            for (int i = 0; i < _correctLetters.Count; i++)
            {
                _correctLetters[i].LetterColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFDAE3F2"));
            }
        }

        private void ClickButton()
        {
            PressEnter(5);
        }

        #endregion

        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _messageTimer.Stop();
            if(Mode!= TestMode.Manual)
            _timer.Start();
            _isButtonsEnabled = true;
        }

        public void Stop()
        {
            _isButtonBlock = true;
            _isCompleted = true;
            _timer.Stop();
            _timer.Tick -= _timer_Tick;
            Common.UnClipMouse();
        }

        private List<RowLetters> _rowsRings = new List<RowLetters>();

        private void generateLearningRowRings()
        {
            int j = 0;
            int[] countInRowsSameCircles = GenerateCountsSameLettersIn5Strocks();
            for (int i = 0; i < 35; i++)
            {
                j++;
                if (i == 0)
                {
                    var rRings = new RowLetters(countInRowsSameCircles[j - 1], TestMode.Manual);
                    _rowsRings.Add(rRings);
                }
                else
                {
                    var rRings = new RowLetters(countInRowsSameCircles[j - 1]);
                    _rowsRings.Add(rRings);
                }
                if (j == 5)
                {
                    countInRowsSameCircles = GenerateCountsSameLettersIn5Strocks();
                    j = 0;
                }
            }
        }

        private void generateRowRings()
        {
            int j = 0;
            int[] countInRowsSameCircles = GenerateCountsSameLettersIn5Strocks();
            for (int i = 0; i < 35; i++)
            {
                j++;
                var rRings = new RowLetters(countInRowsSameCircles[j - 1]);
                _rowsRings.Add(rRings);
                if (j == 5)
                {
                    countInRowsSameCircles = GenerateCountsSameLettersIn5Strocks();
                    j = 0;
                }
            }
        }

        private int[] GenerateCountsSameLettersIn5Strocks()
        {
            var counts = new List<int>() { 9, 9, 9, 9, 9 };
            int countIn5Strocks = 27;
            for (int i = 0; i < 5; i++)
            {
                var value = rnd.Next(0, 8);
                counts[i] = counts[i] - value;
            }
            while (true)
            {
                var sum = counts.Sum();
                if (sum == countIn5Strocks)
                    break;
                else if (sum < countIn5Strocks)
                {
                    var min = counts.Min();
                    var newValue = min + 1;
                    counts[counts.IndexOf(min)] = newValue;
                }
                else if (sum > countIn5Strocks)
                {
                    var max = counts.Max();
                    var newValue = max - 1;
                    counts[counts.IndexOf(max)] = newValue;
                }
            }
            return counts.ToArray();
        }

        private void generateScene(Size size)
        {
            _timer.Interval = TimeSpan.FromMinutes(5);
            _timer.Tick += _timer_Tick;
            HeightWidthRing = size.Width / 30;
            if (Mode != TestMode.Manual)
                generateRowRings();
            else
            {
                generateLearningRowRings();
            }

            var canvas = new Canvas();
            canvas.ClipToBounds = true;
            canvas.Height = HeightWidthRing * 12;
            canvas.Width = HeightWidthRing * 30;
            //генерация начального состояния
            for (int i = 0; i < 10; i++)
            {
                var _curentRow = _rowsRings[i];
                _curentRow.Height = HeightWidthRing;
                _curentRow.Width = canvas.Width;
                _curentRow.SetValue(Canvas.TopProperty, Convert.ToDouble(i * HeightWidthRing));
                canvas.Children.Add(_curentRow);
                _currentRows.Add(_curentRow);
                _indexLastShowedRow++;
            }
            Canva = canvas;

            for (int i = 1; i < _currentRows.Count; i++)
            {
                var _curentRow = _currentRows[i];
                _curentRow.SetValue(Canvas.TopProperty, Convert.ToDouble((i + 1) * HeightWidthRing));
            }
            _currentActiveRow = _currentRows[0];

            var canvasButton = new Canvas();
            canvasButton.Height = size.Height;
            var heightButton = size.Height / 9; //9 потому что 9 кнопок
            canvasButton.Width = heightButton;
            for (int i = 1; i < 10; i++)
            {
                var button = new NumberButton() { Number = $"{i}", Height = heightButton, Width = heightButton };
                button.ReturnNumberButton += Button_ReturnNumberButton;
                button.SetValue(Canvas.TopProperty, (i - 1) * heightButton);
                button.SetValue(FontSizeProperty, 50.0);
                canvasButton.Children.Add(button);
                _buttons.Add(button);
            }
            _startQuest = DateTime.Now;
            _startTime = DateTime.Now;
            ButtonsCanvas = canvasButton;
            ButtonsCanvas.Loaded += ButtonsCanvas_Loaded;
            if (Mode != TestMode.Manual)
                _timer.Start();
            else
            {
                ButtonsCanvas.IsHitTestVisible = false;
            }
           
        }

        private void ButtonsCanvas_Loaded(object sender, RoutedEventArgs e)
        {
            SetPosition();
            ButtonsCanvas.Loaded -= ButtonsCanvas_Loaded;
        }

        private void Button_ReturnNumberButton(object sender, int e)
        {
            PressEnter(e);
        }

        private bool _isCompleted = false;

        private void _timer_Tick(object sender, EventArgs e)
        {
            _timer.Stop();
            IsButtonBlock = true;
            _isCompleted = true;
            ReturnResult();
        }

        private List<RowResult> _results = new List<RowResult>();
        public void PressEnter(int numberButton)
        {
            if (_isButtonsEnabled)
            {
                if (!IsButtonBlock && !_isCompleted)
                {
                    var errors = Math.Abs(Convert.ToInt32(numberButton) - _currentActiveRow.CountRightLetters);
                    if (errors != 0)
                        Message = "Неправильный ответ!";
                    _results.Add(new RowResult(
                        _indexCurrentRow + 1,
                        (DateTime.Now - _startTime).TotalSeconds, errors));
                    PlayAnimationCurrentRow();
                    _indexCurrentRow++;
                    SetPosition();
                    if (_indexCurrentRow == _rowsRings.Count)
                    {
                        _timer.Stop();
                        IsButtonBlock = true;
                        _isCompleted = true;
                        ReturnResult();
                    }
                   
                }
            }
        }

        private void ReturnResult()
        {
            var timeQuest = DateTime.Now - _startQuest;
            var countReviewedRows = _indexCurrentRow;
            var totalErrors = _results.Select(f => f.Errors).Sum();

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Время выполнения теста"] = (float)timeQuest.TotalSeconds,
                ["Количество просмотренных строк"] = countReviewedRows,
                ["Количество ошибок"] = totalErrors,
                ["Время просмотра каждой строки"] = _results.Select(f => (float)f.Time).ToArray(),
                ["Количество ошибок в каждой строке"] = _results.Select(f => f.Errors).ToArray()
            });
        }

        private void PlayAnimationCurrentRow()
        {
            if (_currentRows.Count != 0)
            {
                IsButtonBlock = true;
                Storyboard animationCurrentRow = new Storyboard();

                DoubleAnimationUsingKeyFrames DAUKF = new DoubleAnimationUsingKeyFrames();
                EasingDoubleKeyFrame EDKFStart = new EasingDoubleKeyFrame(Canvas.GetTop(_currentActiveRow), new TimeSpan(0, 0, 0));
                EasingDoubleKeyFrame EDKFEnd = new EasingDoubleKeyFrame(-_currentActiveRow.Height, TimeSpan.FromSeconds(0.5));
                DAUKF.KeyFrames.Add(EDKFStart);
                DAUKF.KeyFrames.Add(EDKFEnd);
                Storyboard.SetTarget(DAUKF, _currentActiveRow);
                Storyboard.SetTargetProperty(DAUKF, new PropertyPath(Canvas.TopProperty));

                if (_currentRows.Count > 1)
                {
                    var newCurrentRow = _currentRows[1];
                    DoubleAnimationUsingKeyFrames DAUKFStart = new DoubleAnimationUsingKeyFrames();
                    EasingDoubleKeyFrame S_EDKFStart = new EasingDoubleKeyFrame(Canvas.GetTop(newCurrentRow), new TimeSpan(0, 0, 0));
                    EasingDoubleKeyFrame S_EDKFEnd = new EasingDoubleKeyFrame(Canvas.GetTop(newCurrentRow) - 2 * newCurrentRow.Height, new TimeSpan(0, 0, 1));
                    DAUKFStart.KeyFrames.Add(S_EDKFStart);
                    DAUKFStart.KeyFrames.Add(S_EDKFEnd);
                    Storyboard.SetTarget(DAUKFStart, newCurrentRow);
                    Storyboard.SetTargetProperty(DAUKFStart, new PropertyPath(Canvas.TopProperty));
                    animationCurrentRow.Children = new TimelineCollection() { DAUKF, DAUKFStart };
                }
                else
                    animationCurrentRow.Children = new TimelineCollection() { DAUKF };

                animationCurrentRow.Completed += PlayAnimationCurrentRow_Completed;
                animationCurrentRow.Begin();
            }
        }

        private void PlayAnimationCurrentRow_Completed(object sender, EventArgs e)
        {
            (sender as ClockGroup).Completed -= PlayAnimationCurrentRow_Completed;
            _currentRows.Remove(_currentRows.First());
            if (_currentRows.Count != 0)
            {
                _currentActiveRow = _currentRows[0];
                PlayOffsetAnimaion();
            }
            if (_currentRows.Count < 2)
                IsButtonBlock = false;
        }

        private void PlayOffsetAnimaion()
        {
            Storyboard animationCurrentRow = new Storyboard();
            animationCurrentRow.Children = new TimelineCollection();
            for (int i = 1; i < _currentRows.Count; i++)
            {
                var row = _currentRows[i];
                DoubleAnimationUsingKeyFrames DAUKF = new DoubleAnimationUsingKeyFrames();
                EasingDoubleKeyFrame EDKFStart = new EasingDoubleKeyFrame(Canvas.GetTop(row), new TimeSpan(0, 0, 0));
                EasingDoubleKeyFrame EDKFEnd = new EasingDoubleKeyFrame(Canvas.GetTop(row) - row.Height, new TimeSpan(0, 0, 1));
                DAUKF.KeyFrames.Add(EDKFStart);
                DAUKF.KeyFrames.Add(EDKFEnd);
                Storyboard.SetTarget(DAUKF, row);
                Storyboard.SetTargetProperty(DAUKF, new PropertyPath(Canvas.TopProperty));
                animationCurrentRow.Children.Add(DAUKF);
            }
            animationCurrentRow.Completed += PlayOffsetAnimation_Completed;
            animationCurrentRow.Begin();
        }

        private void PlayOffsetAnimation_Completed(object sender, EventArgs e)
        {
            (sender as ClockGroup).Completed -= PlayOffsetAnimation_Completed;
            PlayLastRowShowed();
        }

        private void PlayLastRowShowed()
        {
            if (_indexLastShowedRow != _rowsRings.Count)
            {
                var _currentRowRings = _rowsRings[_indexLastShowedRow];
                _indexLastShowedRow++;
                _currentRowRings.Loaded += _currentRowRings_Loaded;
                _currentRowRings.Height = HeightWidthRing;
                _currentRowRings.Width = Canva.Width;
                _currentRowRings.Opacity = 0.0;
                _currentRowRings.SetValue(Canvas.TopProperty, Convert.ToDouble(10 * HeightWidthRing));
                Canva.Children.Add(_currentRowRings);
                _currentRows.Add(_currentRowRings);
            }
            else
                IsButtonBlock = false;
        }

        private void _currentRowRings_Loaded(object sender, RoutedEventArgs e)
        {
            var rowRings = sender as RowLetters;
            rowRings.Loaded -= _currentRowRings_Loaded;
            Storyboard _opacityLastRowAnimation = new Storyboard();
            DoubleAnimationUsingKeyFrames DAUKF = new DoubleAnimationUsingKeyFrames();
            EasingDoubleKeyFrame EDKFStart = new EasingDoubleKeyFrame(0.0, new TimeSpan(0, 0, 0));
            EasingDoubleKeyFrame EDKFEnd = new EasingDoubleKeyFrame(1.0, new TimeSpan(0, 0, 1));
            DAUKF.KeyFrames.Add(EDKFStart);
            DAUKF.KeyFrames.Add(EDKFEnd);
            Storyboard.SetTarget(DAUKF, rowRings);
            Storyboard.SetTargetProperty(DAUKF, new PropertyPath(OpacityProperty));
            _opacityLastRowAnimation.Children = new TimelineCollection() { DAUKF };
            _opacityLastRowAnimation.Completed += _opacityLastRowAnimation_Completed;
            _opacityLastRowAnimation.Begin();
        }

        [DllImport("User32.dll")]
        private static extern bool SetCursorPos(int X, int Y);

        private void SetPosition()
        {
            if (IsBoundedCursor)
            {
                var p = new Point(ButtonsCanvas.ActualWidth / 2, ButtonsCanvas.ActualHeight / 2);
                Point pointToScreen = ButtonsCanvas.PointToScreen(p);
                SetCursorPos((int)pointToScreen.X, (int)pointToScreen.Y);
                Common.ClipMouse(ButtonsCanvas);
            }
        }

        private void _opacityLastRowAnimation_Completed(object sender, EventArgs e)
        {
            var clockGroup = sender as ClockGroup;
            var sB = (clockGroup.Timeline as Storyboard);
            var row = Storyboard.GetTarget(sB.Children.First()) as RowLetters;

            clockGroup.Completed -= _opacityLastRowAnimation_Completed;
            row.Opacity = 1.0;
            IsButtonBlock = false;
        }
    }

    public class RowResult
    {
        public int NumberRow { get; private set; }
        public double Time { get; private set; }
        public int Errors { get; private set; }

        public RowResult(int numberRow, double time, int errors)
        {
            NumberRow = numberRow;
            Time = time;
            Errors = errors;
        }
    }
}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\CorrectiveTestSample\CorrectiveTestSampleViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.CorrectiveTestSample
{
    public class CorrectiveTestSampleViewModel : TestBase
    {
        public override event EventHandler<Results> Results;
        private CorrectiveTestSampleControl control;
        public CorrectiveTestSampleViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("correctiveTestSample");
            Manager.TraningTime = Common.GetSeconds(20);
        }

        public override FrameworkElement GetTestControl()
        {
            return new CorrectiveTestSampleControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new CorrectiveTestSampleControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }


        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override void TestStart()
        {
            control = new CorrectiveTestSampleControl();
            TestCurrentView = control;
            control.IsBoundedCursor = true;
            control.Start(true);
        }

        public override void Start()
        {
            control = new CorrectiveTestSampleControl();
            TestCurrentView = control;
            control.IsBoundedCursor = true;
            control.Results += TestCurrentView_Results;
            control.Start();
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Psychophysical.Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void TestCurrentView_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        public override void Stop()
        {
            base.Stop();
            if (control != null)
            {
                control.Results -= TestCurrentView_Results;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\CorrectiveTestSample\Letter.cs


using System.Windows;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.CorrectiveTestSample
{
    public class Letter:NotifyViewModelBase
    {
        public string LetterString
        {
            get { return (string)GetValue(LetterStringProperty); }
            set { SetValue(LetterStringProperty, value); }
        }

        public static readonly DependencyProperty LetterStringProperty =
            DependencyProperty.Register("LetterString", typeof(string), typeof(Letter), new PropertyMetadata("", LetterStringChanged));

        private static void LetterStringChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue != null && e.NewValue != e.OldValue)
                (d as Letter).CurrentLetter = e.NewValue.ToString();
        }

        public Brush LetterColor
        {
            get { return (Brush)GetValue(LetterColorProperty); }
            set { SetValue(LetterColorProperty, value); }
        }

        public static readonly DependencyProperty LetterColorProperty =
            DependencyProperty.Register("LetterColor", typeof(Brush), typeof(Letter), new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFDAE3F2"))));

        private string _currentLetter;
        public string CurrentLetter
        {
            get { return _currentLetter; }
            set
            {
                _currentLetter = value;
                OnPropertyChanged();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\CorrectiveTestSample\NumberButton.cs


using System;

namespace Updk7.Tests.Wpf.Psychophysical.CorrectiveTestSample
{
    public class NumberButton : NotifyViewModelBase
    {
        public event EventHandler<int> ReturnNumberButton;

        private string _number;
        public string Number
        {
            get { return _number; }
            set
            {
                _number = value;
                OnPropertyChanged();
            }
        }

        private RelayCommand _click;
        public RelayCommand Click
        {
            get { return _click ?? (_click = new RelayCommand(obj => { ReturnNumberButton?.Invoke(this, Convert.ToInt32(Number)); })); }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\CorrectiveTestSample\RowLetters.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;

namespace Updk7.Tests.Wpf.Psychophysical.CorrectiveTestSample
{
    public class RowLetters:NotifyViewModelBase
    {
        
        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public int CountRightLetters { get; private set; }
        private int _countSame = 1;
        public RowLetters(int countSame = 1, TestMode mode = TestMode.Normal)
        {
            _countSame = countSame;
            generateRowRings(mode);
        }

        public List<Letter> Letters = new List<Letter>();
        private void generateRowRings(TestMode mode = TestMode.Normal)
        {
            double HeightWidth = 100;
            var c = new Canvas();
            c.Width = HeightWidth * 30;
            c.Height = HeightWidth;

            var letterMain = Common.Letters[Common._rnd.Next(0, Common.Letters.Length)];
            var letter = new Letter();
            

            if (mode != TestMode.Manual)
                letter.LetterString = letterMain;
            else if (mode == TestMode.Manual)
                letter.LetterString = Common.Letters[0];

            if (mode != TestMode.Manual)
            {

                var moddedCommonLetters = Common.Letters.Where(w => w != letterMain).ToList();

                int index = 0;
                for (int i = 0; i < 29; i++)
                {
                    var curLetter = new Letter();
                    curLetter.LetterString = moddedCommonLetters[index];
                    Letters.Add(curLetter);
                    index++;
                    if (index == moddedCommonLetters.Count)
                        index = 0;
                }

                Common.Shuffle(Letters);

                List<int> indexes = new List<int>();//индексы в строке
                for (int i = 0; i < _countSame - 1; i++)
                {
                    while (true)
                    {
                        var possibleIndex = Common._rnd.Next(0, 29);
                        if (!indexes.Any(a => a == possibleIndex) && possibleIndex != 0)
                        {
                            if (!indexes.Any(a => a == possibleIndex - 1) && !indexes.Any(a => a == possibleIndex + 1))
                            {
                                indexes.Add(possibleIndex);
                                break;
                            }
                        }
                    }
                }

                foreach (var curIndex in indexes)
                    Letters[curIndex].LetterString = letterMain;


                // Common.Shuffle(Letters);

                Letters.Insert(0, letter);
            }
            else
            {
                Letters.Add(letter);
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(0));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(0));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(0));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(0));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                Letters.Add(CreateLetter(1));
                _countSame = 5;
            }

            for (int i = 0; i < Letters.Count; i++)
            {
                Letters[i].SetValue(Canvas.LeftProperty, Convert.ToDouble(i * HeightWidth));
                c.Children.Add(Letters[i]);
            }

            CountRightLetters = _countSame;
            Canva = c;
        }

        private Letter CreateLetter(int indexLetter)
        {
            return new Letter
            {
                LetterString = Common.Letters[indexLetter]
            };
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\CorrectiveTestSample\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.CorrectiveTestSample"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:NumberButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:NumberButton">
                    <ContentControl>
                        <Button x:Name="button"
                                Margin="1"
                                Command="{Binding Click,
                                          RelativeSource={RelativeSource FindAncestor,
                                          AncestorType={x:Type local:NumberButton}}}" 
                                HorizontalContentAlignment="Stretch" 
                                VerticalContentAlignment="Stretch"
                                Padding="0">
                            <Grid IsHitTestVisible="False">
                                <Rectangle Fill="#FF4E73B3" />
                                <Border x:Name="border"
                                        BorderBrush="White"
                                        BorderThickness="2">
                                <TextBlock x:Name="tbxNumber"
                                           HorizontalAlignment="Center"
                                           VerticalAlignment="Center"
                                           TextAlignment="Center"
                                           Text="{Binding Number,
                                                  RelativeSource={RelativeSource FindAncestor,
                                                  AncestorType={x:Type local:NumberButton}}}"
                                           Foreground="#FFFEFEFE" />
                                </Border>
                            </Grid>
                        </Button>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding ElementName=button,Path=IsMouseOver}" Value="true">
                            <Setter TargetName="tbxNumber" Property="Foreground" Value="#FFF1D419" />
                            <Setter TargetName="border" Property="Visibility" Value="Visible" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:Letter">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Letter">
                    <Grid>
                        <TextBlock Height="100"
                                       Width="100"
                                       HorizontalAlignment="Center"
                                       VerticalAlignment="Center"
                                       TextAlignment="Center"
                                       FontSize="80"
                                       FontWeight="Bold"
                                       Foreground="{TemplateBinding LetterColor}"
                                       Text="{Binding CurrentLetter,
                                RelativeSource={RelativeSource FindAncestor,
                                AncestorType={x:Type local:Letter}}}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:RowLetters">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:RowLetters">
                    <Viewbox>
                        <ContentControl Margin="20,0,0,0" Content="{Binding Canva, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:RowLetters}}}" />
                    </Viewbox>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <Style TargetType="local:CorrectiveTestSampleControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:CorrectiveTestSampleControl">
                    <Border Background="{TemplateBinding Background}">
                        <Viewbox>
                            <Grid Width="1920"
                                  Height="1080">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Viewbox>
                                    <ContentControl Content="{Binding Canva, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:CorrectiveTestSampleControl}}}" />
                                </Viewbox>
                                <Border x:Name="borderPlace" Grid.Column="1" Margin="15" Background="#00000000">
                                    <Viewbox>
                                        <Grid>
                                            <ContentControl Content="{Binding ButtonsCanvas, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:CorrectiveTestSampleControl}}}"/>
                                            <Border Background="#5AFF7A7A" Visibility="{Binding IsButtonBlock, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:CorrectiveTestSampleControl}},Converter={StaticResource BooleanToVisibilityConverter}}" />
                                        </Grid>
                                    </Viewbox>
                                </Border>
                                <tests:MessageBoxControl Message="{Binding Message, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:CorrectiveTestSampleControl}}}" />
                                <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:CorrectiveTestSampleControl}}}">
                                    <ContentPresenter.Resources>
                                        <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                            <panels:CanvasPanelView Margin="5"
                                                                    DataContext="{Binding}"
                                                                    Background="{Binding Background}"
                                                                    BorderBrush="{Binding BorderBrush}"
                                                                    BorderThickness="{Binding BorderThickness}"/>
                                        </DataTemplate>
                                    </ContentPresenter.Resources>
                                </ContentPresenter>
                            </Grid>
                        </Viewbox>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:CorrectiveTestSampleViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:CorrectiveTestSampleViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False"
                                            Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView  Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                                           HorizontalAlignment="Center"
                                                           VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:CorrectiveTestSampleViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EmotionalStability\CommonEnums.cs


namespace Updk7.Tests.Wpf.Psychophysical.EmotionalStability
{
    public enum Buttons
    {
        Blue,
        White
    }

    public enum FileNamesPath
    {
        even,
        odd,
        correct,
        wrong,
    }

    /// <summary>
    /// Четность
    /// </summary>
    public enum Parity
    {
        /// <summary>
        /// Четное
        /// </summary>
        Even,
        /// <summary>
        /// Нечетное
        /// </summary>
        Odd
    }

    /// <summary>
    /// Часть задания
    /// </summary>
    public enum Parts
    {
        Part_1,
        Part_2
    }

    public enum StatusShowingTargetNumber
    {
        Before,
        Showing,
        After,
        End
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EmotionalStability\EmotionalStabilityControlV2.cs


using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.EmotionalStability
{
    public class EmotionalStabilityControlV2 : NotifyViewModelBase, ILearning
    {
        public event EventHandler<bool> ResetTimer;
        public event EventHandler<Dictionary<string, object>> ReturnResults;
        public Scenario Scenario
        {
            get { return scenario; }
            set
            {
                scenario = value;
                OnPropertyChanged();
            }
        }
        private bool isShowErrorMessages = false;
        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (isShowErrorMessages)
                {
                    if (_message != "")
                    {
                        _messageTimer.Start();
                    }
                    OnPropertyChanged();
                }
            }
        }

        DispatcherTimer _messageTimer = new DispatcherTimer();

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private bool isTargetNumberActive = false;
        private Results results = new Results();
        private Scenario scenario;

        public EmotionalStabilityControlV2(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            scenario = new Scenario(Mode);
            scenario.CompleteScenario += Scenario_CompleteScenario;
            scenario.TargetNumber += Scenario_TargetNumber;
            scenario.TimeOut += Scenario_TimeOut;
            DataContext = Scenario;

            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("ScenarioStart", () => scenario.Start());
                TestMethods.Add("ScenarioStop", () => scenario.Stop());
            }
        }

        public void GetResults()
        {
            var results = this.results.GetFormattedResults();
            ReturnResults?.Invoke(this, results);
        }
        
        public void PressButton(Buttons button, int time)
        {
            if (isTargetNumberActive)
            {
                scenario.StopTimeoutTimer();
                var reactiontTime = TimeSpan.FromSeconds(time / 10000.0);
                var part = scenario.ElementScenario.NumbersData.IsExistSounds ? Parts.Part_2 : Parts.Part_1;
                bool isRight = false;//правильно иль нет
                if (button == Buttons.Blue)
                {
                    results.Reactions.Add(reactiontTime.TotalSeconds);

                    if (scenario.CurrentNumberTargetData.Parity != Parity.Even)
                    {
                        if (part == Parts.Part_1)
                            results.ErrorsFirstSeries++;
                        else
                            results.ErrorsSecondSeries++;

                        if (isShowErrorMessages)
                        {
                            scenario.Pause("Нажата неправильная кнопка!");
                        }
                    }
                    else
                        isRight = true;
                }
                else if (button == Buttons.White)
                {
                    results.Reactions.Add(reactiontTime.TotalSeconds);

                    if (scenario.CurrentNumberTargetData.Parity != Parity.Odd)
                    {
                        if (part == Parts.Part_1)
                            results.ErrorsFirstSeries++;
                        else
                            results.ErrorsSecondSeries++;

                        if (isShowErrorMessages)
                        {
                            scenario.Pause("Нажата неправильная кнопка!");
                        }
                    }
                    else
                        isRight = true;
                }

                if (scenario.ElementScenario.NumbersData.IsExistSounds)
                {
                    if (scenario.ElementScenario.NumbersData.IsConditionTrue)
                        scenario.playerManager.PlayTryFalse(isRight);
                    else
                        scenario.playerManager.PlayTryFalse(scenario.ElementScenario.NumbersData.IsTrueResponse);
                }
            }
            isTargetNumberActive = false;
        }

        public void Start(bool isTestStart = false)
        {
            isShowErrorMessages = isTestStart;

            if (isShowErrorMessages)
            {
                _messageTimer.Interval = TimeSpan.FromSeconds(1.8);
                _messageTimer.Tick += _messageTimer_Tick;
                scenario.MessageEvent += Scenario_MessageEvent;
            }

            scenario.Start();
        }

        private void Scenario_MessageEvent(object sender, string e)
        {
            Message = e;
        }

        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _messageTimer.Stop();
            if (Mode != TestMode.Manual)
                if(isShowErrorMessages)
                scenario.Resume();
        }

        public void Stop()
        {
            scenario.MessageEvent -= Scenario_MessageEvent;
            _messageTimer.Stop();
            scenario.Stop();
        }

        private void Scenario_CompleteScenario(object sender, EventArgs e)
        {
            GetResults();
        }

        private void Scenario_TargetNumber(object sender, TargetNumberEventArgs e)
        {
            if (Mode != TestMode.Manual)
                ResetTimer?.Invoke(this, true);
            isTargetNumberActive = true;
        }

        private void Scenario_TimeOut(object sender, Parts e)
        {
            if (e == Parts.Part_1)
                results.PassesFirstSeries++;
            else
                results.PassesSecondSeries++;
            scenario.StopTimeoutTimer();
            isTargetNumberActive = false;
            results.Reactions.Add(2.0);

            if (isShowErrorMessages)
                scenario.Pause("Пропущен сигнал!");
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EmotionalStability\EmotionalStabilityViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.EmotionalStability
{
    public class EmotionalStabilityViewModel : TestBase
    {
        public override event EventHandler<Psychophysical.Results> Results;
        private PultButtons Buttons;

        private EmotionalStabilityControlV2 control;

        public EmotionalStabilityViewModel(EnumTests testType, PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("emotionalStability");
            Manager.TraningTime = Common.GetSeconds(70);
            TestType = testType;
        }

        public override FrameworkElement GetTestControl()
        {
            return new EmotionalStabilityControlV2(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new EmotionalStabilityControlV2(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void Start()
        {
            control = new EmotionalStabilityControlV2();
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ReturnResults += TestCurrentView_ReturnResults;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start();
        }
        public override void TestStart()
        {
            control = new EmotionalStabilityControlV2();
            TestCurrentView = control;
            Buttons = Pult as Pult.PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start(true);
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Psychophysical.Results(new Dictionary<string, object>()) { Exception = e.Exception});
        }
        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Psychophysical.Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Blue)
                control.PressButton(EmotionalStability.Buttons.Blue, e.Time);
            else if (e.Button == PultButton.White)
                control.PressButton(EmotionalStability.Buttons.White, e.Time);
        }

        private void Control_ResetTimer(object sender, bool e)
        {
            Buttons.Start();
        }

        private void TestCurrentView_ReturnResults(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Psychophysical.Results(e));
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.ReturnResults -= TestCurrentView_ReturnResults;
                control.ResetTimer -= Control_ResetTimer;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EmotionalStability\NumberData.cs


namespace Updk7.Tests.Wpf.Psychophysical.EmotionalStability
{
    public class NumberData
    {
        public Parity Parity { get; private set; }
        public bool IsTargetNumber { get; set; }
        public int Number { get; private set; }
        public NumberData(int number)
        {
            Number = number;
            var x = number % 2;
            if (x == 0)
                Parity= Parity.Even;
            else
                Parity = Parity.Odd;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EmotionalStability\PackNumbers.cs


using System.Collections.Generic;
using System.Linq;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;

namespace Updk7.Tests.Wpf.Psychophysical.EmotionalStability
{
    /// <summary>
    /// Пачка чисел
    /// </summary>
    public class PackNumbers
    {
        /// <summary>
        /// Числа
        /// </summary>
        public List<NumberData> Numbers { get; private set; } = new List<NumberData>();

        /// <summary>
        /// Существуют ли звуки для таргет числа этой пачки
        /// </summary>
        public bool IsExistSounds { get; set; }

        /// <summary>
        /// Звук таргет числа правильный или нет(четное/нечетное)
        /// </summary>
        public bool IsTrueParity { get; set; }

        /// <summary>
        /// Звук на ответ правильный иль нет(правильно/неправильно)
        /// </summary>
        public bool IsTrueResponse { get; set; }

        /// <summary>
        /// Является ли истинным(правильным)
        /// </summary>
        public bool IsConditionTrue { get; set; }

        public PackNumbers(TestMode mode = TestMode.Normal)
        {
            GenerateNumbers();
            if (mode != TestMode.Manual)
                SetTargetNumber();
            else
            {
                SetTargetNumber(5, 6, true);
            }
        }

        private void GenerateNumbers(int speed = 5, int time = 12)
        {
            for (int i = 0; i < speed * time; i++)
                Numbers.Add(new NumberData(Common._rnd.Next(1, 10)));
        }

        private void SetTargetNumber(int secFrom = 5, int secTo = 9, bool isManual = false)
        {
            if (Numbers.Count != 0)
            {
                if (Numbers.FirstOrDefault(f => f.IsTargetNumber == true) == null)
                {
                    if (isManual)
                    {
                        var indexTargetNumber = 20;
                        Numbers[indexTargetNumber].IsTargetNumber = true;
                    }
                    else
                    {
                        var indexTargetNumber = Common._rnd.Next(secFrom * 5, secTo * 5);
                        Numbers[indexTargetNumber].IsTargetNumber = true;
                    }
                }
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EmotionalStability\Results.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Psychophysical.EmotionalStability
{
    public class Results
    {
        /// <summary>
        /// Реакции(время)
        /// </summary>
        public List<double> Reactions { get; set; } = new List<double>();
        /// <summary>
        /// Количество ошибок в первой части теста(первые 10 пачек чисел)
        /// </summary>
        public int ErrorsFirstSeries { get; set; } = 0;
        /// <summary>
        /// Количество ошибок во второй части теста(15 последних пачек чисел)
        /// </summary>
        public int ErrorsSecondSeries { get; set; } = 0;
        /// <summary>
        /// Количество пропусков в первой части теста
        /// </summary>
        public int PassesFirstSeries { get; set; } = 0;
        /// <summary>
        /// Количество пропусков во второй части теста
        /// </summary>
        public int PassesSecondSeries { get; set; } = 0;

        /// <summary>
        /// Возвращает среднеарифметическое время реагирования без помехи(если значений реакций недостаточно(меньше 10), вернет 0.0))
        /// </summary>
        /// <returns>Среднеарифметическое время реагирования</returns>
        public float GetAverageReactionsFirstSeries()
        {
            var firstTenValues = Reactions.Count > 10 ? Reactions.GetRange(0, 10) : null;
            if (firstTenValues == null)
                return 0.0f;
            var average = (float)firstTenValues.Average();
            return average;
        }

        /// <summary>
        /// Возвращает среднеарифметическое время реагирования с помехой(если значений реакций недостаточно(меньше 25), вернет 0.0))
        /// </summary>
        /// <returns>Среднеарифметическое время реагирования</returns>
        public float GetAverageReactionsSecondSeries()
        {
            var lastFiveTeenValues = Reactions.Count == 25 ? Reactions.GetRange(10, 15) : null;
            if (lastFiveTeenValues == null)
                return 0.0f;
            var average = (float)lastFiveTeenValues.Average();
            return average;
        }

        /// <summary>
        /// Возвращает разницу среднеарифметических времен реагирования
        /// </summary>
        /// <returns></returns>
        public float GetDifferenceSeriesReactions()
        {
            var averageFirstSeries = GetAverageReactionsFirstSeries();
            var averageSecondSeries = GetAverageReactionsSecondSeries();
            var difference = averageSecondSeries - averageFirstSeries;
            return difference;
        }

        /// <summary>
        /// Возвращает разницу количества ошибок с помехой и без помехи
        /// </summary>
        /// <returns></returns>
        public int GetDifferenceErrors()
        {
            var difference = ErrorsSecondSeries - ErrorsFirstSeries;
            return difference;
        }

        /// <summary>
        /// Возвращает форматированные результаты теста
        /// </summary>
        /// <returns></returns>
        public Dictionary<string, object> GetFormattedResults()
        {
            var results = new Dictionary<string, object>()
            {
                ["Количество ошибок без помехи (N1)"] = ErrorsFirstSeries,
                ["Количество пропусков без помехи"] = PassesFirstSeries,
                ["Среднеарифметическое время реагирования без помехи (ВР1)"] = GetAverageReactionsFirstSeries(),
                ["Количество ошибок с помехой (N2)"] = ErrorsSecondSeries,
                ["Количество пропусков с помехой"] = PassesSecondSeries,
                ["Среднеарифметическое время реагирования с помехой (ВР2)"] = GetAverageReactionsSecondSeries(),
                ["Разница среднеарифметических времен реагирования (ВР2 - ВР1)"] = GetDifferenceSeriesReactions(),
                ["Разница количества ошибок с помехой и без помехи (N2 - N1)"] = GetDifferenceErrors()
            };

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EmotionalStability\Scenario.cs


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;

namespace Updk7.Tests.Wpf.Psychophysical.EmotionalStability
{
    public class Scenario : INotifyPropertyChanged, IDisposable
    {
        public event EventHandler CompleteScenario;
        public event EventHandler<TargetNumberEventArgs> TargetNumber;
        public event EventHandler<Parts> TimeOut;
        public List<ScenarioElement> ScenarioElements { get; set; } = new List<ScenarioElement>();
        public event EventHandler<string> MessageEvent;

        private string number = "";
        public string Number
        {
            get { return number; }
            set
            {
                number = value;
                OnPropertyChanged();
            }
        }

        private bool _curtain;
        public bool Curtain
        {
            get { return _curtain; }
            set
            {
                _curtain = value;
                OnPropertyChanged();
            }
        }

        //DispatcherTimer timer = new DispatcherTimer();
        private DispatcherTimer timeOutTimer = new DispatcherTimer();
        public SoundPlayerManager playerManager { get; private set; } = new SoundPlayerManager();
        public ScenarioElement ElementScenario { get; private set; } = null;
        private TestMode _mode;
        private TimeSpan _timerInterval = TimeSpan.FromMilliseconds(2000);
        public Scenario(TestMode mode = TestMode.Manual)
        {
            _mode = mode;
            GenerateScenario();
            timeOutTimer.Interval = TimeSpan.FromMilliseconds(2000);
            timeOutTimer.Tick += TimeOutTimer_Tick;
        }

        private void TimeOutTimer_Tick(object sender, EventArgs e)
        {
            timeOutTimer.Stop();
            var part = ElementScenario.NumbersData.IsExistSounds ? Parts.Part_2 : Parts.Part_1;
            TimeOut?.Invoke(this, part);
        }

        public void StopTimeoutTimer()
        {
            timeOutTimer.Stop();
        }

        private DateTime? _startTime = null;
        public void Start()
        {
            CompositionTarget.Rendering += CompositionTarget_Rendering;
            _scenarioStart = true;
            _startTime = DateTime.Now;
        }

        public void Pause(string message)
        {
            CompositionTarget.Rendering -= CompositionTarget_Rendering;
            MessageEvent?.Invoke(this, message);
        }

        public void Resume()
        {
            CompositionTarget.Rendering += CompositionTarget_Rendering;
        }

        private bool _scenarioStart = false;
        private void CompositionTarget_Rendering(object sender, EventArgs e)
        {
            var newTime = DateTime.Now;
            var curTime = newTime - _startTime;
            if (_scenarioStart&& _timerInterval < curTime)
            {
                GetState();
            }
        }

        /// <summary>
        /// Останавливает сценарий, вызывает Dispose плеера
        /// </summary>
        public void Stop()
        {
            CompositionTarget.Rendering -= CompositionTarget_Rendering;
            timeOutTimer.Stop();
            //timer.Stop();
            Dispose();
        }


        #region Only for ILearning interface




        #endregion


        private bool IsTargetNumberActive = false;
        public NumberData CurrentNumberData { get; private set; } = null;
        public NumberData CurrentNumberTargetData { get; private set; } = null;
        private void Timer_Tick(object sender, EventArgs e)
        {
            GetState();
        }
        private void GetState()
        {
            if (IsTargetNumberActive && _curtain)
            {
                CurrentNumberData = CurrentNumberTargetData = ElementScenario.GetNextNumber();
                if (CurrentNumberTargetData != null)
                {
                    Number = $"{CurrentNumberTargetData.Number}";
                    if (ElementScenario.NumbersData.IsExistSounds)
                    {
                        if (ElementScenario.NumbersData.IsConditionTrue)
                        {
                            playerManager.PlaySoundEvenOdd(ElementScenario.CurrentNumber.Parity);
                        }
                        else
                        {
                            if (ElementScenario.NumbersData.IsTrueParity)
                                playerManager.PlaySoundEvenOdd(Parity.Even);
                            else
                            {
                                playerManager.PlaySoundEvenOdd(Parity.Odd);
                            }
                        }
                    }
                    TargetNumber?.Invoke(this, new TargetNumberEventArgs(CurrentNumberTargetData.Number, ElementScenario.NumbersData.IsExistSounds, ElementScenario.NumbersData.IsTrueResponse));

                    if (_mode != TestMode.Manual)
                        timeOutTimer.Start();
                }
                //timer.Interval = TimeSpan.FromMilliseconds(250);
                _timerInterval = TimeSpan.FromMilliseconds(350);
                _startTime = DateTime.Now;
                Curtain = false;
            }
            else if (IsTargetNumberActive && !_curtain)
            {
                //timer.Interval = TimeSpan.FromMilliseconds(200);
                _timerInterval = TimeSpan.FromMilliseconds(200);
                _startTime = DateTime.Now;
                Number = "";
                IsTargetNumberActive = false;
                Curtain = true;
            }
            else
            {
                if (_curtain)
                    Curtain = false;
                //timer.Interval = TimeSpan.FromMilliseconds(200);
                _timerInterval = TimeSpan.FromMilliseconds(200);
                _startTime = DateTime.Now;
                var isTargetNumber = ElementScenario.CheckNextIsTargetNumber();

                if (isTargetNumber != null && isTargetNumber.Value)
                {
                    IsTargetNumberActive = true;
                    Curtain = true;
                    Number = "";
                }
                else
                {
                    CurrentNumberData = ElementScenario.GetNextNumber();
                    if (CurrentNumberData != null)
                    {
                        Number = $"{CurrentNumberData.Number}";
                    }
                    else
                    {
                        //timer.Interval = TimeSpan.FromSeconds(5);
                        _timerInterval = TimeSpan.FromSeconds(5);//если нет числа то ожидание 5 сек до следующей пачки
                        _startTime = DateTime.Now;
                        Number = "";
                        SetNextScenarioElement();
                    }
                }
            }
        }

        private int indexScenarioElement = 0;
        private void SetNextScenarioElement()
        {
            indexScenarioElement++;
            if (indexScenarioElement < ScenarioElements.Count)
                ElementScenario = ScenarioElements[indexScenarioElement];
            else
            {
                CompleteScenario?.Invoke(this, new EventArgs());
                //timer.Stop();
            }
        }
        private void GenerateScenario()
        {
            int additionalTrueSounds = 0;
            for (int i = 0; i < 25; i++)
            {
                ScenarioElement scenarioElement = new ScenarioElement(TimeSpan.FromSeconds(5), _mode);
                if (i >= 10)
                {
                    scenarioElement.NumbersData.IsExistSounds = true;
                    if (i == 10 || i == 11)
                    {
                        scenarioElement.NumbersData.IsTrueParity = true;
                        scenarioElement.NumbersData.IsTrueResponse = true;
                        scenarioElement.NumbersData.IsConditionTrue = true;
                    }
                    else
                    {
                        if (Common._rnd.Next(0, 2) == 0 && additionalTrueSounds < 2)
                        {
                            additionalTrueSounds++;
                            scenarioElement.NumbersData.IsTrueParity = true;
                            scenarioElement.NumbersData.IsTrueResponse = true;
                            scenarioElement.NumbersData.IsConditionTrue = true;
                        }
                        else
                        {
                            scenarioElement.NumbersData.IsTrueParity = Common._rnd.Next(0, 2) == 0 ? true : false;
                            if (scenarioElement.NumbersData.IsTrueParity)
                            {
                                var targetNumber = scenarioElement.NumbersData.Numbers.FirstOrDefault(f => f.IsTargetNumber == true);
                                if (targetNumber.Parity == Parity.Even)
                                    scenarioElement.NumbersData.IsTrueResponse = false;
                                else
                                    scenarioElement.NumbersData.IsTrueResponse = Common._rnd.Next(0, 2) == 0 ? true : false; 
                            }
                            else
                            {
                                var targetNumber = scenarioElement.NumbersData.Numbers.FirstOrDefault(f => f.IsTargetNumber == true);
                                if (targetNumber.Parity == Parity.Odd)
                                    scenarioElement.NumbersData.IsTrueResponse = Common._rnd.Next(0, 2) == 0 ? true : false;
                                else
                                    scenarioElement.NumbersData.IsTrueResponse = true;
                            }
                        }
                    }
                }
                ScenarioElements.Add(scenarioElement);
            }
            ElementScenario = ScenarioElements[indexScenarioElement];
        }

        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged([CallerMemberName]string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }

        public void Dispose()
        {
            if (playerManager != null)
                ((IDisposable)playerManager).Dispose();
        }
    }

    public class TargetNumberEventArgs
    {
        public int Number { get; set; }
        /// <summary>
        /// Ответ должен быть со звуком
        /// </summary>
        public bool IsResponseWithSound { get; set; }

        /// <summary>
        /// Ответ(звук) правильный иль нет
        /// </summary>
        public bool IsSoundRight { get; set; }

        public TargetNumberEventArgs(int number, bool isResponseWithSound, bool isSoundRight)
        {
            Number = number;
            IsResponseWithSound = isResponseWithSound;
            IsSoundRight = isSoundRight;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EmotionalStability\ScenarioElement.cs


using System;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;

namespace Updk7.Tests.Wpf.Psychophysical.EmotionalStability
{
    public class ScenarioElement
    {
        /// <summary>
        /// Пачка с числами
        /// </summary>
        public PackNumbers NumbersData { get; private set; }
      
        public NumberData CurrentNumber { get; private set; }

        /// <summary>
        /// Время бездействия
        /// </summary>
        public TimeSpan VoidTime { get; set; }

        public ScenarioElement(TimeSpan voidTime, TestMode mode = TestMode.Normal )
        {
            NumbersData = new PackNumbers(mode);
            VoidTime = voidTime;
        }

        private int indexNumber = -1;
        public NumberData GetNextNumber()
        {
            indexNumber++;
            if (indexNumber < NumbersData.Numbers.Count)
                return CurrentNumber = NumbersData.Numbers[indexNumber];
            else
                return CurrentNumber = null;
        }

        public bool? CheckNextIsTargetNumber()
        {
            if (indexNumber < 0)
                return null;
            if (indexNumber + 1 < NumbersData.Numbers.Count)
                return NumbersData.Numbers[indexNumber + 1].IsTargetNumber;
            else
                return null;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EmotionalStability\SoundPlayerManager.cs


using System;
using System.IO;
using System.Media;
using System.Windows;

namespace Updk7.Tests.Wpf.Psychophysical.EmotionalStability
{
    public class SoundPlayerManager : IDisposable
    {
        private SoundPlayer _player = new SoundPlayer();
        private bool _disposed = false; //флаг, что наш объект был Disposed
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this); //говорим сборщику мусора, что наш объект уже освободил ресурсы
        }

        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                //нельзя вызвать метод Dispose для объекта дважды
                return;
            }
            if (disposing)
            {
                //тут освобождаем все ресурсы. В нашем случае он только один.
                Close(); //по сути делаем _sw.Dispose();
            }
            _disposed = true; //помечаем флаг что метод Dispose уже был вызван
        }

        public void Close()
        {
            if (_player != null)
                ((IDisposable)_player).Dispose();
            _ms?.Dispose();
        }

        /// <summary>
        /// Звук четное/нечетное
        /// </summary>
        /// <param name="trueOrFalse"></param>
        public void PlaySoundEvenOdd(Parity parity)
        {
            if (parity == Parity.Even)
            {
                PlayPlayer(GetPathFile(FileNamesPath.even));
            }
            else if (parity == Parity.Odd)
            {
                PlayPlayer(GetPathFile(FileNamesPath.odd));
            }
        }

        public void PlayTryFalse(bool trueOrFalse)
        {
            if (trueOrFalse)
            {
                //Запуск звука правильно
                PlaySoundTrue(true);
            }
            else
            {
                //Запуск звука неправильно
                PlaySoundTrue(false);
            }
        }

        private Uri GetPathFile(FileNamesPath name)
        {
            return new Uri($@"pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/EmotionalStability/Sounds/{name}.wav");
        }

        private MemoryStream _ms;
        private void PlayPlayer(Uri pathFile)
        {
            _player.Stop();
            _ms?.Dispose();

            var byteArray = SoundResources.GetSoundArray(pathFile.OriginalString);
            _ms = new MemoryStream(byteArray);
            _player.Stream = _ms;
            _player.Play();
        }

        /// <summary>
        /// Звук правильно/неправильно
        /// </summary>
        /// <param name="trueOrFalse"></param>
        private void PlaySoundTrue(bool trueOrFalse)
        {
            if (trueOrFalse)
            {
                PlayPlayer(GetPathFile(FileNamesPath.correct));
            }
            else
            {
                PlayPlayer(GetPathFile(FileNamesPath.wrong));
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EmotionalStability\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.EmotionalStability"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <DrawingBrush x:Key="ellipsedBrush"
                  Stretch="None"
                  TileMode="Tile"
                  Viewport="0,0,2,2"
                  AlignmentX="Left"
                  AlignmentY="Top"
                  ViewportUnits="Absolute">
        <DrawingBrush.Drawing>
            <GeometryDrawing Brush="#FFE40606" >
                <GeometryDrawing.Geometry>
                    <EllipseGeometry RadiusX="2" RadiusY="2"/>
                </GeometryDrawing.Geometry>
            </GeometryDrawing>
        </DrawingBrush.Drawing>
    </DrawingBrush>
    <SolidColorBrush x:Key="solidBrush" Color="#FFFF3A3A"/>
    <Style TargetType="local:EmotionalStabilityControlV2">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:EmotionalStabilityControlV2">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Border x:Name="PART_border"
                                            BorderThickness="0.2cm"
                                            Height="8cm"
                                            Width="35cm"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Center"
                                            Background="#FF777F8C">
                                        <TextBlock Foreground="White"
                                                   TextOptions.TextRenderingMode="Aliased"
                                                   TextOptions.TextFormattingMode="Display"
                                                   TextOptions.TextHintingMode="Fixed"
                                                   VerticalAlignment="Center"
                                                   HorizontalAlignment="Center"
                                                   Text="{Binding DataContext.Number, RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type local:EmotionalStabilityControlV2}}}"
                                                   FontSize="6cm"
                                                   FontWeight="DemiBold">
                                        </TextBlock>
                                    </Border>
                                    <tests:MessageBoxControl Message="{Binding Message, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:EmotionalStabilityControlV2}}}" />
                                    
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:EmotionalStabilityControlV2}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                    DataContext="{Binding}"
                                                                    Background="{Binding Background}"
                                                                    BorderBrush="{Binding BorderBrush}"
                                                                    BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Curtain}" Value="True">
                            <Setter TargetName="PART_border" Property="Background" Value="{StaticResource solidBrush}"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:EmotionalStabilityViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:EmotionalStabilityViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:EmotionalStabilityViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EstimationOfStabilityOfAttention\EstimationOfStabilityOfAttentionControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.EstimationOfStabilityOfAttention
{
    public class EstimationOfStabilityOfAttentionControl : NotifyViewModelBase, ILearning
	{
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler ResetTimer;

        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (_isShowedMessages)
                {
                    if (_message != "")
                    {
                        _isButtonsEnabled = false;
                        _timer.Stop();
                        if (Mode != TestMode.Manual)
                            _messageTimer.Start();
                    }
                    OnPropertyChanged();
                }
            }
        }
        private bool _isButtonsEnabled = true;
        private bool _isShowedMessages = false;

        private DispatcherTimer _messageTimer = new DispatcherTimer();

        private string _number;
        public string Number
        {
            get { return _number; }
            set
            {
                _number = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        Random rnd = new Random();
        List<int> _numbers = new List<int>();
        DispatcherTimer _timer = new DispatcherTimer();
        public EstimationOfStabilityOfAttentionControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
            {
                LearningInitialize();
                TestMethods.Add("LearningTick_2000ms", () => LearningTick_2000ms());
            }
        }

        #region using only for ILearning interface

        private List<int> _learningNumbers;
        private int _l_index = 0;
        private void LearningInitialize()
        {
            _learningNumbers = new List<int>() { 2, 3, 4, 5, 6, 2, 4, 5, 6, 7, 8, 4, 3, 3 };
        }
       
        private void LearningTick_2000ms()
        {
            if (string.IsNullOrEmpty(Number))
            {
                Number = _learningNumbers[_l_index].ToString();
                if (_l_index < _learningNumbers.Count)
                    _l_index++;
            }
            else
            {
                Number = "";
            }
        }

        #endregion

        public void Start(bool isTestQuest = false)
        {
            _isShowedMessages = isTestQuest;
            if (_isShowedMessages)
            {
                _messageTimer.Tick += _messageTimer_Tick;
                _messageTimer.Interval = TimeSpan.FromSeconds(1.5);
            }
            _timer.Interval = TimeSpan.FromSeconds(3);
            for (int i = 0; i < 120; i++)
                _numbers.Add(rnd.Next(1, 10));
            _timer.Tick += _timer_Tick;
            if (Mode != TestMode.Manual)
                _timer.Start();
        }

        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _messageTimer.Stop();
            if (Mode != TestMode.Manual)
                _timer.Start();
            _isButtonsEnabled = true;
        }

        private int _indexNumbers = 0;
        private int _counter10 = 0;
        private void _timer_Tick(object sender, EventArgs e)
        {
            if (Number == null)
            {
                Number = $"{_numbers[_indexNumbers]}";
                
                _timer.Interval = TimeSpan.FromSeconds(2);
                if (Mode != TestMode.Manual)
                    ResetTimer?.Invoke(this, new EventArgs());
            }
            else
            {
                _reactions.Add(2.0);
                _countPasses++;
                EndShowNumber();
            }
        }

        private void EndShowNumber()
        {
            Number = null;
            _timer.Interval = TimeSpan.FromSeconds(GetRandomDouble(3.5, 5));
            _counter10++;
            
            if (_counter10 == 10)
            {
                CalculateCurrentResultsForMainResult();
                
            }
            if (_indexNumbers == _numbers.Count - 1)
            {
                _timer.Stop();
                ReturnResult();
            }
            _indexNumbers++;
        }

        private double GetRandomDouble(double min, double max)
        {
            return min + (rnd.NextDouble() * (max - min));
        }

        private List<Dictionary<string, object>> MainResult = new List<Dictionary<string, object>>();

        private void CalculateCurrentResultsForMainResult()
        {
            double average = 0;
            if (_reactions.Count != 0)
                average = _reactions.Average();
            var curRes = new Dictionary<string, object>()
            {
                ["Среднеарифметическое время реагирования"] = average,
                ["Количество ошибок"] = _countErrors,
                ["Количество пропусков"] = _countPasses
            };
            _reactions = new List<double>();
            _countErrors = 0;
            _countPasses = 0;
            _counter10 = 0;
            MainResult.Add(curRes);
        }

        private void ReturnResult()
        {
            var Average = MainResult.Select(s => s["Среднеарифметическое время реагирования"]).Cast<double>().Average();
            var CountErrors = MainResult.Select(s => s["Количество ошибок"]).Cast<int>().Sum();
            var CountPasses = MainResult.Select(s => s["Количество пропусков"]).Cast<int>().Sum();
            var blocksAverageTimes = MainResult.Select(s => Convert.ToSingle(s["Среднеарифметическое время реагирования"])).ToArray();
            var numbersErrorsByBlocks = MainResult.Select(s => Convert.ToInt32(s["Количество ошибок"])).ToArray();
            var numbersPassesByBlocks = MainResult.Select(s => Convert.ToInt32(s["Количество пропусков"])).ToArray();

            var res = new Dictionary<string, object>()
            {
                ["Среднеарифметическое время реагирования"] = (float)Average,
                ["Количество ошибок"] = CountErrors,
                ["Количество пропусков"] = CountPasses,
                ["Среднеарифметические времена реагирования по блокам"] = blocksAverageTimes,
                ["Количество ошибок по блокам"] = numbersErrorsByBlocks,
                ["Количество пропусков по блокам"] = numbersPassesByBlocks
                //["Таблица"] = MainResult
            };

            Results?.Invoke(this, res);
        }

        private List<double> _reactions = new List<double>();
        private int _countPasses = 0;
        private int _countErrors = 0;

        public void PressButton(Buttons button,int time)
        {
            if (_isButtonsEnabled)
            {
                if (Number != null)
                {
                    var evenOdd = double.Parse(Number) % 2;

                    if (button == Buttons.Blue)
                    {
                        if (evenOdd == 0)
                        {
                            var curTime = TimeSpan.FromSeconds(time / 10000.0);
                            _reactions.Add(curTime.TotalSeconds);
                        }
                        else
                        {
                            Message = "Вы допустили ошибку!";
                            _countErrors++;
                        }
                    }
                    else if (button == Buttons.White)
                    {
                        if (evenOdd == 0)
                        {
                            Message = "Вы допустили ошибку!";
                            _countErrors++;
                        }
                        else
                        {
                            var curTime = TimeSpan.FromSeconds(time / 10000.0);
                            _reactions.Add(curTime.TotalSeconds);
                        }
                    }
                    EndShowNumber();
                    _timer.Stop();
                    if (Mode != TestMode.Manual)
                        _timer.Start();
                }
            }
        }
        
        public void Stop()
        {
            if (_messageTimer != null)
            {
                _messageTimer.Stop();
                _messageTimer.Tick -= _messageTimer_Tick;
            }
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
        }
	}

    public enum Buttons
    {
        Blue,
        White
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EstimationOfStabilityOfAttention\EstimationOfStabilityOfAttentionViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.EstimationOfStabilityOfAttention
{
    public class EstimationOfStabilityOfAttentionViewModel:TestBase
    {
        public override event EventHandler<Results> Results;

        private PultButtons Buttons;
        public EstimationOfStabilityOfAttentionControl control;
        public EstimationOfStabilityOfAttentionViewModel(EnumTests testType, PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            TestType = testType;
            SetInstructions("estimationOfStabilityOfAttention");
            Manager.TraningTime = Common.GetSeconds(30);
        }

        public override FrameworkElement GetTestControl()
        {
            return new EstimationOfStabilityOfAttentionControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new EstimationOfStabilityOfAttentionControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            control = new EstimationOfStabilityOfAttentionControl();
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            control.Start(true);
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception=e.Exception});
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override void Start()
        {
            control = new EstimationOfStabilityOfAttentionControl();
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.Results += Control_Results;
            control.ResetTimer += Control_ResetTimer;
            control.Start();
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Blue)
                control.PressButton(EstimationOfStabilityOfAttention.Buttons.Blue, e.Time);
            if (e.Button == PultButton.White)
                control.PressButton(EstimationOfStabilityOfAttention.Buttons.White, e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.Results -= Control_Results;
                control.ResetTimer -= Control_ResetTimer;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EstimationOfStabilityOfAttention\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.EstimationOfStabilityOfAttention"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:EstimationOfStabilityOfAttentionControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:EstimationOfStabilityOfAttentionControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Rectangle Height="8cm"
                                               Width="8cm"
                                               Fill="#FF777F8C"/>
                                    <TextBlock VerticalAlignment="Center"
                                               HorizontalAlignment="Center"
                                               Padding="0,0,0,20"
                                               Foreground="#FFE4EFFF"
                                               Text="{Binding Number,
                                                      RelativeSource={RelativeSource FindAncestor,
                                                      AncestorType={x:Type local:EstimationOfStabilityOfAttentionControl}}}"
                                               FontSize="8cm"/>
                                    <tests:MessageBoxControl Message="{Binding Message,
                                                                       RelativeSource={RelativeSource FindAncestor,
                                                                       AncestorType={x:Type local:EstimationOfStabilityOfAttentionControl}}}"/>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:EstimationOfStabilityOfAttentionControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                    DataContext="{Binding}"
                                                                    Background="{Binding Background}"
                                                                    BorderBrush="{Binding BorderBrush}"
                                                                    BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:EstimationOfStabilityOfAttentionViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:EstimationOfStabilityOfAttentionViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:EstimationOfStabilityOfAttentionViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EstimationOfStabilityToMonotonistance\EstimationOfStabilityToMonotonistanceControl.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Media;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using static Updk7.Tests.Wpf.Psychophysical.Common;
using static Updk7.Tests.Wpf.Psychophysical.Common.Drawing;

namespace Updk7.Tests.Wpf.Psychophysical.EstimationOfStabilityToMonotonistance
{
    public class EstimationOfStabilityToMonotonistanceControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler RestartTest;
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler ResetTimer;

        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (_isShowedMessages)
                {
                    if (_message != "")
                    {
                        IsButtonsEnabled = false;
                        _timer.Stop();
                        _soundTimer.Stop();
                        _messageTimer.Start();
                    }
                    OnPropertyChanged();
                }
            }
        }

        private bool _isButtonsEnabled = true;
        public bool IsButtonsEnabled
        {
            get { return _isButtonsEnabled; }
            set
            {
                _isButtonsEnabled = value;
                OnPropertyChanged();
            }
        }

        private bool _isShowedMessages = false;
        private ESM_Mode _Mode;
        private DispatcherTimer _messageTimer = new DispatcherTimer();

        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        private List<RowTableSignals> _tableSignals;
        public List<RowTableSignals> TableSignals
        {
            get { return _tableSignals; }
            set
            {
                _tableSignals = value;
                OnPropertyChanged();
            }
        }

        private TimeSpan _currentTime = new TimeSpan(0, 0, 0);
        public TimeSpan CurrentTime
        {
            get { return _currentTime; }
            set
            {
                _currentTime = value;
                OnPropertyChanged();
            }
        }
        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private List<Indicator> _indicators = new List<Indicator>();


        private NeuroTimer _timer = new NeuroTimer();
        private DispatcherTimer _soundTimer = new DispatcherTimer();
        private int _indexCurrentIndicator = 0;
        private DispatcherTimer _timerPasses = new DispatcherTimer();
        private SoundPlayer _player = new SoundPlayer();
        public EstimationOfStabilityToMonotonistanceControl(ESM_Mode mode = ESM_Mode.ESM, TestMode testMode = TestMode.Normal)
        {
            _Mode = mode;

            Mode = testMode;
            Initialize();
            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("Start", () => Start(null));
                TestMethods.Add("Stop", () => Stop());
            }
        }

        private MemoryStream _ms;
        private void Initialize()
        {
            Canva = new Canvas();
            Canva.Width = 500;
            Canva.Height = 500;
            generateCirclesAlternate(new Size(Canva.Width, Canva.Height));

            _indicators[_indexCurrentIndicator].IsEnabledIndicator = true;
            var byteArray =
                SoundResources.GetSoundArray("pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/EstimationOfStabilityToMonotonistance/Sounds/metronom.wav");
            _ms = new MemoryStream(byteArray);
            _player.Stream = _ms;

        }

        private void PlaySoundMetronom()
        {
            _player.Play();
        }

        public void Start(ISignals signals, bool isTestQuest = false)
        {
            if (Mode != TestMode.Manual)
            {
                _tableSignals = signals.Signals;
                switch (_Mode)
                {
                    case ESM_Mode.ESM:
                        TableSignals = GetTable();
                        break;
                    case ESM_Mode.ESM_M:
                        TableSignals = signals.Signals;
                        break;
                }
            }
            else
            {
                TableSignals = new List<RowTableSignals>()
                {
                     new RowTableSignals(1, new TimeSpan(0,0,5)),
                     new RowTableSignals(2, new TimeSpan(0,0,10))
                };
            }

            _isShowedMessages = isTestQuest;
            if (_isShowedMessages)
            {
                _messageTimer.Tick += _messageTimer_Tick;
                _messageTimer.Interval = TimeSpan.FromSeconds(1.5);
            }
            _timer.Interval = TimeSpan.FromSeconds(2);
            _timer.Tick += _timer_Tick;

            _soundTimer.Interval = TimeSpan.FromSeconds(1.7);
            _soundTimer.Tick += _soundTimer_Tick;

            _timerPasses.Interval = TimeSpan.FromSeconds(4);
            _timerPasses.Tick += _timerPasses_Tick;


            _timer.Start();
            _soundTimer.Start();
        }



        int countMissJump = 0;

        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _messageTimer.Stop();
            _timer.Start();
            _soundTimer.Start();
            IsButtonsEnabled = true;
        }

        public void Stop()
        {
            if (_timer != null)
                _timer.Tick += _timer_Tick;
            if (_soundTimer != null)
                _soundTimer.Tick += _soundTimer_Tick;
            if (_timerPasses != null)
                _timerPasses.Tick += _timerPasses_Tick;
            emptyPressCount = 0;
            _timer?.Stop();
            _soundTimer?.Stop();
            _timerPasses?.Stop();
            _player.Stop();
            _player.Dispose();
        }

        List<double> _reactions = new List<double>();

        private bool _isActiveJump = false;
        public bool IsActiveJump
        {
            get { return _isActiveJump; }
            set
            {
                _isActiveJump = value;
                OnPropertyChanged();
            }
        }

        private void _timerPasses_Tick(object sender, EventArgs e)
        {
            Message = "Был пропущен перескок";
            _reactions.Add(4.0);
            IsActiveJump = false;
            _timerPasses.Stop();

            if (_Mode == ESM_Mode.ESM_M && _reactions.Count <= 10)
            {
                countMissJump++;
                if (countMissJump == 2)
                {
                    RestartTest?.Invoke(this, new EventArgs());
                    countMissJump = 0;
                }
            }
        }

        private void _soundTimer_Tick(object sender, EventArgs e)
        {
            PlaySoundMetronom();
        }


        private void _timer_Tick(object sender, EventArgs e)
        {
            CurrentTime = _currentTime + new TimeSpan(0, 0, 2);
            if (_currentTime <= TimeSpan.FromSeconds(1830))
            {
                _indicators[_indexCurrentIndicator].IsEnabledIndicator = false;

                var timeInTableSignals = _tableSignals.FirstOrDefault(f => f.Time == _currentTime);
                if (timeInTableSignals != null)
                {
                    _indexCurrentIndicator = _indexCurrentIndicator + 2;
                    if (_indexCurrentIndicator == _indicators.Count)
                        _indexCurrentIndicator = 0;
                    else if (_indexCurrentIndicator > _indicators.Count)
                        _indexCurrentIndicator = 1;
                    _indicators[_indexCurrentIndicator].IsEnabledIndicator = true;
                    if (Mode != TestMode.Manual)
                        ResetTimer?.Invoke(this, new EventArgs());
                    IsActiveJump = true;
                    _timerPasses.Start();
                }
                else
                {
                    var _currentIndicator = _indicators[_indexCurrentIndicator];
                    _currentIndicator.IsEnabledIndicator = false;
                    _indexCurrentIndicator++;
                    if (_indexCurrentIndicator == _indicators.Count)
                        _indexCurrentIndicator = 0;
                    _indicators[_indexCurrentIndicator].IsEnabledIndicator = true;
                }
            }
            else
            {
                _timer.Stop();
                ReturnResults();
            }
        }

        private int emptyPressCount = 0;//Количество пустых нажатий
        public void PressButton(int time)
        {
            if (IsButtonsEnabled)
            {
                if (IsActiveJump)
                {
                    _timerPasses.Stop();
                    var curTime = TimeSpan.FromSeconds(time / 10000.0);
                    _reactions.Add(curTime.TotalSeconds);
                    IsActiveJump = false;
                }
                else
                    emptyPressCount++;
            }

        }

        private void ReturnResults()
        {
            var FirstTenJump = _reactions.GetRange(0, 10);
            var max = FirstTenJump.Max();
            var min = FirstTenJump.Min();
            FirstTenJump.Remove(max);
            FirstTenJump.Remove(min);

            var EightJump = FirstTenJump;


            var OtherJumpElevenToEightTeen = _reactions.GetRange(10, 8);
            var FirstTenAverage = EightJump.Count > 0 ? EightJump.Average() : 0.0;
            var coefsStabilityToMonotinistance = new List<double>();
            for (int i = 0; i < OtherJumpElevenToEightTeen.Count; i++)
            {
                var coef = FirstTenAverage / OtherJumpElevenToEightTeen[i] * 100;
                coefsStabilityToMonotinistance.Add(coef);
            }

            var countPasses2 = OtherJumpElevenToEightTeen.Where(f => f >= 4.0).Count();//пропуски во второй части
            var countPasses1 = _reactions.GetRange(0, 10).Where(f => f >= 4.0).Count();//пропуски в первой части
            var countCoefLess50Percent = coefsStabilityToMonotinistance.Where(w => w < 50).Count();
            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Среднее время реагирования в 1-й части теста"] = (float)FirstTenAverage,
                ["Коэффициент монотоноустойчивости < 50%"] = countCoefLess50Percent,
                ["Количество пропусков сигналов"] = countPasses1 + countPasses2,
                ["Времена реагирования"] = _reactions.Select(s => (float)s).ToArray()
            });
        }

        public void GetEmptyResults()
        {
            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Среднее время реагирования в 1-й части теста"] = (float)0.0,
                ["Коэффициент монотоноустойчивости < 50%"] = 0,
                ["Количество пропусков сигналов"] = 2,
                ["Времена реагирования"] = _reactions.Select(s => (float)s).ToArray()
            });
        }

        private List<RowTableSignals> GetTable()
        {
            Random rnd = new Random();
            var variant = rnd.Next(1, 4);
            if (variant == 1)
                return _tableSignals;
            else if (variant == 2)
            {
                foreach (var row in _tableSignals)
                    row.Time = row.Time + new TimeSpan(0, 0, 6);
                return _tableSignals;
            }
            else if (variant == 3)
            {
                foreach (var row in _tableSignals)
                    row.Time = row.Time - new TimeSpan(0, 0, 4);
                return _tableSignals;
            }
            return _tableSignals;
        }

        private void generateCirclesAlternate(Size canvasSize, int countCircles = 30)
        {
            var center = Canva.Height / 2.5;
            var angle = 360 / countCircles;
            Point centerPoint = new Point(center, 0);
            int curAngle = 0;
            for (int i = 270; i < 360; i = i + angle)
            {
                var color = ColorsCircle.Green;
                var indicator = generateCircle(centerPoint, i, canvasSize, GetColor(color, true));
                indicator.Color = color;
                Canva.Children.Add(indicator);
                _indicators.Add(indicator);
                curAngle = i;
            }

            for (int i = angle - (360 - curAngle); i < 270; i = i + angle)
            {
                var color = ColorsCircle.Green;
                var indicator = generateCircle(centerPoint, i, canvasSize, GetColor(color, true));
                indicator.Color = color;
                Canva.Children.Add(indicator);
                _indicators.Add(indicator);
            }
        }

        public void CloseRes()
        {
            if (_ms != null)
                _ms.Dispose();
            _player.Dispose();
            _timer.Stop();
            _timer.Dispose();
        }

        #region CalculatingCircles

        private Vector rotateVector(Point centerPoint, double angle)
        {
            double vX = (centerPoint.X * Math.Cos(toRadians(angle))) - (centerPoint.Y * Math.Sin(toRadians(angle)));
            double vY = (centerPoint.X * Math.Sin(toRadians(angle))) + (centerPoint.Y * Math.Cos(toRadians(angle)));
            return new Vector(vX, vY);
        }

        private double toRadians(double angle)
        {
            return (Math.PI * angle) / 180;
        }

        private Indicator generateCircle(Point centerpoint, double angle, Size canvasSize, Brush fill)
        {
            var v = rotateVector(centerpoint, angle);
            var elli = new Indicator() { Height = 20, Width = 20, IndicationColor = fill };

            //Сдвигаем точку, т. к. вектор строится от нуля
            v.X = (v.X + canvasSize.Width / 2);
            v.Y = (v.Y + canvasSize.Height / 2);

            elli.SetValue(Canvas.LeftProperty, v.X - elli.Width / 2);
            elli.SetValue(Canvas.TopProperty, v.Y - elli.Height / 2);
            elli.Angle = angle;
            return elli;
        }
        #endregion
    }

    public class RowTableSignals
    {
        public int NumberSignal { get; set; }
        public TimeSpan Time { get; set; }
        public RowTableSignals(int numberSignal, TimeSpan time)
        {
            NumberSignal = numberSignal;
            Time = time;
        }

        public TimeSpan IntervalFrom { get; set; }
        public TimeSpan IntervalTo { get; set; }

        public RowTableSignals(int numberSignal, TimeSpan intervalFrom, TimeSpan intervalTo)
        {
            NumberSignal = numberSignal;
            IntervalFrom = intervalFrom;
            IntervalTo = intervalTo;
            Time = GenerateTime();
        }

        private TimeSpan GenerateTime()
        {
            TimeSpan curTime;
            while (true)
            {
                int rawTime = _rnd.Next((int)IntervalFrom.TotalSeconds, (int)IntervalTo.TotalSeconds);
                if (rawTime % 2 == 0)
                {
                    curTime = TimeSpan.FromSeconds(rawTime);
                    break;
                }
            }
            return curTime;
        }
    }

    public enum ESM_Mode
    {
        ESM,
        ESM_M
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EstimationOfStabilityToMonotonistance\EstimationOfStabilityToMonotonistanceViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.EstimationOfStabilityToMonotonistance
{
    public class EstimationOfStabilityToMonotonistanceViewModel : TestBase
    {
        public override event EventHandler<Results> Results;

        private string message;
        public string Message
        {
            get { return message; }
            set
            {
                message = value;
                if (!string.IsNullOrEmpty(message))
                    _messageTimer?.Start();
                else
                    _messageTimer?.Stop();
                OnPropertyChanged();
            }
        }

        private PultButtons Buttons;
        public EstimationOfStabilityToMonotonistanceControl control;
        private ISignals signals;
        private ESM_Mode _mode;
        private DispatcherTimer _messageTimer = new DispatcherTimer();
        public EstimationOfStabilityToMonotonistanceViewModel(ISignals signals, ESM_Mode mode, EnumTests testType, PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            TestType = testType;
            _mode = mode;
            this.signals = signals;
            SetInstructions("estimationOfStabilityToMonotonistance");
            Manager.TraningTime = TimeSpan.FromSeconds(60);
            _messageTimer.Interval = TimeSpan.FromSeconds(5);
        }

        public override FrameworkElement GetTestControl()
        {
            return new EstimationOfStabilityToMonotonistanceControl(testMode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new EstimationOfStabilityToMonotonistanceControl(testMode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override void TestStart()
        {
            control = new EstimationOfStabilityToMonotonistanceControl(_mode);
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start(signals, true);
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception=e.Exception});
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        public override void Start()
        {
            control = new EstimationOfStabilityToMonotonistanceControl(_mode);
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.Results += TestCurrentView_Results;
            control.ResetTimer += Control_ResetTimer;
            if (_mode == ESM_Mode.ESM_M)
            {
                control.RestartTest += Control_RestartTest;
                _messageTimer.Tick += _messageTimer_Tick;
            }
            Buttons.Start();
            control.Start(signals);
        }

        private bool isTestWasARestart = false;
        private void Control_RestartTest(object sender, EventArgs e)
        {
            if (!isTestWasARestart)
            {
                Message = "Будьте внимательны!\r\n Вы пропустили 2 перескока!\r\n Сейчас снова запустится инструкция!";
            }
            else
            {
                Message = "Вы не готовы к тестированию!\r\n Тестирование прекращено!";
            }
        }

        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            if (!isTestWasARestart)// 2 пропуска сигналов переход к инструкции автоманический
            {
                isTestWasARestart = true;
                Stop();
                Manager.ToInstruction();
            }
            else// 2 пропуска повторно, окончание теста
            {
                control?.GetEmptyResults();
            }
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void TestCurrentView_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Green)
                control.PressButton(e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.RestartTest -= Control_RestartTest;
                control.Results -= TestCurrentView_Results;
                control.ResetTimer -= Control_ResetTimer;
                control.Stop();
                control.CloseRes();
            }
            if (_messageTimer != null)
            {
                _messageTimer.Tick -= _messageTimer_Tick;
                _messageTimer.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EstimationOfStabilityToMonotonistance\Indicator.cs


using System.Windows.Media;
using static Updk7.Tests.Wpf.Psychophysical.Common;

namespace Updk7.Tests.Wpf.Psychophysical.EstimationOfStabilityToMonotonistance
{
    public class Indicator:NotifyViewModelBase
    {
        private Brush _IndicationColor;
        public Brush IndicationColor
        {
            get { return _IndicationColor; }
            set
            {
                _IndicationColor = value;
                OnPropertyChanged();
            }
        }

        private ColorsCircle _color;
        public ColorsCircle Color
        {
            get { return _color; }
            set
            {
                _color = value;
                OnPropertyChanged();
            }
        }

        public double Angle { get; set; }

        private bool _IsEnabledIndicator;
        public bool IsEnabledIndicator
        {
            get { return _IsEnabledIndicator; }
            set
            {
                _IsEnabledIndicator = value;
                OnPropertyChanged();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EstimationOfStabilityToMonotonistance\ISignals.cs


using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.EstimationOfStabilityToMonotonistance
{
    public interface ISignals
    {
        List<RowTableSignals> Signals { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EstimationOfStabilityToMonotonistance\Signals.cs


using System;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.EstimationOfStabilityToMonotonistance
{
    public class Signals : ISignals
    {
        List<RowTableSignals> ISignals.Signals { get; set; } = new List<RowTableSignals>()
        {
            new RowTableSignals(1,new TimeSpan(0,0,38)),
            new RowTableSignals(2,new TimeSpan(0,0,52)),
            new RowTableSignals(3,new TimeSpan(0,1,26)),
            new RowTableSignals(4,new TimeSpan(0,1,50)),
            new RowTableSignals(5,new TimeSpan(0,2,14)),
            new RowTableSignals(6,new TimeSpan(0,2,48)),
            new RowTableSignals(7,new TimeSpan(0,3,16)),
            new RowTableSignals(8,new TimeSpan(0,3,44)),
            new RowTableSignals(9,new TimeSpan(0,4,12)),
            new RowTableSignals(10,new TimeSpan(0,4,30)),
            new RowTableSignals(11,new TimeSpan(0,5,40)),
            new RowTableSignals(12,new TimeSpan(0,8,20)),
            new RowTableSignals(13,new TimeSpan(0,10,10)),
            new RowTableSignals(14,new TimeSpan(0,14,14)),
            new RowTableSignals(15,new TimeSpan(0,18,18)),
            new RowTableSignals(16,new TimeSpan(0,20,20)),
            new RowTableSignals(17,new TimeSpan(0,25,40)),
            new RowTableSignals(18,new TimeSpan(0,29,50))
        };
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EstimationOfStabilityToMonotonistance\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.EstimationOfStabilityToMonotonistance"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels"
                    xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Converters">

    <Style TargetType="local:EstimationOfStabilityToMonotonistanceControl">
        <Setter Property="Background" Value="#FF727171"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:EstimationOfStabilityToMonotonistanceControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox>
                                        <ContentControl
                                            Focusable="False"
                                            Margin="5"
                                            Content="{Binding Canva,
                                            RelativeSource={RelativeSource FindAncestor,
                                            AncestorType={x:Type local:EstimationOfStabilityToMonotonistanceControl}}}"/>
                                    </Viewbox>
                                    <tests:MessageBoxControl
                                        Message="{Binding Message,
                                        RelativeSource={RelativeSource FindAncestor,
                                        AncestorType={x:Type local:EstimationOfStabilityToMonotonistanceControl}}}"/>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:EstimationOfStabilityToMonotonistanceControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                    DataContext="{Binding}"
                                                                    Background="{Binding Background}"
                                                                    BorderBrush="{Binding BorderBrush}"
                                                                    BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

    <Style TargetType="local:EstimationOfStabilityToMonotonistanceViewModel">
        <Style.Resources>
            <converters:StringOrEmptyConverter x:Key="StringOrEmptyConverter"/>
        </Style.Resources>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:EstimationOfStabilityToMonotonistanceViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False"
                                            Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <tests:MessageBoxControl x:Name="mBox" Message="{Binding Message,
                                                               RelativeSource={RelativeSource FindAncestor,
                                                               AncestorType={x:Type local:EstimationOfStabilityToMonotonistanceViewModel}}}"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:EstimationOfStabilityToMonotonistanceViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Message,
                                                   RelativeSource={RelativeSource Self},
                                                   Converter={StaticResource StringOrEmptyConverter}}" Value="true">
                            <Setter TargetName="mBox" Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <SolidColorBrush x:Key="DefaultBrushIndicator" Color="#FF535151"/>
    <Style TargetType="{x:Type local:Indicator}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Indicator}">
                    <ContentControl>
                        <Ellipse x:Name="el" StrokeThickness="1" Stroke="{x:Null}" Fill="{StaticResource DefaultBrushIndicator}"/>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsEnabledIndicator,RelativeSource={RelativeSource Self}}" Value="false">
                            <Setter TargetName="el" Property="Fill" Value="{StaticResource DefaultBrushIndicator}"/>
                            <Setter TargetName="el" Property="StrokeThickness" Value="1"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsEnabledIndicator, RelativeSource={RelativeSource Self}}" Value="true">
                            <Setter TargetName="el" Property="Fill" Value="{Binding IndicationColor, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Indicator}}}"/>
                            <Setter TargetName="el" Property="Margin" Value="-1"/>
                            <Setter TargetName="el" Property="Stroke" Value="#FFF4F4F4"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\EstimationOfStabilityToMonotonistanceM\Signals.cs


using System;
using System.Collections.Generic;
using Updk7.Tests.Wpf.Psychophysical.EstimationOfStabilityToMonotonistance;

namespace Updk7.Tests.Wpf.Psychophysical.EstimationOfStabilityToMonotonistanceM
{
    public class Signals: ISignals
    {
        List<RowTableSignals> ISignals.Signals { get; set; } = new List<RowTableSignals>()
        {
            new RowTableSignals(1, TimeSpan.FromSeconds(16), TimeSpan.FromSeconds(26)),
            new RowTableSignals(2, TimeSpan.FromSeconds(44), TimeSpan.FromSeconds(56)),
            new RowTableSignals(3,new TimeSpan(0,1,28),new TimeSpan(0,1,40)),
            new RowTableSignals(4,new TimeSpan(0,2,00),new TimeSpan(0,2,10)),
            new RowTableSignals(5,new TimeSpan(0,2,32),new TimeSpan(0,2,46)),
            new RowTableSignals(6,new TimeSpan(0,3,04),new TimeSpan(0,3,20)),
            new RowTableSignals(7,new TimeSpan(0,3,34),new TimeSpan(0,3,44)),
            new RowTableSignals(8,new TimeSpan(0,3,56),new TimeSpan(0,4,02)),
            new RowTableSignals(9,new TimeSpan(0,4,14),new TimeSpan(0,4,24)),
            new RowTableSignals(10,new TimeSpan(0,4,46),new TimeSpan(0,4,54)),
            new RowTableSignals(11,new TimeSpan(0,6,06),new TimeSpan(0,6,20)),
            new RowTableSignals(12,new TimeSpan(0,8,54),new TimeSpan(0,9,16)),
            new RowTableSignals(13,new TimeSpan(0,10,54),new TimeSpan(0,11,16)),
            new RowTableSignals(14,new TimeSpan(0,14,24),new TimeSpan(0,14,40)),
            new RowTableSignals(15,new TimeSpan(0,18,40),new TimeSpan(0,18,52)),
            new RowTableSignals(16,new TimeSpan(0,20,10),new TimeSpan(0,20,20)),
            new RowTableSignals(17,new TimeSpan(0,25,24),new TimeSpan(0,25,26)),
            new RowTableSignals(18,new TimeSpan(0,29,44),new TimeSpan(0,29,54))
        };
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ExpressSampleVigilance\ExpressSampleVigilanceControl.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Media;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using static Updk7.Tests.Wpf.Psychophysical.Common;
using static Updk7.Tests.Wpf.Psychophysical.Common.Drawing;

namespace Updk7.Tests.Wpf.Psychophysical.ExpressSampleVigilance
{
    public class ExpressSampleVigilanceControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler ResetTimer;
        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }
        private List<Indicator> _indicators = new List<Indicator>();
        private Indicator _centerCircle = null;
        private DispatcherTimer _timer = new DispatcherTimer();
        private SoundPlayer _player = new SoundPlayer();
        private DispatcherTimer _timeOutTimer = new DispatcherTimer();

        private List<RowSignal> _signalsTable = new List<RowSignal>()
        {
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,6)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,15)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,30)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,42)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,51)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,63)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,69)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,81)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,87)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,105)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,111)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,120)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,124)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,159)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,165)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,177)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,198)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,201)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,213)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,225)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,231))
        };

        public List<RowSignal> Signals
        {
            get { return _signalsTable; }
            set
            {
                _signalsTable = value;
                OnPropertyChanged();
            }
        }

        private int _currentIndex;
        public int CurrentIndex
        {
            get { return _currentIndex; }
            set
            {
                _currentIndex = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private TypeSignals? _currentSignal = null;
        private TimeSpan _time = new TimeSpan(0, 0, 0);
        private int _indexRow = 0;
        private int _signalWithWarningPasses = 0;
        private int _signalAlarmPasses = 0;
        private List<double> _reactionsAlarm = new List<double>();
        private List<double> _reactionsSignalWithWarning = new List<double>();
        private int _countLeftPressed = 0;

        public ExpressSampleVigilanceControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            Initialize();
            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("Start", () => Start());
                TestMethods.Add("Stop", () => Stop());
            }
        }

        private MemoryStream _ms;
        public void Start()
        {
            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick += _timer_Tick;

            _timeOutTimer.Tick += _timeOutTimer_Tick;

            var byteArray =
               SoundResources.GetSoundArray("pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/beep.wav");
            _ms = new MemoryStream(byteArray);
            _player.Stream = _ms;

            if (Mode == TestMode.Manual)
            {
                _signalsTable = new List<RowSignal>()
                {
                    new RowSignal(TypeSignals.Alarm, new TimeSpan(0,0,6)),

                    new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,12)),
                    new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,18)),
                };
            }

            OnPropertyChanged(nameof(Signals));
            _timer.Start();
        }

        private void Initialize()
        {
            Canva = new Canvas();
            Canva.Width = 500;
            Canva.Height = 500;
            generateCircles(new Size(Canva.Width, Canva.Height));
            CurrentIndex = 0;
            _indicators[CurrentIndex].IsEnabledIndicator = true;
        }

        public void Stop()
        {
            _player.Stop();
            _player.Dispose();
            _timeOutTimer.Stop();
            _timeOutTimer.Tick -= _timeOutTimer_Tick;
            _timer.Tick -= _timer_Tick;
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            _time = _time.Add(new TimeSpan(0, 0, 1));
            var rowSignal = _signalsTable.FirstOrDefault(f => f.Time == _time);

            if (rowSignal != null)
            {
                var signal = rowSignal.Type;
                switch (signal)
                {
                    case TypeSignals.Alarm:
                        Jump();
                        _currentSignal = TypeSignals.Alarm;
                        _timeOutTimer.Interval = TimeSpan.FromSeconds(4);
                        if (Mode != TestMode.Manual)
                        {
                            _timeOutTimer.Start();
                            ResetTimer?.Invoke(this, new EventArgs());
                        }
                        break;
                    case TypeSignals.SignalWithWarning:
                        Jump();
                        _currentSignal = TypeSignals.SignalWithWarning;
                        _timeOutTimer.Interval = TimeSpan.FromSeconds(1);
                        if (Mode != TestMode.Manual)
                        {
                            _timeOutTimer.Start();
                            ResetTimer?.Invoke(this, new EventArgs());
                        }
                        break;
                    case TypeSignals.AttentionSignal:
                        YellowSignalActive();
                        _currentSignal = TypeSignals.AttentionSignal;
                        _indicators[CurrentIndex].IsEnabledIndicator = false;
                        CurrentIndex++;
                        if (CurrentIndex == _indicators.Count)
                            CurrentIndex = 0;
                        _indicators[CurrentIndex].IsEnabledIndicator = true;
                        _timer.Interval = TimeSpan.FromSeconds(1);
                        _timeOutTimer.Interval = TimeSpan.FromSeconds(2);
                        _timeOutTimer.Start();
                        break;
                }

                _indexRow++;
            }
            else
            {
                _indicators[CurrentIndex].IsEnabledIndicator = false;
                CurrentIndex++;
                if (CurrentIndex == _indicators.Count)
                    CurrentIndex = 0;
                _indicators[CurrentIndex].IsEnabledIndicator = true;
                _timer.Interval = TimeSpan.FromSeconds(1);
            }
            PlaySound();

            if (_time.TotalSeconds >= 240 && _time.TotalSeconds != 0)
            {
                _timer.Stop();
                ReturtResult();
            }
        }

        private void ReturtResult()
        {
            var reactionsAlarmAverage = (float)(_reactionsAlarm.Count > 0 ? _reactionsAlarm.Average() : 0.0);
            var reactionsSignalWithWarningAverage = (float)(_reactionsSignalWithWarning.Count > 0 ? _reactionsSignalWithWarning.Average() : 0.0);

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Среднеарифметическое время реагирования на сигналы без предупреждения"] = reactionsAlarmAverage,
                ["Среднеарифметическое время реагирования на сигналы с предупреждением"] = reactionsSignalWithWarningAverage,
                ["Число пропущенных сигналов без предупреждения"] = _signalAlarmPasses,
                ["Готовность"] = reactionsAlarmAverage - reactionsSignalWithWarningAverage,
                ["Число пропущенных сигналов с предупреждением"] = _signalWithWarningPasses,
                ["Времена реагирования на перескоки без предупреждения"] = _reactionsAlarm.Select(s => (float)s).ToArray(),
                ["Времена реагирования на перескоки с предупреждением"] = _reactionsSignalWithWarning.Select(s => (float)s).ToArray(),
                ["Число реагирований при отсутствии сигналов"] = _countLeftPressed
            });
        }

        private void _timeOutTimer_Tick(object sender, EventArgs e)
        {
            switch (_currentSignal.Value)
            {
                case TypeSignals.Alarm:
                    _signalAlarmPasses++;
                    break;
                case TypeSignals.SignalWithWarning:
                    _signalWithWarningPasses++;
                    break;
                case TypeSignals.AttentionSignal:
                    _centerCircle.IsEnabledIndicator = false;
                    break;
            }
            _currentSignal = TypeSignals.NoActive;
            _timeOutTimer.Stop();
        }

        private void YellowSignalActive()
        {
            _centerCircle.IndicationColor = GetColor(ColorsCircle.Yellow);
            _centerCircle.IsEnabledIndicator = true;
        }

        public void PressButtton(Buttons button, int time)
        {
            if (_currentSignal != TypeSignals.NoActive && _currentSignal != TypeSignals.AttentionSignal)
            {
                if (button == Buttons.Green)
                {
                    if (_currentSignal == TypeSignals.Alarm)
                    {
                        var curTime = Common.Rounding(TimeSpan.FromSeconds(time / 10000.0).TotalSeconds, 3);
                        _reactionsAlarm.Add(curTime);
                        _indicators[CurrentIndex].IsEnabledIndicator = false;
                        CurrentIndex = CurrentIndex - 1;
                        if (CurrentIndex < 0)
                            CurrentIndex = _indicators.Count - 1;
                        _indicators[CurrentIndex].IsEnabledIndicator = true;
                        _timer.Interval = TimeSpan.FromSeconds(1);
                        _currentSignal = TypeSignals.NoActive;
                        _timeOutTimer.Stop();
                    }
                    else if (_currentSignal == TypeSignals.SignalWithWarning)
                    {
                        var curTime = Common.Rounding(TimeSpan.FromSeconds(time / 10000.0).TotalSeconds, 3);
                        _reactionsSignalWithWarning.Add(curTime);
                        _indicators[CurrentIndex].IsEnabledIndicator = false;
                        CurrentIndex = CurrentIndex - 1;
                        if (CurrentIndex < 0)
                            CurrentIndex = _indicators.Count - 1;
                        _indicators[CurrentIndex].IsEnabledIndicator = true;
                        _timer.Interval = TimeSpan.FromSeconds(1);
                        _currentSignal = TypeSignals.NoActive;
                        _timeOutTimer.Stop();
                    }
                }
            }
            else if (_currentSignal == TypeSignals.NoActive)//Возможно AttentionSignal стоит сюда добавить
                _countLeftPressed++;
        }

        private void Jump()
        {
            _indicators[CurrentIndex].IsEnabledIndicator = false;
            CurrentIndex = CurrentIndex + 2;
            if (CurrentIndex == _indicators.Count)
                CurrentIndex = 0;
            else if (CurrentIndex > _indicators.Count)
                CurrentIndex = 1;
            _indicators[CurrentIndex].IsEnabledIndicator = true;
        }

        private void PlaySound()
        {
            _player.Play();
        }

        private void ModificationTableSignalTimePlus(TimeSpan timePlus)
        {
            foreach (var rowSignal in _signalsTable)
                rowSignal.Time.Add(timePlus);
        }

        public void CloseRes()
        {
            if (_ms != null)
                _ms.Dispose();
            _player.Dispose();
        }

        #region generator

        private void generateCircles(Size canvasSize, int countCircles = 60)
        {
            var center = Canva.Height / 2;
            var angle = 360 / countCircles;
            Point centerPoint = new Point(center, 0);
            Size indicatorSize = new Size(15, 15);

            for (int i = 270; i < 360; i = i + angle)
                SetIndicator(canvasSize, centerPoint, indicatorSize, i);

            for (int i = 0; i < 270; i = i + angle)
                SetIndicator(canvasSize, centerPoint, indicatorSize, i);

            var cCircle = new Indicator();
            cCircle.Height = cCircle.Width = indicatorSize.Height * 2;
            cCircle.SetValue(Canvas.LeftProperty, (Canva.Width / 2) - cCircle.Width / 2);
            cCircle.SetValue(Canvas.TopProperty, (Canva.Height / 2) - cCircle.Height / 2);
            Canva.Children.Add(cCircle);
            _centerCircle = cCircle;
        }

        private void SetIndicator(Size canvasSize, Point centerPoint, Size indicatorSize, int i)
        {
            var color = ColorsCircle.Green;
            var indicator = generateCircle(centerPoint, indicatorSize, i, canvasSize, GetColor(color, true));
            indicator.Color = color;
            Canva.Children.Add(indicator);
            _indicators.Add(indicator);
        }

        private Vector rotateVector(Point centerPoint, double angle)
        {
            double vX = (centerPoint.X * Math.Cos(toRadians(angle))) - (centerPoint.Y * Math.Sin(toRadians(angle)));
            double vY = (centerPoint.X * Math.Sin(toRadians(angle))) + (centerPoint.Y * Math.Cos(toRadians(angle)));
            return new Vector(vX, vY);
        }

        private double toRadians(double angle)
        {
            return (Math.PI * angle) / 180;
        }

        private Indicator generateCircle(Point centerpoint, Size size, double angle, Size canvasSize, Brush fill)
        {
            var v = rotateVector(centerpoint, angle);
            var elli = new Indicator() { Height = size.Height, Width = size.Width, IndicationColor = fill };

            //Сдвигаем точку, т. к. вектор строится от нуля
            v.X = (v.X + canvasSize.Width / 2);
            v.Y = (v.Y + canvasSize.Height / 2);

            elli.SetValue(Canvas.LeftProperty, v.X - elli.Width / 2);
            elli.SetValue(Canvas.TopProperty, v.Y - elli.Height / 2);
            elli.Angle = angle;
            return elli;
        }
        #endregion
    }

    public enum Buttons
    {
        Green
    }

    public class RowSignal
    {
        public TypeSignals Type { get; set; }
        public TimeSpan Time { get; set; }
        public RowSignal(TypeSignals type, TimeSpan time)
        {
            Type = type;
            Time = time;
        }
    }

    public enum TypeSignals
    {
        Alarm,            //экстренный сигнал
        SignalWithWarning,//сигнал с предупреждением
        AttentionSignal,//жёлтый предупреждающий сигнал (центральная точка в круге)
        NoActive//Нет активности (сигнала)
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ExpressSampleVigilance\ExpressSampleVigilanceViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.ExpressSampleVigilance
{
    public class ExpressSampleVigilanceViewModel : TestBase
    {
        public override event EventHandler<Results> Results;

        private Pult.PultButtons Buttons;
        public ExpressSampleVigilanceControl control;
        public ExpressSampleVigilanceViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("expressSampleVigilance");
            Manager.TraningTime = TimeSpan.FromSeconds(80);
        }

        public override FrameworkElement GetTestControl()
        {
            return new ExpressSampleVigilanceControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new ExpressSampleVigilanceControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override void TestStart()
        {
            control = new ExpressSampleVigilanceControl();
            TestCurrentView = control;
            Buttons = Pult as Pult.PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start();
        }

        private void Buttons_Disconnected(object sender, Pult.DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception});
        }

        public override void Start()
        {
            control = new ExpressSampleVigilanceControl();
            TestCurrentView = control;
            Buttons = Pult as Pult.PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.Results += TestCurrentView_Results;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start();
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void TestCurrentView_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Psychophysical.Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Buttons_ButtonPressed(object sender, Pult.ButtonPressedEventArgs e)
        {
            if (e.Button == Tests.Pult.PultButton.Green)
                control.PressButtton(ExpressSampleVigilance.Buttons.Green,e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.ResetTimer -= Control_ResetTimer;
                control.Results -= TestCurrentView_Results;
                control.Stop();
                control.CloseRes();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ExpressSampleVigilance\Indicator.cs


using System.Windows.Media;
using static Updk7.Tests.Wpf.Psychophysical.Common;

namespace Updk7.Tests.Wpf.Psychophysical.ExpressSampleVigilance
{
    public class Indicator : NotifyViewModelBase
    {
        private Brush _IndicationColor;
        public Brush IndicationColor
        {
            get { return _IndicationColor; }
            set
            {
                _IndicationColor = value;
                OnPropertyChanged();
            }
        }

        private ColorsCircle _color;
        public ColorsCircle Color
        {
            get { return _color; }
            set
            {
                _color = value;
                OnPropertyChanged();
            }
        }

        public double Angle { get; set; }

        private bool _IsEnabledIndicator;
        public bool IsEnabledIndicator
        {
            get { return _IsEnabledIndicator; }
            set
            {
                _IsEnabledIndicator = value;
                OnPropertyChanged();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ExpressSampleVigilance\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.ExpressSampleVigilance"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:ExpressSampleVigilanceControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ExpressSampleVigilanceControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox Margin="0,20,0,20" Height="900" Width="900">
                                             <ContentControl Focusable="False" Margin="5" Content="{Binding Canva, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ExpressSampleVigilanceControl}}}"/>
                                         </Viewbox>
                                         <ContentPresenter
                                             Grid.ColumnSpan="3"
                                             Content="{Binding LearningPanel,
                                                       RelativeSource={RelativeSource 
                                                       AncestorType={x:Type local:ExpressSampleVigilanceControl}}}">
                                             <ContentPresenter.Resources>
                                                 <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                     <panels:CanvasPanelView Margin="5"
                                                                         DataContext="{Binding}"
                                                                         Background="{Binding Background}"
                                                                         BorderBrush="{Binding BorderBrush}"
                                                                         BorderThickness="{Binding BorderThickness}"/>
                                                 </DataTemplate>
                                             </ContentPresenter.Resources>
                                         </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ExpressSampleVigilanceViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ExpressSampleVigilanceViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:ExpressSampleVigilanceViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <SolidColorBrush x:Key="DefaultBrushIndicator" Color="#FF969696"/>
    <Style TargetType="{x:Type local:Indicator}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Indicator}">
                    <ContentControl>
                        <Ellipse x:Name="el" StrokeThickness="1" Stroke="{x:Null}" Fill="{StaticResource DefaultBrushIndicator}"/>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsEnabledIndicator,RelativeSource={RelativeSource Self}}" Value="false">
                            <Setter TargetName="el" Property="Fill" Value="{StaticResource DefaultBrushIndicator}"/>
                            <Setter TargetName="el" Property="StrokeThickness" Value="1"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsEnabledIndicator, RelativeSource={RelativeSource Self}}" Value="true">
                            <Setter TargetName="el" Property="Fill" Value="{Binding IndicationColor, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Indicator}}}"/>
                            <Setter TargetName="el" Property="Margin" Value="-1"/>
                            <Setter TargetName="el" Property="Stroke" Value="White"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\FeelingTime\FeelingTimeControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.FeelingTime
{
    public class FeelingTimeControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<bool> ControlingLed;
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler ResetTimer;
        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        DispatcherTimer _timer = new DispatcherTimer();
        private bool _isPreview = false;
        private bool _isLedEnabled = false;
        public FeelingTimeControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            _timer.Interval = TimeSpan.FromSeconds(2);
            _timer.Tick += _timer_Tick;
        }
        private int _countPreview = 0;
        private int _countShowLedInMainQuest = 0;
        private void _timer_Tick(object sender, EventArgs e)
        {
            if (_isPreview)
            {
                if (!_isLedEnabled)
                {
                       ControlingLed?.Invoke(this, true);
                    _timer.Interval = TimeSpan.FromSeconds(2.45);
                    _isLedEnabled = true;
                }
                else
                {
                       ControlingLed?.Invoke(this, false);
                    _timer.Interval = TimeSpan.FromSeconds(2.0);
                    _isLedEnabled = false;
                    _countPreview++;
                }
                if (_countPreview == 3)
                    _isPreview = false;
            }
            else
            {
                if (!_isLedEnabled)
                {
                    //LedOnOff(true);
                    ControlingLed?.Invoke(this, true);
                    ResetTimer?.Invoke(this, new EventArgs());
                    _timer.Interval = TimeSpan.FromSeconds(2.45);
                    _isLedEnabled = true;
                    _timer.Stop();
                }
            }
        }

        private List<TimeSpan> _reactions = new List<TimeSpan>();

        public void PressButton(int time)
        {
            if (!_isPreview)
            {
                var curTime = TimeSpan.FromSeconds(time / 10000.0);
                _reactions.Add(curTime);
               // LedOnOff(false);
                ControlingLed?.Invoke(this, false);
                _timer.Interval = TimeSpan.FromSeconds(Common.GetRandomNumber(1.5, 4));
                _isLedEnabled = false;
                _countShowLedInMainQuest++;
                if (_countShowLedInMainQuest == 15)
                    ReturnResult();
                else
                    _timer.Start();
            }
        }

        private void ReturnResult()
        {
            Stop();
            var AccurateTimeIntervals = _reactions.Where(s => s.TotalMilliseconds <= 2600 && s.TotalMilliseconds >= 2300).Select(f => f.TotalMilliseconds);
            var UndervaluedTimeIntervals = _reactions.Where(s => s.TotalMilliseconds < 2300).Select(f =>f.TotalMilliseconds);
            var OvervaluedTimeIntervals = _reactions.Where(s => s.TotalMilliseconds > 2600).Select(f => f.TotalMilliseconds);
            var averageUndervaluedTimeIntervals = UndervaluedTimeIntervals.Count() > 0 ? UndervaluedTimeIntervals.Average() : 0.0;
            var averageOvervaluedTimeIntervals = OvervaluedTimeIntervals.Count() > 0 ? OvervaluedTimeIntervals.Average() : 0.0;
            var averageTotalTime = _reactions.Count > 0 ? _reactions.Select(s => s.TotalMilliseconds).Average() : 0.0;

            var middleSummReactions = _reactions.Count > 1 ? _reactions.Sum(su => su.TotalMilliseconds) / (_reactions.Count - 1) : 0.0;
            var rms = Math.Sqrt(_reactions.Count > 0 ? _reactions.Sum(s => Math.Pow(s.TotalMilliseconds - middleSummReactions, 2)) / (_reactions.Count - 1) : 0.0);

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Количество точных интервалов времени"] = AccurateTimeIntervals.Count(),
                ["Количество переоцененных интервалов"] = OvervaluedTimeIntervals.Count(),
                ["Количество недооцененных интервалов"] = UndervaluedTimeIntervals.Count(),

                ["Среднее время переоцененных интервалов"] = (float)averageOvervaluedTimeIntervals / 1000,
                ["Среднее время недооцененных интервалов"] = (float)averageUndervaluedTimeIntervals / 1000,
                
                ["Среднее время общее"] = (float)averageTotalTime / 1000,
                ["Среднеквадратичное отклонение общее"] = (float)rms / 1000
            });
        }

        public void Start()
        {
            _isPreview = true;
            _timer.Start();
        }

        public void Stop()
        {
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\FeelingTime\FeelingTimeViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.FeelingTime
{
    public class FeelingTimeViewModel : TestBase
    {
        public override event EventHandler<Results> Results;
        
        private PultLed Led;
        private PultButtons Buttons;
        private FeelingTimeControl control;
        public FeelingTimeViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("feelingTime");
            Manager.TraningTime = TimeSpan.FromSeconds(45);
        }
        public override FrameworkElement GetTestControl()
        {
            return new FeelingTimeControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new FeelingTimeControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override void TestStart()
        {
            control = new FeelingTimeControl();
            TestCurrentView = control;
            Led = Pult as PultLed;
            Buttons = AdditionalPult as Pult.PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Led.Disconnected += Disconnected;
            Buttons.Disconnected += Disconnected;
            control.ControlingLed += Control_ControlingLed;
            control.ResetTimer += Control_ResetTimer;
            control.Start();
            Buttons.Start();
        }

        public override void Start()
        {
            control = new FeelingTimeControl();
            TestCurrentView = control;
            Led = Pult as PultLed;
            Buttons = AdditionalPult as Pult.PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Led.Disconnected += Disconnected;
            Buttons.Disconnected += Disconnected;
            control.ControlingLed += Control_ControlingLed;
            control.Results += Control_Results;
            control.ResetTimer += Control_ResetTimer;
            control.Start();
            Buttons.Start();
        }
        private void Disconnected(object sender, DisconnectedEventArgs e)
        {
            Exception = e.Exception;
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Control_ControlingLed(object sender, bool e)
        {
            try
            {
                Led.LedState = e ? true : false;
            }
            catch (Exception ex)
            {
                Exception = ex;
                Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = new PultException("Ошибка пульта") });
            }
        }

        private void Buttons_ButtonPressed(object sender, Pult.ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Red)
                control.PressButton(e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Disconnected -= Disconnected;
                Buttons.Stop();
            }
            if (Led != null)
            {
                if (Exception == null)
                    Led.LedState = false;
                Led.Disconnected -= Disconnected;   
            }
            if (control != null)
            {
                control.ResetTimer -= Control_ResetTimer;
                control.ControlingLed -= Control_ControlingLed;
                control.Results -= Control_Results;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\FeelingTime\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.FeelingTime"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels"
                    xmlns:learningExtension="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension">
    <Style TargetType="local:FeelingTimeControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:FeelingTimeControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox>
                                        <ContentControl Focusable="False"
                                                         Margin="5"
                                                         Content="{Binding Canva,
                                                                   RelativeSource={RelativeSource FindAncestor,
                                                                   AncestorType={x:Type local:FeelingTimeControl}}}"/>
                                    </Viewbox>
                                    <tests:MessageBoxControl x:Name="mBox" Message="Следите за лампочкой на пульте"/>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:FeelingTimeControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Mode, RelativeSource={RelativeSource Self}}"
                                     Value="{x:Static learningExtension:TestMode.Manual}">
                            <Setter TargetName="mBox" Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:FeelingTimeViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:FeelingTimeViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:FeelingTimeViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Game5\Game5Control.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.Game5
{
    public class Game5Control : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        private Canvas canva;
        public Canvas Canva
        {
            get { return canva; }
            set
            {
                canva = value;
                OnPropertyChanged();
            }
        }

        public bool IsEtalon
        {
            get { return (bool)GetValue(IsEtalonProperty); }
            set { SetValue(IsEtalonProperty, value); }
        }

        public static readonly DependencyProperty IsEtalonProperty =
            DependencyProperty.Register("IsEtalon", typeof(bool), typeof(Game5Control), new PropertyMetadata(false, IsEtalonChanged));

        private static void IsEtalonChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue != e.OldValue && (bool)e.NewValue)
            {
                (d as Game5Control).SetEtalon();
            }
        }

        private void SetEtalon()
        {
            var canvas = new Canvas();
            canvas.Background = Brushes.WhiteSmoke;
            canvas.Height = 2 * _HeightWidth;
            canvas.Width = 3 * _HeightWidth;
            for (int i = 0; i < 2; i++)
                for (int j = 0; j < 3; j++)
                {
                    _matrix[i, j] = _etalonMatrix[i,j];
                    if (_etalonMatrix[i, j] != 0)
                    {
                        var number = new NumberControl();
                        number.Number = _etalonMatrix[i, j];
                        number.Height = number.Width = _HeightWidth;
                        number.SetValue(Canvas.LeftProperty, j * _HeightWidth);
                        number.SetValue(Canvas.TopProperty, i * _HeightWidth);
                        canvas.Children.Add(number);
                    }
                }
            Canva = canvas;
        }

        List<VariantQuest> variants = new List<VariantQuest>()
        {
            new VariantQuest(new List<int> { 2, 5, 4, 1, 3, 0 }, 10),
            new VariantQuest(new List<int> { 4, 3, 1, 5, 2, 0 }, 10),
            new VariantQuest(new List<int> { 4, 5, 1, 2, 3, 0 }, 10),
            new VariantQuest(new List<int> { 4, 1, 5, 3, 2, 0 }, 10),
            new VariantQuest(new List<int> { 3, 5, 2, 1, 4, 0 }, 10),
            new VariantQuest(new List<int> { 3, 4, 5, 1, 2, 0 }, 10)
        };

        private int[,] _matrix = new int[2, 3];
        private int[,] _etalonMatrix = new int[2, 3]
        {
            { 1, 2, 3 },
            { 4, 5, 0 }
        };

        private double _HeightWidth = 400;

        private DateTime _startTime;
        private VariantQuest _currentVariant;

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        public Game5Control(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("Start", () => Start());
                TestMethods.Add("SetEtalon", () => SetEtalon());
                TestMethods.Add("PressNumber1", () => PressNumber1());
                TestMethods.Add("PressNumber2", () => PressNumber2());
                TestMethods.Add("PressNumber3", () => PressNumber3());
                TestMethods.Add("PressNumber4", () => PressNumber4());
                TestMethods.Add("PressNumber5", () => PressNumber5());
            }
        }

        public Game5Control()
        {
           
        }

        private List<NumberControl> _numberControls = new List<NumberControl>();
        private void GenerateScene()
        {
            var canvas = new Canvas();
            canvas.Background = Brushes.WhiteSmoke;
            canvas.Height = 2 * _HeightWidth;
            canvas.Width = 3 * _HeightWidth;
            if (Mode != TestMode.Manual)
                _currentVariant = variants[Common._rnd.Next(0, variants.Count)];
            else
                _currentVariant = variants[0];
            int indexInVariant = 0;
            for (int i = 0; i < 2; i++)
                for (int j = 0; j < 3; j++)
                {
                    var value = _currentVariant.Values[indexInVariant];
                    _matrix[i, j] = value;
                    if (value != 0)
                    {
                        var number = new NumberControl();
                        number.Number = value;
                        number.Height = number.Width = _HeightWidth;
                        number.SetValue(Canvas.LeftProperty, j * _HeightWidth);
                        number.SetValue(Canvas.TopProperty, i * _HeightWidth);
                        number.MouseDown += Number_MouseDown;
                        _numberControls.Add(number);
                        canvas.Children.Add(number);
                    }
                    indexInVariant++;
                }
            Canva = canvas;
            SaveState();
            _startTime = DateTime.Now;
        }

        public void Start()
        {
            GenerateScene();
        }

        public void Stop()
        {

        }

        private List<int[,]> _savedStates = new List<int[,]>();

        private void Number_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (Mode != TestMode.Manual)
            {
                NumberControl numberC = sender as NumberControl;
                ChangePositionNumberControl(numberC);
            }
        }

        private void PressNumber1()
        {
            ChangePositionNumberControl(_numberControls.FirstOrDefault(f => f.Number == 1));
        }

        private void PressNumber2()
        {
            ChangePositionNumberControl(_numberControls.FirstOrDefault(f => f.Number == 2));
        }

        private void PressNumber3()
        {
            ChangePositionNumberControl(_numberControls.FirstOrDefault(f => f.Number == 3));
        }

        private void PressNumber4()
        {
            ChangePositionNumberControl(_numberControls.FirstOrDefault(f => f.Number == 4));
        }

        private void PressNumber5()
        {
            ChangePositionNumberControl(_numberControls.FirstOrDefault(f => f.Number == 5));
        }

        private void ChangePositionNumberControl(NumberControl numberC)
        {
            var position = findIndex(numberC.Number);
            if (position[0] + 1 < 2 && _matrix[position[0] + 1, position[1]] == 0)
                OffsetDown(position, numberC);
            else if (position[0] - 1 >= 0 && _matrix[position[0] - 1, position[1]] == 0)
                OffsetUp(position, numberC);
            else if (position[1] + 1 < 3 && _matrix[position[0], position[1] + 1] == 0)
                OffsetRight(position, numberC);
            else if (position[1] - 1 >= 0 && _matrix[position[0], position[1] - 1] == 0)
                OffsetLeft(position, numberC);
            var equals = Equals(_matrix, _etalonMatrix);
            if (equals)
                ReturnResult();
            else
                SaveState();
        }

        private void SaveState()
        {
            var savedMatrix = new int[2, 3];
            for (int i = 0; i < 2; i++)
                for (int j = 0; j < 3; j++)
                    savedMatrix[i, j] = _matrix[i, j];
            _savedStates.Add(savedMatrix);
        }

        private void ReturnResult()
        {
            var time = DateTime.Now - _startTime;
            var stringSavedStates = new List<string>();
            foreach (var state in _savedStates)
            {
                string curStroke = "";
                for (int i = 0; i < 2; i++)
                    for (int j = 0; j < 3; j++)
                        curStroke = curStroke + $"{ state[i, j]}";
                stringSavedStates.Add(curStroke);
            }
            int countRepeats = 0;
            var duplicates = stringSavedStates
    .GroupBy(i => i)
    .Where(g => g.Count() > 1);
            foreach (var dup in duplicates)
                countRepeats = countRepeats + dup.Count();

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Вариант прямоугольника"] = int.Parse(_currentVariant.ToString()),
                ["Минимальное число ходов"] = _currentVariant.MinStepsCount,
                ["Сделанное число ходов"] = _savedStates.Count,
                ["Время выполнения"] = (float)time.TotalSeconds,
                ["Общее количество повторяющихся позиций"] = countRepeats
            });
        }

        private bool Equals(int[,] m1, int[,] m2)
        {
            for (int i = 0; i < 2; i++)
                for (int j = 0; j < 3; j++)
                {
                    if (m1[i, j] != m2[i, j])
                        return false;
                }
            return true;
        }

        private void OffsetLeft(int[] position, NumberControl numberC)
        {
            numberC.SetValue(Canvas.LeftProperty, (position[1] - 1) * _HeightWidth);
            numberC.SetValue(Canvas.TopProperty, position[0] * _HeightWidth);
            _matrix[position[0], position[1] - 1] = numberC.Number;
            _matrix[position[0], position[1]] = 0;
        }

        private void OffsetRight(int[] position, NumberControl numberC)
        {
            numberC.SetValue(Canvas.LeftProperty, (position[1] + 1) * _HeightWidth);
            numberC.SetValue(Canvas.TopProperty, position[0] * _HeightWidth);
            _matrix[position[0], position[1] + 1] = numberC.Number;
            _matrix[position[0], position[1]] = 0;
        }

        private void OffsetUp(int[] position, NumberControl numberC)
        {
            numberC.SetValue(Canvas.LeftProperty, position[1] * _HeightWidth);
            numberC.SetValue(Canvas.TopProperty, (position[0] - 1) * _HeightWidth);
            _matrix[position[0] - 1, position[1]] = numberC.Number;
            _matrix[position[0], position[1]] = 0;
        }

        private void OffsetDown(int[] position, NumberControl numberC)
        {
            numberC.SetValue(Canvas.LeftProperty, position[1] * _HeightWidth);
            numberC.SetValue(Canvas.TopProperty, (position[0] + 1) * _HeightWidth);
            _matrix[position[0] + 1, position[1]] = numberC.Number;
            _matrix[position[0], position[1]] = 0;
        }

        private int[] findIndex(int value)
        {
            for (int i = 0; i < 2; i++)
                for (int j = 0; j < 3; j++)
                {
                    if (_matrix[i, j] == value)
                        return new int[2] { i, j };
                }
            return new int[2] { -1, -1 };
        }
    }

    public class VariantQuest
    {
        public List<int> Values { get; private set; }
        public int MinStepsCount { get; private set; }

        public VariantQuest(List<int> values, int minStepsCount)
        {
            Values = values;
            MinStepsCount = minStepsCount;
        }

        public override string ToString()
        {
            string s = "";
            foreach (int value in Values)
                s = s + $"{value}";
            return s;
        }
    }
}


*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Game5\Game5ViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.Game5
{
    public class Game5ViewModel : TestBase
    {
        public override event EventHandler<Results> Results;

        private Game5Control control;
        public Game5ViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("game5");
            Manager.TraningTime = Common.GetSeconds(35);
        }
        public override FrameworkElement GetTestControl()
        {
            return new Game5Control(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new Game5Control(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            control = new Game5Control()
            {
                //Height = (double)new LengthConverter().ConvertFromString("10cm"),
                //Width = (double)new LengthConverter().ConvertFromString("15cm")
            };
            TestCurrentView = control;
            control.Results += TestExerciseEnd;
            control.Start();
        }

        private void TestExerciseEnd(object sender, Dictionary<string, object> e)
        {
            Manager.ToActionMenu();
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override void Start()
        {
            control = new Game5Control()
            {
                //Height = (double)new LengthConverter().ConvertFromString("10cm"),
                //Width = (double)new LengthConverter().ConvertFromString("15cm")
            };
            TestCurrentView = control;
            control.Results += Control_Results;
            control.Start();
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Psychophysical.Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        public override void Stop()
        {
            if (control != null)
            {
                control.Results -= TestExerciseEnd;
                control.Results -= Control_Results;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Game5\NumberControl.cs


namespace Updk7.Tests.Wpf.Psychophysical.Game5
{
    public class NumberControl:NotifyViewModelBase
    {
        private int _number;
        public int Number
        {
            get { return _number; }
            set
            {
                _number = value;
                OnPropertyChanged();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Game5\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Game5"
                     xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:Game5Control">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Game5Control">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox VerticalAlignment="{TemplateBinding VerticalAlignment}" Height="450" Width="675">
                                        <Border BorderThickness="10" BorderBrush="WhiteSmoke">
                                    <ContentControl Height="800" Width="1200"
                                            Content="{Binding Canva,
                                            RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Game5Control}}}"/>
                                        </Border>
                                    </Viewbox>
                                    <ContentPresenter SnapsToDevicePixels="True"
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:Game5Control}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                    DataContext="{Binding}"
                                                                    Background="{Binding Background}"
                                                                    BorderBrush="{Binding BorderBrush}"
                                                                    BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:Game5ViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Game5ViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:Game5ViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:NumberControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:NumberControl">
                    <ContentControl>
                        <Border Background="#FFC5C5C5" BorderBrush="#FF140F0F" BorderThickness="2">
                            <TextBlock VerticalAlignment="Center"
                                       HorizontalAlignment="Center"
                                       TextAlignment="Center"
                                       FontSize="180"
                                       FontWeight="DemiBold"
                                       Foreground="Black"
                                       Text="{Binding Number, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:NumberControl}}}"/>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Instructions\Instructions.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local1="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Game5">
    <FlowDocument x:Key="accurateEyeInstruction" x:Shared="False">
        <Paragraph>
            Перед Вами на экране на ограниченное время появится фигура в виде 
                                            ломаных линий. Постарайтесь запомнить размеры всех линий, из которых состоит 
                                            фигура. Затем на экране будут предъявлены только начальная точка данной
                                            фигуры (точка зелёного цвета) и конечная точка (точка красного цвета).
        </Paragraph>
        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА</Run> : «нарисовать» предъявленную ранее фигуру по памяти,
                                            стараясь как можно точнее воспроизвести длину всех линий фигуры. Для этого 
                                            коснитесь щупом металлической площадки пульта и удерживайте его в этом
                                            положении. При этом на экране будет «рисоваться» первая линия фигуры. Если
                                            Вы посчитаете, что точно воспроизвели первую линию, прекратите контакт щупа
                                            с металлической площадкой. При прекращении касания линия фиксируется и
                                            изменению не подлежит. При повторном касании щупом металлической площадки
                                            рисуется следующая линия. Повороты линий будут осуществляться
                                            автоматически. Действуя аналогичным образом, воспроизведите все линии
                                            исходной фигуры.
        </Paragraph>
        <Paragraph>
            Вам будет предложено выполнить задание
            <Run FontWeight="Bold" FontSize="22">три раза</Run> .
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="accurateEyeInstruction_m" x:Shared="False">
        <Paragraph>
            «Перед Вами на экране, на ограниченное время, появится ломаная линия, состоящая из цветных отрезков. Возле отдельных маркеров отрезков (слева на экране) отображаются числа «2», «3» или «4». 
            Это означает, что во время воспроизведения ломаной линии, Вам следует УМЕНЬШИТЬ ТАКИЕ ОТРЕЗКИ в 2, 3 или 4 раза.
        </Paragraph>
        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА</Run> : запомнить и, как можно точнее, «нарисовать» по памяти МЫСЛЕННО СФОРМИРОВАННУЮ ЛОМАНУЮ ЛИНИЮ после того, как на экране останется только начальная зелёная точка.
        </Paragraph>
        <Paragraph>
            Для того чтобы «нарисовать» ломаную линию, коснитесь щупом металлическую площадку пульта и удерживайте его в этом положении.
            На экране начнёт «рисоваться» первый отрезок.
            Если Вы посчитаете, что точно воспроизвели необходимую длину первого отрезка, ПРЕКРАТИТЕ КОНТАКТ щупа с площадкой. При этом длина отрезка фиксируется и изменению не подлежит! 
            При повторном касании щупом металлической площадки «рисуется» второй отрезок. Повороты линии осуществляются автоматически. 
            Действуя аналогичным образом, воспроизведите по памяти все отрезки МЫСЛЕННО СФОРМИРОВАННОЙ ЛОМАНОЙ ЛИНИИ.
        </Paragraph>
        <Paragraph>
            Вам будет предложено выполнить задание три раза.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="assesmentMethodOnVolumeAttentionsInstruction" x:Shared="False">
        <Paragraph>
            Вам будет предъявлена 2 раза, с интервалом в несколько секунд, матрица
                                            размером четыре на четыре, в которой будут расположены точки. Вы должны
                                            запомнить расположение точек и после появления пустой матрицы, подведя
                                            курсор «мыши» и нажимая на левую кнопку, отметить те клетки, на которых, по
                                            Вашему мнению, находились точки в показанной ранее матрице.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="assessmentOfPropensityToTakeRisksInstruction" x:Shared="false">
        <Paragraph>
            Перед началом тестирования необходимо перевести рукоятки на пульте в
                                            позицию «0». Если Вы правша, воспользуйтесь для работы правой рукояткой
                                            пульта; если левша – то левой. Перед Вами на экране появятся три круга. В
                                            нижней части внутреннего круга имеется зелёная точка, движением которой Вы
                                            будете управлять.
        </Paragraph>

        <Paragraph>
            Управление осуществляется с помощью рукоятки следующим образом:
                                            
                                             - скорость движения увеличивается при перемещении рукоятки от позиции «0»
                                            к позиции «1» (максимальная скорость достигается в позиции «1»);
                                            
                                             - чтобы остановить зелёную точку, необходимо перевести рукоятку в позицию «0».
        </Paragraph>

        <Paragraph>
            В момент начала движения зелёной точки место старта окрашивается красным цветом.
        </Paragraph>


        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА</Run> заключается в том, чтобы как можно быстрее провести зелёную точку по
                                           кругу и остановиться на месте старта, не переезжая через него! Переход с круга на круг
                                           происходит автоматически после остановки зелёной точки. Всего в основном тестовом
                                           задании Вам предстоит пройти три серии по три круга.
        </Paragraph>

    </FlowDocument>

    <FlowDocument x:Key="attentionDistributionMainInstruction" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">Тест состоит из двух заданий.</Run>
        </Paragraph>

        <Paragraph>
            В первом задании на экране Вы увидите два квадрата, в которых будут
                                            одновременно чередоваться разные геометрические фигуры.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА</Run> : при появлении одинаковых геометрических фигур как можно
                                            быстрее нажимать на
            <Run Foreground="Blue" FontSize="25" FontWeight="Bold">синюю</Run> кнопку пульта. Реагирование на появление
                                            неодинаковых фигур – является ошибкой!
        </Paragraph>

        <Paragraph>
            Во втором задании
            <Run FontWeight="Bold">ВАША ЗАДАЧА</Run> состоит в том, чтобы при появлении одинаковых
                                          геометрических фигур по-прежнему как можно быстрее нажимать на
            <Run Foreground="Blue" FontSize="25" FontWeight="Bold">синюю</Run>
            кнопку пульта, а если Вы услышите одинаковые цифры в паре - нажимать на
            <Run Foreground="White" FontSize="25" FontWeight="Bold">белую</Run> кнопку. 
                                          Неверный выбор кнопки при нажатии считается ошибкой. Будьте внимательны.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="attentionDistributionInstruction1" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 1</Run>
        </Paragraph>
        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> при появлении одинаковых геометрических фигур как можно
                                            быстрее нажимать на
            <Run Foreground="Blue" FontWeight="Bold">синюю</Run> кнопку пульта. Реагирование на появление
                                            неодинаковых фигур – является ошибкой!
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="attentionDistributionInstruction2" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 2</Run>
        </Paragraph>
        <Paragraph>
            Теперь
            <Run FontWeight="Bold">ВАША ЗАДАЧА</Run> состоит в том, чтобы при появлении одинаковых
                                          геометрических фигур по-прежнему как можно быстрее нажимать на
            <Run Foreground="Blue" FontWeight="Bold">синюю</Run>
            кнопку пульта, а если Вы услышите одинаковые цифры в паре - нажимать на
            <Run Foreground="White" FontWeight="Bold">белую</Run> кнопку. 
                                          Неверный выбор кнопки при нажатии считается ошибкой. Будьте внимательны.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="complexMotorReactionInstruction" x:Shared="False">
        <Paragraph>
            Во время теста перед Вами на экране будут загораться в случайном
                                            порядке красные и зелёные сигналы.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> как можно быстрее нажимать на
            <Run Foreground="Red" FontWeight="Bold">красную</Run> кнопку пульта при
                                            появлении красного сигнала и на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку – при появлении зелёного
                                            сигнала.
        </Paragraph>

        <Paragraph>
            На жёлтые сигналы реагировать не надо - они равносильны команде «Внимание!».
        </Paragraph>

        <Paragraph>
            Неверный выбор кнопки при нажатии считается ошибкой. Будьте внимательны.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="complexMotorReaction_M_MainInstruction" x:Shared="False">
        <Paragraph>
            Тест состоит из двух заданий.
        </Paragraph>

        <Paragraph>
            В первом задании перед Вами на экране будут загораться жёлтые и красные
                                          сигналы. На жёлтые сигналы реагировать не надо - они означают «Внимание».
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> как можно быстрее нажимать на
            <Run Foreground="Red" FontWeight="Bold">красную</Run> кнопку пульта при
                                           появлении красного сигнала.
        </Paragraph>

        <Paragraph>
            Во втором задании перед Вами на экране будут загораться жёлтые, красные и
                                          зелёные сигналы. На жёлтые сигналы реагировать не надо - они означают «Внимание».
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> как можно быстрее нажимать на
            <Run Foreground="Red" FontWeight="Bold">красную</Run> кнопку пульта при
                                          появлении красного сигнала, и на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку – при появлении зелёного сигнала.
        </Paragraph>

        <Paragraph>
            Неверный выбор кнопки при нажатии считается ошибкой. Будьте внимательны.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="complexMotorReaction_M_instruction1" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 1</Run>
        </Paragraph>
        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> как можно быстрее нажимать на
            <Run Foreground="Red" FontWeight="Bold">красную</Run> кнопку пульта при появлении красного сигнала.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="complexMotorReaction_M_instruction2" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 2</Run>
        </Paragraph>
        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> как можно быстрее нажимать на
            <Run Foreground="Red">красную</Run> кнопку пульта при
                                          появлении красного сигнала, и на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку – при появлении зелёного сигнала.
                                          Неверный выбор кнопки при нажатии считается ошибкой. Будьте внимательны.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="concentrationAttention_instruction" x:Shared="False">
        <Paragraph>
            Перед Вами на экране появятся строки из колец с разрывами,
                                          направленными в различные стороны. Вы должны просмотреть верхнюю строку и
                                          отыскать кольца с разрывами, направленными в ту же сторону, что и у первого
                                          кольца в строке. Сосчитайте количество таких колец во всей строке, включая
                                          первое».
        </Paragraph>

        <Paragraph>
            Выберите соответствующую цифру в столбце справа с помощью
            <Run FontWeight="Bold" FontSize="25" Foreground="Black">чёрной</Run>
            кнопки (движение вниз) или
            <Run FontWeight="Bold" FontSize="25" Foreground="Orange">жёлтой</Run> кнопки (движение вверх), после чего нажмите
                                          на
            <Run FontWeight="Bold" FontSize="25" Foreground="Red">красную</Run> кнопку пульта. При  этом строки поднимутся на одну вверх. Далее
                                          выполняйте ту же самую процедуру с новой верхней строкой. Время на
                                          выполнение теста ограничено. Работайте внимательно и быстро.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="correctiveTestSample_instruction" x:Shared="False">
        <Paragraph>
            Сейчас на экране вверху появится таблица строк, состоящих из букв. Справа
                                          от них находится столбец из чисел от 1 до 9.
        </Paragraph>

        <Paragraph>
            Вы должны просмотреть верхнюю строку из букв, отыскивая такие же буквы,
                                          как и первая буква в этой строке. Нужно сосчитать количество таких букв во всей
                                          строке, начиная с первой.
        </Paragraph>

        <Paragraph>
            Выбор соответствующую количеству букв цифру в столбце справа следует
                                          делать нажатием на левую кнопку мыши после наведения курсора на эту цифру.
        </Paragraph>

        <Paragraph>
            При этом строки поднимутся на одну вверх. Далее выполняйте ту же самую
                                          процедуру с новой верхней строкой. Время на выполнение теста ограничено.
                                          Работайте внимательно и быстро.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="emotionalStability_instruction" x:Shared="False">
        <Paragraph>
            Перед Вами на экране будут быстро сменять друг друга цифры. Иногда
                                          непрерывный ряд цифр будет прерываться красным фоном. После него
                                          предъявляется цифра и снова следует красный фон.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> заметить эту цифру и как можно быстрее нажать на одну из двух
                                          кнопок, в зависимости от того, какая цифра предъявлена - чётная или нечётная.
                                          Если цифра чётная - нажмите
            <Run Foreground="Blue" FontSize="25" FontWeight="Bold">синюю</Run> кнопку пульта, если цифра нечётная -
                                          нажмите
            <Run Foreground="White" FontSize="25" FontWeight="Bold">белую</Run> кнопку. Неверный выбор кнопки при нажатии считается
                                          ошибкой.
        </Paragraph>

        <Paragraph>
            Во время выполнения теста на определённом этапе будет транслироваться
                                          звуковая информация: одна часть этой информации мешающего характера,
                                          другая - оценивающего характера.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="estimationOfStabilityOfAttention_instruction" x:Shared="False">
        <Paragraph>
            Перед Вами в центре экрана появится квадрат, в котором в случайном
                                          порядке будут появляться цифры от 1 до 9.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА</Run> : как можно быстрее нажимать на соответствующие кнопки
                                          при появлении цифр.
            <LineBreak/> Действуйте следующим образом: если цифра чётная -
                                          нажмите на
            <Run FontWeight="Bold" FontSize="25" Foreground="Blue">синюю</Run> кнопку пульта, если нечётная - нажмите на
            <Run FontWeight="Bold" FontSize="25" Foreground="White">белую</Run> кнопку
                                          пульта. Нажатие не на ту кнопку считается ошибкой.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="estimationOfStabilityToMonotonistance_instruction" x:Shared="False">
        <Paragraph>
            Перед Вами на экране монитора будет перемещаться по кругу, по
                                          фиксированным позициям, зелёное световое пятно. Оно будет двигаться,
                                          последовательно перемещаясь на одну позицию. Иногда зелёное пятно будет
                                          совершать перескок через одну позицию.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА</Run> - внимательно следить за движением зелёного пятна. Если Вы
                                          заметите перескок пятна вперед через одну позицию, то как можно быстрее
                                          нажмите на
            <Run Foreground="Green" FontSize="25" FontWeight="Bold">зелёную</Run> кнопку пульта. Работайте внимательно и быстро.
        </Paragraph>
    </FlowDocument>


    <FlowDocument x:Key="expressSampleVigilance_instruction" x:Shared="False">
        <Paragraph>
            «На экране монитора будет перемещаться по кругу, по фиксированным
                                          позициям, зелёное световое пятно. Оно будет двигаться, последовательно
                                          перемещаясь на одну позицию по часовой стрелке. Иногда зелёное пятно будет
                                          совершать перескок через одну позицию.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> внимательно следить за движением зелёного пятна. Если Вы
                                          заметите перескок пятна вперед через одну позицию, то, как можно быстрее,
                                          нажмите на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Периодически в центре круга будет зажигаться жёлтый предупредительный
                                          сигнал. Это означает, что спустя некоторое время обязательно последует перескок
                                          зелёного пятна, на который следует реагировать аналогичным образом: как можно
                                          быстрее нажать на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта. Реагировать на предупредительный
                                          жёлтый сигнал не надо.
        </Paragraph>

        <Paragraph>
            Работайте внимательно. Продолжительность обследования – 4 минуты.»
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="feelingTime_instruction" x:Shared="False">
        <Paragraph>
            Сейчас на пульте будет трижды загораться и гаснуть через одно и то же время
                                          красный светодиод (запомните этот эталонный интервал времени горения
                                          красного светодиода). Затем красный светодиод будет загораться, но не гаснуть.
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> погасить его нажатием на
            <Run Foreground="Red" FontWeight="Bold">красную</Run> кнопку пульта в тот момент,
                                          когда, по Вашему мнению, интервал времени горения красного светодиода
                                          совпадает с эталонным.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="game5_instruction" x:Shared="False">
        <Paragraph>
            Сейчас на экране появится прямоугольник, в котором будут находиться
                                          цифры от 1 до 5 в случайном порядке. Вы должны с помощью мыши выстроить
                                          эти цифры, как показано на образце. Перемещение цифры на пустое поле,
                                          находящееся радом с ней, происходит при нажатии на нее мышью. Старайтесь
                                          сделать это за минимальное количество перемещений цифр. Прежде чем
                                          приступить к выполнению теста, пожалуйста, запомните расположение цифр на
                                          образце.
        </Paragraph>
        <BlockUIContainer TextAlignment="Center">
            <local1:Game5Control VerticalAlignment="Top" IsEtalon="True" FontSize="40" Height="15cm" Width="22.5cm"/>
        </BlockUIContainer>
    </FlowDocument>

    <FlowDocument x:Key="levelOfPerceptionOfSpeedAndDistance_instruction" x:Shared="False">
        <Paragraph>
            Перед Вами на экране будут появляться две точки: жёлтая и зелёная.
        </Paragraph>

        <Paragraph>
            Жёлтая точка - неподвижная, зелёная точка - подвижная. Зелёная точка будет
                                          быстро двигаться по окружности к жёлтой точке».
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> точно совместить движущуюся зелёную точку с неподвижной жёлтой точкой. 
                                          Для этого своевременно нажмите на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>
    </FlowDocument>


    <FlowDocument x:Key="methodCriticalFrequencyLightFlares_instruction" x:Shared="False">
        <Paragraph>
            Сейчас на пульте, расположенном перед Вами, будет мелькать красный
                                          светодиод. Вы должны следить за его мельканием.
        </Paragraph>
        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА</Run> как можно
                                          быстрее нажать и ОТПУСТИТЬ чёрную кнопку пульта в тот момент, когда, по
                                          Вашему мнению, мелькание светодиода сольется в одно непрерывное свечение. 
                                          Как только Вы нажмете на
            <Run Foreground="Black" FontWeight="Bold">чёрную</Run> кнопку пульта, светодиод погаснет.
        </Paragraph>

        <Paragraph>
            Через 5 секунд светодиод автоматически загорится снова и будет мелькать
                                          очень часто, так что Вы не будете различать эти мелькания. Постепенно частота
                                          мельканий будет снижаться, и в тот момент, когда, по Вашему мнению,
                                          мелькания появятся, Вы также должны как можно быстрее нажать и ОТПУСТИТЬ
            <Run Foreground="Black" FontWeight="Bold">чёрную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Этот цикл из двух испытаний (для нарастающей и для убывающей частоты мельканий) 
                                          будет повторяться автоматически 3 раза.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="reactionToAMovingObject_instruction" x:Shared="False">
        <Paragraph>
            Сейчас перед Вами на экране будет изображён круг. В верхней части круга
                                          постоянно будет гореть зелёная точка. По кругу будет быстро передвигаться
                                          другая зелёная точка.
        </Paragraph>
        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА</Run> , нажатием на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта,
                                          остановить движущуюся точку в тот момент, когда она совместится с постоянно
                                          горящей зелёной точкой.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="readinessAssessmentTesting_instruction" x:Shared="False">
        <Paragraph>
            Перед Вами на экране будет перемещаться по кругу цветовое пятно. Оно
                                          будет окрашиваться красным, зелёным и жёлтым цветом.
        </Paragraph>

        <Paragraph>
            Смена цвета пятна происходит последовательно через одинаковые
                                          интервалы времени. Иногда время свечения цветового пятна увеличивается. Это
                                          может быть любой из цветов.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА</Run> заметить удлинённые сигналы и нажать как можно быстрее
                                          на пульте кнопку соответствующего цвета. Неверный выбор кнопки при нажатии
                                          считается ошибкой.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="readinessForEmergencyAction_instruction" x:Shared="False">
        <Paragraph>
            На экране монитора будет перемещаться по кругу, по фиксированным позициям, зелёное световое пятно.
                                          Оно будет двигаться, последовательно перемещаясь на одну позицию по часовой стрелке. 
                                          Иногда зелёное пятно будет совершать перескок через одну позицию.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> внимательно следить за движением зелёного пятна. Если Вы
                                          заметите перескок пятна вперед через одну позицию, то, как можно быстрее,
                                          нажмите на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Периодически в центре круга будет зажигаться жёлтый предупредительный
                                          сигнал. Это означает, что спустя некоторое время обязательно последует перескок
                                          зелёного пятна, на который следует реагировать аналогичным образом: как можно
                                          быстрее нажать
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта. Реагировать на предупредительный
                                          жёлтый сигнал не надо.
        </Paragraph>

        <Paragraph>
            Работайте внимательно. Продолжительность обследования – 1 час.
        </Paragraph>
    </FlowDocument>


    <FlowDocument x:Key="readinessForEmergencyAction_2_instruction" x:Shared="False">
        <Paragraph>
            Перед началом тестирования наденьте датчик-перстень на ту руку, 
                                        которой Вы не будете пользоваться для нажатия на кнопку манипулятора (для правши – на левую руку). 
                                        Датчик не снимайте до полного завершения теста!
        </Paragraph>

        <Paragraph>
            На экране монитора будет перемещаться по кругу, по фиксированным позициям, зелёное световое пятно. 
                                        Оно будет двигаться, последовательно перемещаясь на одну позицию по часовой стрелке. 
                                        Иногда зелёное пятно будет совершать перескок через одну позицию.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> внимательно следить за движением зелёного пятна. 
                                        Если Вы заметите перескок пятна вперед через одну позицию, то, как можно быстрее, 
                                        нажмите на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Периодически в центре круга будет зажигаться жёлтый предупредительный сигнал.
                                        Это означает, что спустя некоторое время обязательно последует перескок зелёного пятна,
                                        на который следует реагировать аналогичным образом: как можно быстрее нажать на зелёную кнопку пульта.
                                        Реагировать на предупредительный жёлтый сигнал не надо.
                                        Работайте внимательно. Продолжительность обследования – 2 часа.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="simpleMotorableReaction_instruction" x:Shared="False">
        <Paragraph>
            Сейчас в центре экрана будут загораться жёлтый и красный сигналы.
                                          На жёлтый сигнал реагировать не надо, он означает «внимание»,
                                          на красный сигнал реагировать необходимо как можно быстрее нажатием на
            <Run Foreground="Red" FontWeight="Bold">красную</Run>
            кнопку пульта.
        </Paragraph>
    </FlowDocument>


    <FlowDocument x:Key="speedAlterationSkills_instruction" x:Shared="False">
        <Paragraph>
            Перед Вами в центре экрана появятся два квадрата. Они оба будут загораться зелёным цветом (сигнал).
                                          Вы должны в ответ на это как можно быстрее реагировать нажатием на определённую кнопку пульта.
                                          Начинать реагировать на сигнал необходимо с
            <Run Foreground="Green" FontWeight="Bold">зелёной</Run> кнопки. 
                                          Смена кнопок реагирования происходит после того, как один из квадратов загорится красным цветом, 
                                          нажимать ни на какие кнопки при этом нельзя.
                                          Загорание одного из квадратов красным цветом означает только смену кнопок реагирования на сигнал. 
                                          Вы должны будете нажимать не на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта, а на
            <Run Foreground="Red" FontWeight="Bold">красную</Run> . 
                                            Далее, соответственно, наоборот. 
                                          При каждом загорании одного из квадратов красным цветом меняется кнопка реагирования 
                                          (последовательность: зелёная – красная – зелёная – красная и т.д.).
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="staticTremor_instruction" x:Shared="False">
        <Paragraph>
            Возьмите удобной для Вас рукой щуп так, чтобы пальцы располагались выше выступа держателя.
                                          Медленно опустите щуп вертикально в отверстие пульта до загорания красного светодиода 
                                          и удерживайте его В ЦЕНТРЕ ОТВЕРСТИЯ (касаться рукой пульта, ставить локоть на стол - запрещается!).
                                          Удерживайте щуп в таком положении до тех пор, пока не погаснет красный светодиод.
        </Paragraph>
    </FlowDocument>


    <FlowDocument x:Key="stressEvaluationM_MainInstruction" x:Shared="False">
        <Paragraph>
            Задание 1.
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться зелёным цветом. 
                                        Вы должны как можно быстрее реагировать на зелёный сигнал путём нажатия на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Задание 2.
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться красным цветом. 
                                        Вы должны как можно быстрее реагировать на красный сигнал путём нажатия на
            <Run Foreground="Red" FontWeight="Bold">красную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Задание 3.
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться либо зелёным, либо красным цветом. 
                                        Вы должны как можно быстрее реагировать на зелёный сигнал путём нажатия на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта. 
                                        Реагировать на появление красного сигнала не следует: реакция на красный сигнал зелёной или красной кнопкой пульта считается ошибкой.
        </Paragraph>

        <Paragraph>
            Задание 4.
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться зелёным цветом. 
                                        Вы должны как можно быстрее реагировать на зелёный сигнал путём нажатия на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Средняя скорость Вашей реакции будет автоматически соотноситься прибором с нормативом,
                                        определяющим степень профессиональной пригодности. 
                                        Если скорость Вашей реакции на отдельные сигналы будет замедляться до недопустимого уровня,
                                        круг в центре экрана будет загораться красным цветом. 
                                        В этом случае красный сигнал показывает, 
                                        что Вы среагировали на зелёный сигнал медленнее, чем нужно. 
                                        Красный сигнал является неудовлетворительной оценкой Вашей реакции в данный момент.
        </Paragraph>

        <Paragraph>
            На красный сигнал не реагируйте вообще. 
                                        Реакция на красный сигнал зелёной или красной кнопкой пульта считается ошибкой.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="stressEvaluationM_instruction1" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 1</Run>
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться зелёным цветом. 
                                        Вы должны как можно быстрее реагировать на зелёный сигнал путём нажатия на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="stressEvaluationM_instruction2" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 2</Run>
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться красным цветом. 
                                        Вы должны как можно быстрее реагировать на красный сигнал путём нажатия на
            <Run Foreground="Red" FontWeight="Bold">красную</Run> кнопку пульта.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="stressEvaluationM_instruction3" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 3</Run>
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться либо зелёным, либо красным цветом. 
                                        Вы должны как можно быстрее реагировать на зелёный сигнал путём нажатия на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта. 
                                        Реагировать на появление красного сигнала не следует: реакция на красный сигнал зелёной или красной кнопкой пульта считается ошибкой.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="stressEvaluationM_instruction4" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 4</Run>
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться зелёным цветом. 
                                        Вы должны как можно быстрее реагировать на зелёный сигнал путём нажатия на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Средняя скорость Вашей реакции будет автоматически соотноситься прибором с нормативом,
                                        определяющим степень профессиональной пригодности. 
                                        Если скорость Вашей реакции на отдельные сигналы будет замедляться до недопустимого уровня,
                                        круг в центре экрана будет загораться красным цветом. 
                                        В этом случае красный сигнал показывает, 
                                        что Вы среагировали на зелёный сигнал медленнее, чем нужно. 
                                        Красный сигнал является неудовлетворительной оценкой Вашей реакции в данный момент.
        </Paragraph>

        <Paragraph>
            На красный сигнал не реагируйте вообще. 
                                        Реакция на красный сигнал зелёной или красной кнопкой пульта считается ошибкой.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="stressEvaluationSTR_MainInstruction" x:Shared="False">
        <Paragraph>
            Задание 1.
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться зелёным цветом. 
                                        Вы должны как можно быстрее реагировать на зелёный сигнал путём нажатия на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Задание 2.
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться красным цветом. 
                                        Вы должны как можно быстрее реагировать на красный сигнал путём нажатия на
            <Run Foreground="Red" FontWeight="Bold">красную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Задание 3.
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться либо зелёным, либо красным цветом. 
                                        Вы должны как можно быстрее реагировать на зелёный сигнал путём нажатия на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта. 
                                        Реагировать на появление красного сигнала не следует: реакция на красный сигнал зелёной или красной кнопкой пульта считается ошибкой.
        </Paragraph>

        <Paragraph>
            Задание 4.
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться зелёным цветом. 
                                        Вы должны как можно быстрее реагировать на зелёный сигнал путём нажатия на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Средняя скорость Вашей реакции будет автоматически соотноситься прибором с нормативом,
                                        определяющим степень профессиональной пригодности. 
                                        Если скорость Вашей реакции на отдельные сигналы будет замедляться до недопустимого уровня,
                                        круг в центре экрана будет загораться красным цветом. 
                                        В этом случае красный сигнал показывает, 
                                        что Вы среагировали на зелёный сигнал медленнее, чем нужно.
        </Paragraph>

        <Paragraph>
            Красный сигнал является неудовлетворительной оценкой Вашей реакции в данный момент.
                                      На красный сигнал не реагируйте вообще.
        </Paragraph>

        <Paragraph>
            Реакция на красный сигнал зелёной или красной кнопкой пульта считается ошибкой.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="stressEvaluationSTR_instruction1" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 1</Run>
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться зелёным цветом. 
                                        Вы должны как можно быстрее реагировать на зелёный сигнал путём нажатия на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="stressEvaluationSTR_instruction2" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 2</Run>
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться красным цветом. 
                                        Вы должны как можно быстрее реагировать на красный сигнал путём нажатия на
            <Run Foreground="Red" FontWeight="Bold">красную</Run> кнопку пульта.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="stressEvaluationSTR_instruction3" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 3</Run>
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться либо зелёным, либо красным цветом. 
                                        Вы должны как можно быстрее реагировать на зелёный сигнал путём нажатия на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта. 
                                        Реагировать на появление красного сигнала не следует: реакция на красный сигнал зелёной или красной кнопкой пульта считается ошибкой.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="stressEvaluationSTR_instruction4" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 4</Run>
        </Paragraph>

        <Paragraph>
            Сейчас в центре экрана появится круг. Круг будет загораться зелёным цветом. 
                                        Вы должны как можно быстрее реагировать на зелёный сигнал путём нажатия на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Средняя скорость Вашей реакции будет автоматически соотноситься прибором с нормативом,
                                        определяющим степень профессиональной пригодности. 
                                        Если скорость Вашей реакции на отдельные сигналы будет замедляться до недопустимого уровня,
                                        круг в центре экрана будет загораться красным цветом. 
                                        В этом случае красный сигнал показывает, 
                                        что Вы среагировали на зелёный сигнал медленнее, чем нужно.
        </Paragraph>

        <Paragraph>
            Красный сигнал является неудовлетворительной оценкой Вашей реакции в данный момент.
                                      На красный сигнал не реагируйте вообще.
        </Paragraph>

        <Paragraph>
            Реакция на красный сигнал зелёной или красной кнопкой пульта считается ошибкой.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="switchAttention_MainInstruction" x:Shared="False">
        <Paragraph>
            Задание 1.
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (подряд все числа от 1 до 24). 
                                        Вы должны отыскивать и регистрировать все чёрные числа подряд от 1 до 25 в возрастающем порядке.
                                        Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число,
                                        и нажмите левую кнопку (указатель «мыши» должен находиться в пределах квадрата!).
        </Paragraph>

        <Paragraph>
            Задание 2.
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (подряд все числа от 1 до 24).
                                        Вы должны отыскивать и регистрировать все красные числа от 24 до 1 в убывающем порядке. 
                                        Для регистрации выбранного числа наведите указатель «мыши» на квадрат, в котором изображено нужное число, 
                                        и нажмите левую кнопку (указатель «мыши»  должен находиться в пределах квадрата!).
        </Paragraph>

        <Paragraph>
            Задание 3.
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (подряд все числа от 1 до 24). 
                                        Вы должны отыскивать и регистрировать попеременно чёрные и красные числа в следующем порядке: 1-чёрное, 24-красное; 2-чёрное, 23-красное; 3-чёрное, 22-красное и т.д.
                                        до 25-чёрное включительно.
                                      Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число, и нажмите левую кнопку
                                        (указатель «мыши»  должен находиться в пределах квадрата!).
        </Paragraph>

        <Paragraph>
            Задание 4. (помехоустойчивость)
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (подряд все числа от 1 до 24). 
                                        Вы должны отыскивать и регистрировать попеременно чёрные и красные числа в следующем порядке: 1-чёрное, 24-красное; 2-чёрное, 23-красное; 3-чёрное, 22-красное и т.д.
                                        до 25-чёрное включительно. Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число, 
                                        и нажмите левую кнопку (указатель «мыши» должен находиться в пределах квадрата!).
                                      Выполнение теста будет сопровождаться сбивающими звуковыми помехами.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> не отвлекаться на помехи, не останавливаться, 
                                        продолжать работу и довести задание до конца.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="switchAttention_instruction1" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 1</Run>
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (подряд все числа от 1 до 24). 
                                        Вы должны отыскивать и регистрировать все чёрные числа подряд от 1 до 25 в возрастающем порядке.
                                        Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число,
                                        и нажмите левую кнопку (указатель «мыши» должен находиться в пределах квадрата!).
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="switchAttention_instruction2" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 2</Run>
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (подряд все числа от 1 до 24).
                                        Вы должны отыскивать и регистрировать все красные числа от 24 до 1 в убывающем порядке. 
                                        Для регистрации выбранного числа наведите указатель «мыши» на квадрат, в котором изображено нужное число, 
                                        и нажмите левую кнопку (указатель «мыши»  должен находиться в пределах квадрата!).
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="switchAttention_instruction3" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 3</Run>
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (подряд все числа от 1 до 24). 
                                        Вы должны отыскивать и регистрировать попеременно чёрные и красные числа в следующем порядке: 1-чёрное, 24-красное; 2-чёрное, 23-красное; 3-чёрное, 22-красное и т.д.
                                        до 25-чёрное включительно.
                                      Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число, и нажмите левую кнопку
                                        (указатель «мыши»  должен находиться в пределах квадрата!).
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="switchAttention_instruction4" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 4 (помехоустойчивость)</Run>
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (подряд все числа от 1 до 24). 
                                        Вы должны отыскивать и регистрировать попеременно чёрные и красные числа в следующем порядке: 1-чёрное, 24-красное; 2-чёрное, 23-красное; 3-чёрное, 22-красное и т.д.
                                        до 25-чёрное включительно. Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число, 
                                        и нажмите левую кнопку (указатель «мыши» должен находиться в пределах квадрата!).
                                      Выполнение теста будет сопровождаться сбивающими звуковыми помехами.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> не отвлекаться на помехи, не останавливаться, 
                                        продолжать работу и довести задание до конца.
        </Paragraph>
    </FlowDocument>


    <FlowDocument x:Key="switchAttention2_MainInstruction" x:Shared="False">
        <Paragraph>
            Задание 1.
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (только чётные числа от 2 до 48).
                                      Вы должны отыскивать и регистрировать все чёрные числа подряд от 1 до 25 в возрастающем порядке.
                                      Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число, и нажмите левую кнопку (указатель «мыши» должен находиться в пределах квадрата!).
        </Paragraph>

        <Paragraph>
            Задание 2.
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (только чётные числа от 2 до 48).
                                      Вы должны отыскивать и регистрировать все красные числа от 48 до 2 в убывающем порядке.
                                      Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число, и нажмите левую кнопку (указатель «мыши» должен находиться в пределах квадрата!).
        </Paragraph>

        <Paragraph>
            Задание 3.
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (только чётные числа от 2 до 48).
                                      Вы должны отыскивать и регистрировать попеременно чёрные и красные числа в следующем порядке: 1-чёрное, 48-красное; 2-чёрное, 46-красное; 3-чёрное, 44-красное и т.д. до 25-чёрное включительно.
                                      Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число, и нажмите левую кнопку (указатель «мыши» должен находиться в пределах квадрата!).
        </Paragraph>

        <Paragraph>
            Задание 4. (помехоустойчивость)
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (только чётные числа от 2 до 48).
                                      Вы должны отыскивать и регистрировать попеременно чёрные и красные числа в следующем порядке: 1-чёрное, 48-красное; 2-чёрное, 46-красное; 3-чёрное, 44-красное и т.д. до 25-чёрное включительно.
                                      Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число, и нажмите левую кнопку (указатель «мыши» должен находиться в пределах квадрата!).
                                      Выполнение теста будет сопровождаться сбивающими звуковыми помехами.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> не отвлекаться на помехи, не останавливаться, продолжать работу и довести задание до конца.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="switchAttention2_instruction1" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 1</Run>
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (только чётные числа от 2 до 48).
                                      Вы должны отыскивать и регистрировать все чёрные числа подряд от 1 до 25 в возрастающем порядке.
                                      Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число, и нажмите левую кнопку (указатель «мыши» должен находиться в пределах квадрата!).
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="switchAttention2_instruction2" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 2</Run>
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (только чётные числа от 2 до 48).
                                      Вы должны отыскивать и регистрировать все красные числа от 48 до 2 в убывающем порядке.
                                      Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число, и нажмите левую кнопку (указатель «мыши» должен находиться в пределах квадрата!).
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="switchAttention2_instruction3" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 3</Run>
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (только чётные числа от 2 до 48).
                                      Вы должны отыскивать и регистрировать попеременно чёрные и красные числа в следующем порядке: 1-чёрное, 48-красное; 2-чёрное, 46-красное; 3-чёрное, 44-красное и т.д. до 25-чёрное включительно.
                                      Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число, и нажмите левую кнопку (указатель «мыши» должен находиться в пределах квадрата!).
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="switchAttention2_instruction4" x:Shared="False">
        <Paragraph>
            <Run FontWeight="Bold">ЗАДАНИЕ 4 (помехоустойчивость)</Run>
        </Paragraph>

        <Paragraph>
            Сейчас на экране будет предъявлена таблица с числами: 25 чёрных (подряд все числа от 1 до 25) и 24 красных (только чётные числа от 2 до 48).
                                      Вы должны отыскивать и регистрировать попеременно чёрные и красные числа в следующем порядке: 1-чёрное, 48-красное; 2-чёрное, 46-красное; 3-чёрное, 44-красное и т.д. до 25-чёрное включительно.
                                      Для регистрации выбранного числа наведите указатель «мыши»  на квадрат, в котором изображено нужное число, и нажмите левую кнопку (указатель «мыши» должен находиться в пределах квадрата!).
                                      Выполнение теста будет сопровождаться сбивающими звуковыми помехами. Ваша задача - не отвлекаться на помехи, не останавливаться, продолжать работу и довести задание до конца.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="tepping310_instruction" x:Shared="False">
        <Paragraph>
            Возьмите щуп в удобную для Вас руку и держите его вертикально.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> после загорания красного светодиода на пульте как можно чаще стучать щупом по металлической пластине пульта, 
                                    пока красный светодиод не погаснет. После небольшого перерыва светодиод снова загорится и следует, как можно чаще, 
                                    стучать по металлической площадке до момента погашения светодиода. Всего таких циклов будет 6.
        </Paragraph>
        <Paragraph>
            Будьте внимательны, следите за включением и выключением красного светодиода на пульте.
        </Paragraph>
    </FlowDocument>


    <FlowDocument x:Key="teppingTest_instruction" x:Shared="False">
        <Paragraph>
            Возьмите щуп в удобную для Вас руку.
        </Paragraph>
        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> после загорания красного светодиода на пульте
                                     как можно чаще стучать щупом по металлической пластине пульта, пока красный светодиод не погаснет.
        </Paragraph>
        <Paragraph>
            Будьте внимательны, следите за включением и выключением красного светодиода на пульте.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="testForMotorableCoherence_instruction" x:Shared="False">
        <Paragraph>
            Перед началом тестирования необходимо отклонить рукоятки на пульте в позицию «0».
        </Paragraph>

        <Paragraph>
            Сейчас Вы увидите экран, поделённый на две части, в которых будут отображаться Ваши действия, 
                                    соответственно, левой и правой рукой. Внизу экрана в двух частях будут гореть зелёные квадраты. 
                                    В этих двух частях будут появляться красные квадраты. Каждый раз при появлении красных квадратов Вы должны,
                                    действуя одновременно двумя рукоятками, быстро наводить зелёные квадраты на красные квадраты. 
                                    Когда зелёные квадраты будут одновременно наведены на красные, удержите их в таком положении 2 секунды. 
                                    Затем красные квадраты появятся в других местах, Вы должны выполнить те же действия.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="tremor3_instruction" x:Shared="False">
        <Paragraph>
            Сядьте прямо, возьмите щуп в правую руку (если Вы левша – в левую) и опустите металлический наконечник щупа вертикально в
                                    самое большое отверстие (№1) на круглой площадке пульта.
        </Paragraph>

        <Paragraph>
            Рука при этом должна оставаться на весу, нельзя опираться локтем на стол или придерживать руку другой рукой.
                                    После загорания красного светодиода на пульте старайтесь удерживать щуп в центре отверстия, не касаться стенок до тех пор,
                                    пока красный светодиод не погаснет. Далее у Вас есть три секунды, чтобы переместить наконечник щупа в среднее отверстие (№2),
                                    после чего красный светодиод вновь зажжётся и Вам вновь следует удерживать щуп в центре отверстия.
                                    Затем у Вас будет ещё три секунды, чтобы переместить щуп в самое маленькое отверстие (№3) и вновь выполнить указанные действия.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="vigilanceAssessment_instruction" x:Shared="False">
        <Paragraph>
            Перед Вами на экране монитора будет перемещаться по кругу, по фиксированным позициям, зелёное световое пятно.
        </Paragraph>

        <Paragraph>
            Оно будет двигаться, последовательно перемещаясь на одну позицию.
                                        Иногда зелёное пятно будет совершать перескок через одну позицию.
        </Paragraph>

        <Paragraph>
            <Run FontWeight="Bold">ВАША ЗАДАЧА:</Run> внимательно следить за движением зелёного пятна. 
                                        Если Вы заметите перескок пятна вперед через одну позицию, 
                                        то как можно быстрее нажмите на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку пульта.
        </Paragraph>

        <Paragraph>
            Периодически в центре круга будет зажигаться жёлтый сигнал. 
                                        Это предупредительный сигнал. Он извещает Вас о том, что спустя некоторое время обязательно последует перескок
                                        зелёного пятна, на который нужно как можно быстрее реагировать нажатием на
            <Run Foreground="Green" FontWeight="Bold">зелёную</Run> кнопку.
                                        Реагировать на жёлтый сигнал не надо.
        </Paragraph>

        <Paragraph>
            Иногда в центре круга будет зажигаться красный сигнал.
            В ответ на него следует как можно быстрее нажать на
            <Run Foreground="Red" FontWeight="Bold">красную</Run> кнопку пульта. 
            Нажатие на несоответствующую инструкции кнопку считается ошибкой.
        </Paragraph>

        <Paragraph>
            Работайте внимательно и быстро.
        </Paragraph>
    </FlowDocument>

    <FlowDocument x:Key="testForMotorableCoherence_m_instruction" x:Shared="False">
        <Paragraph>
            Перед началом тестирования необходимо отклонить рукоятки на пульте в позицию «0».
        </Paragraph>

        <Paragraph>
            Вы увидите экран, поделённый на две части, в которых будут отображаться Ваши действия, 
            соответственно, левой и правой рукой.
            Внизу экрана в обоих частях появятся зелёные квадраты.
            Вверху экрана, в обоих частях, будут появляться красные квадраты.
        </Paragraph>

        <Paragraph>
            ВАША ЗАДАЧА: при появлении красных квадратов, ДЕЙСТВУЯ ОДНОВРЕМЕННО ДВУМЯ РУКАМИ, 
            быстро наводите зелёные квадраты на красные квадраты. 
            После наведения зелёных квадратов  на красные, удержите их в таком положении 1-2 секунды.
            После этого квадраты появятся в других местах обоих частей экрана.
            Продолжайте выполнять те же действия до момента автоматического завершения теста.
        </Paragraph>

        <Paragraph>
            Иногда в центре экрана будет загораться зеленый или красный сигнал,
            на который, как можно быстрее,
            реагируйте нажатием на кнопку пульта соответствующего цвета.
            Неверный выбор кнопки оценивается как ошибка!
        </Paragraph>

    </FlowDocument>

</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\ContinueView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.ContinueView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension"
             xmlns:controls="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="200" d:DesignWidth="300">
    <UserControl.Resources>
        <Storyboard x:Key="motionBlur" x:Shared="false">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="border">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.75"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <ElasticEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="border">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.75"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <ElasticEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border1">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderBlurred">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Effect).(BlurEffect.Radius)" Storyboard.TargetName="borderBlurred">
                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="5"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="10"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <Style x:Key="FocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <SolidColorBrush x:Key="strokeRectangle" Color="#FFA5BADB"/>
        <SolidColorBrush x:Key="Button.Static.Background" Color="#00000000"/>
        <SolidColorBrush x:Key="Button.Default.Text.Foreground" Color="White"/>
        <SolidColorBrush x:Key="Button.MouseOver.Text.Foreground" Color="#FFFFAE00"/>
        <SolidColorBrush x:Key="Button.Pressed.Text.Foreground" Color="#FF35D2E2"/>
        <Style x:Key="SubmenuButtonStyle" TargetType="{x:Type controls:SubMenuButton}">
            <Style.Resources>
                <Style TargetType="Rectangle">
                    <Setter Property="Height" Value="20"/>
                    <Setter Property="Width" Value="20" />
                    <Setter Property="Margin" Value="5" />
                    <Setter Property="RadiusX" Value="5" />
                    <Setter Property="RadiusY" Value="5" />
                </Style>
            </Style.Resources>
            <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
            <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Foreground" Value="{StaticResource Button.Default.Text.Foreground}"/>
            <Setter Property="FontSize" Value="32" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="FontFamily" Value="Segoe Print" />
            <Setter Property="Margin" Value="10,5,5,5" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type controls:SubMenuButton}">
                        <Border x:Name="border" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                            <StackPanel Focusable="False" Orientation="Horizontal"
                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                  Margin="{TemplateBinding Padding}"
                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                <Rectangle Fill="{TemplateBinding RectangleFill}" Stroke="{StaticResource strokeRectangle}"/>
                                <TextBlock x:Name="tbxDescription" Grid.Column="1" Text="{TemplateBinding Description}"/>
                            </StackPanel>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="tbxDescription" Property="Foreground" Value="{StaticResource Button.MouseOver.Text.Foreground}"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="tbxDescription" Property="Foreground" Value="{StaticResource Button.Pressed.Text.Foreground}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="{x:Type local:ContinueView}" x:Shared="false">
            <Style.Setters>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:ContinueView}">
                            <Grid>
                                <Border x:Name="borderBlurred" Opacity="0">
                                    <Border.Background>
                                        <VisualBrush Visual="{Binding Content}"/>
                                    </Border.Background>
                                    <Border.Effect>
                                        <BlurEffect Radius="10"/>
                                    </Border.Effect>
                                </Border>
                                <Border x:Name="border1" Opacity="0">
                                    <Border x:Name="border" Height="285" Width="400" CornerRadius="20" Background="#9F101929" RenderTransformOrigin="0.5,0.5">
                                        <Border.RenderTransform>
                                            <TransformGroup>
                                                <ScaleTransform ScaleX="1" ScaleY="1"/>
                                                <SkewTransform/>
                                                <RotateTransform/>
                                                <TranslateTransform/>
                                            </TransformGroup>
                                        </Border.RenderTransform>
                                        <Grid HorizontalAlignment="Center" VerticalAlignment="Center" >
                                            <Grid.RowDefinitions>
                                                <RowDefinition x:Name="tryRow"/>
                                                <RowDefinition />
                                                <RowDefinition />
                                                <RowDefinition />
                                            </Grid.RowDefinitions>
                                            <controls:SubMenuButton x:Name="tryButton" Grid.Row="0" Description="Попробовать" RectangleFill="Green" Command="{Binding Try_Command}" Style="{DynamicResource SubmenuButtonStyle}"/>
                                            <controls:SubMenuButton x:Name="repeatButton" Grid.Row="1" Description="Повторить" RectangleFill="Orange" Command="{Binding Replay_Command}" Style="{DynamicResource SubmenuButtonStyle}"/>
                                            <controls:SubMenuButton x:Name="textInstructionButton" Grid.Row="2" Description="Текст инструкции" RectangleFill="Black" Command="{Binding ToInstruction_Command}" Style="{DynamicResource SubmenuButtonStyle}"/>
                                            <controls:SubMenuButton x:Name="toTaskButton" Grid.Row="3" Description="Тестирование" RectangleFill="Red" Command="{Binding ToTest_Command}" Style="{DynamicResource SubmenuButtonStyle}"/>
                                        </Grid>
                                    </Border>
                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="Visibility" Value="Visible">
                                    <Trigger.EnterActions>
                                        <BeginStoryboard x:Name="moutionBlurStart" Storyboard="{StaticResource motionBlur}"/>
                                    </Trigger.EnterActions>
                                    <Trigger.ExitActions>
                                        <StopStoryboard BeginStoryboardName="moutionBlurStart"/>
                                    </Trigger.ExitActions>
                                </Trigger>
                                <DataTrigger Binding="{Binding IsBetweenTasks}" Value="True">
                                    <Setter TargetName="tryButton" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="toTaskButton" Property="Description" Value="Продолжить"/>
                                    <Setter TargetName="tryRow" Property="Height" Value="0"/>
                                    <Setter TargetName="border" Property="Height" Value="215"/>
                                </DataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style.Setters>
        </Style>
    </UserControl.Resources>
   
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\ContinueView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    public partial class ContinueView : UserControl
    {
        public ContinueView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\EditorOptions.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    public class EditorOptions : NotifyBase
    {
        private GeneralMode mode;

        public GeneralMode Mode
        {
            get { return mode; }
            set 
            {
                if (mode != value)
                {
                    mode = value;
                    OnPropertyChanged();
                }
            }
        }

        public EditorOptions(GeneralMode mode = GeneralMode.Normal)
        {
            Mode = mode;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\ILearning.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    public interface ILearning
    {
        List<FrameworkElement> UsedElements { get; set; }
        TestMode Mode { get; set; }
        Dictionary<string, Action> TestMethods { get; set; }

        CanvasPanelViewModel LearningPanel { get; set; }
    }

    public enum TestMode
    {
        Normal,
        Manual
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\IOService.cs

using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    public static class IOService
    {
        private static OpenFileDialog OpenFileDialog = null;
        private static SaveFileDialog SaveFileDialog = null;
        public static string ShowOpenFileDialog(string initialDirectory)
        {
            if (OpenFileDialog == null)
                OpenFileDialog = new OpenFileDialog();
            OpenFileDialog.InitialDirectory = initialDirectory;
            OpenFileDialog.Filter = "Json files (*.json)|*.json | All files(*.*)|*.*";
            OpenFileDialog.FilterIndex = 2;
            OpenFileDialog.RestoreDirectory = true;
            if (OpenFileDialog.ShowDialog().Value)
                return OpenFileDialog.FileName;
            return null;
        }

        public static string ShowSaveFileDialog(string initialDirectory)
        {
            if (SaveFileDialog == null)
                SaveFileDialog = new SaveFileDialog();
            SaveFileDialog.InitialDirectory = initialDirectory;
            SaveFileDialog.Filter = "Json files (*.json)|*.json | All files(*.*)|*.*";
            SaveFileDialog.FilterIndex = 2;
            SaveFileDialog.RestoreDirectory = true;
            if (SaveFileDialog.ShowDialog().Value)
                return SaveFileDialog.FileName;
            return null;
           
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\JsonFileGenerator.cs

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.IO;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    public static class JsonFileGenerator
    { 
        public static void GenerateScenarioFile(string fileName, StudyAssignmentModel model)
        {
            using (StreamWriter file = File.CreateText(@fileName))
            {
                string data = JsonConvert.SerializeObject(model, new JsonSerializerSettings
                {
                    TypeNameHandling = TypeNameHandling.All
                });
                file.Write(data);
            }
        }

        public static StudyAssignmentModel GetModel(string fileName)
        {
            StudyAssignmentModel model = null;
            using (StreamReader file = File.OpenText($@"{fileName}"))
            {
                var raw = file.ReadToEnd();
                model = JsonConvert.DeserializeObject<StudyAssignmentModel>(raw, new JsonSerializerSettings
                {
                    TypeNameHandling = TypeNameHandling.Auto
                });
            }
            return model;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\MainView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.MainView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension"
             xmlns:timeline="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline"
             xmlns:viewModels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.ViewModels"
             xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels"
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
             xmlns:elements="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Elements"
             xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Converters"
             xmlns:toolsEditor="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor"
             mc:Ignorable="d" 
             d:DesignHeight="1080" d:DesignWidth="1920">
    <UserControl.Resources>
        <converters:NegateBooleanToVisibilityConverter x:Key="NegateBooleanToVisibilityConverter"/>
        <Style TargetType="{x:Type local:MainView}">
            <Style.Setters>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:MainView}">
                            <Grid x:Name="rootGrid" Background="#FF49505B">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <Grid x:Name="header">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Text="Инструкция"
                                               Grid.Column="0"
                                               Grid.ColumnSpan="2"
                                               Foreground="White"
                                               FontSize="30"
                                               x:Name="learningTask_tbx"
                                               HorizontalAlignment="Center"
                                               VerticalAlignment="Center" TextDecorations="{x:Null}"/>
                                    <StackPanel x:Name="file_stackPanel" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Column="1" Orientation="Horizontal">
                                        <TextBlock Text="{Binding FileName}" Margin="3" Foreground="White"/>
                                        <Button Content="Сохранить" x:Name="SaveButton" Command="{Binding Save_Command}" Margin="3"/>
                                        <Button Content="Открыть" x:Name="OpenButton" Command="{Binding Open_Command}" Margin="3"/>
                                    </StackPanel>
                                </Grid>
                                <Grid Grid.Row="1">
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid x:Name="PART_contentView" Grid.Row="0" Grid.Column="1">
                                        <ContentPresenter x:Name="content_Presenter"  Grid.Column="0" Content="{Binding Content}"/>
                                    </Grid>
                                    <Border Visibility="{Binding SwitchMode.SwitchPosition, Converter={StaticResource NegateBooleanToVisibilityConverter}}">
                                        <panels:ToolsPanelView Width="300" DataContext="{Binding ToolsViewModel}"/>
                                    </Border>
                                    <local:PreviewToolsView Grid.Column="2"  DataContext="{Binding SwitchMode}" VerticalAlignment="Top" Visibility="{Binding SwitchPosition, Converter={StaticResource NegateBooleanToVisibilityConverter}}"/>

                                    <Border Grid.Row="1" Grid.ColumnSpan="3" Height="500" Visibility="{Binding SwitchMode.SwitchPosition, Converter={StaticResource NegateBooleanToVisibilityConverter}}">
                                    <ContentPresenter Content="{Binding TimelinesData}">
                                        <ContentPresenter.ContentTemplate>
                                            <DataTemplate DataType="{x:Type viewModels:TimelinesViewModel}">
                                                <timeline:Timeline DataContext="{Binding}"/>
                                            </DataTemplate>
                                        </ContentPresenter.ContentTemplate>
                                    </ContentPresenter>
                                    </Border>
                                    <Grid x:Name="gridFullScreen" Grid.RowSpan="2" Grid.ColumnSpan="3" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5" Opacity="0.0">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <TextBlock Text="Предпросмотр" Foreground="#FFDBE7F3" Margin="5" HorizontalAlignment="Right"/>
                                        <elements:Thumbler Grid.Row="1" Margin="5" HorizontalAlignment="Right" DataContext="{Binding SwitchMode}" />
                                    </Grid>
                                    <Border x:Name="border_veil_PART" Grid.ColumnSpan="3" Grid.RowSpan="2" Background="#A50D0D11">
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="MouseDown">
                                                <i:InvokeCommandAction Command="{Binding ToolsManager.CloseEditToolPropertiesCommand}"/>
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </Border>
                                    <toolsEditor:EditToolProperties Grid.ColumnSpan="3" Grid.RowSpan="2" x:Name="editTool"
                                                                DataContext="{Binding ToolsManager.CurrentTool}"
                                                                VerticalAlignment="Center"
                                                                HorizontalAlignment="Center">
                                    </toolsEditor:EditToolProperties>
                                </Grid>
                                <local:ContinueView x:Name="continueView"
                                                    Grid.RowSpan="2"
                                                    Visibility="Collapsed"/>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <DataTrigger Binding="{Binding ToolsManager.CurrentTool}" Value="{x:Null}">
                                    <Setter TargetName="editTool" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="border_veil_PART" Property="Visibility" Value="Collapsed"/>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding SwitchMode.SwitchPosition}" Value="True">
                                    <Setter TargetName="gridFullScreen" Property="Opacity" Value="1.0" />
                                    <Setter TargetName="file_stackPanel" Property="Opacity" Value="0.0"/>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding IsLearningMode}" Value="True">
                                    <Setter TargetName="gridFullScreen" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="border_veil_PART" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="editTool" Property="Visibility" Value="Collapsed"/>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding ContinueViewVisible}" Value="True">
                                    <Setter TargetName="continueView" Property="Visibility" Value="Visible"/>
                                </DataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style.Setters>
        </Style>
    </UserControl.Resources>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\MainView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    public partial class MainView : UserControl
    {
        public MainView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\MainWindow.xaml

<Window x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension"
        mc:Ignorable="d"
        Title="MainWindow" Height="1080" Width="1920">
    <local:MainView x:Name="mainView" DataContext="{Binding}"/>
</Window>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\MainWindow.xaml.cs

using Microsoft.Xaml.Behaviors;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.ViewModels;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    public partial class MainWindow : Window
    {
        private MainViewModel ViewModel { get; set; }
        public MainWindow()
        {
            InitializeComponent();
            Loaded += MainWindow_Loaded;
        }

        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            //Loaded -= MainWindow_Loaded;
            //ViewModel = new MainViewModel(new TestContent(), new Timeline.Models.StudyAssignmentModel(TimeSpan.FromSeconds(100)));
            //ViewModel.WaitingOuterAction += ViewModel_WaitingOuterAction;
            //ViewModel.Initialize();
            //DataContext = ViewModel;
        }

        private IStopper stopper;
        private void ViewModel_WaitingOuterAction(object sender, IStopper e)
        {
            stopper = e;
        }

        private void textWaitingButton_Click(object sender, RoutedEventArgs e)
        {
            if (stopper != null)
            {
                stopper.Resume();
                stopper = null;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\NotifyBase.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    public abstract class NotifyBase : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged([CallerMemberName] string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\PreviewToolsView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.PreviewToolsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension" xmlns:elements="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Elements"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800" Background="#FF334159" Width="300" Height="200">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock Text="ПАНЕЛЬ ПРЕДПРОСМОТРА" FontSize="14" Padding="5" Background="#FF336799" Foreground="#FFDBE7F3" FontWeight="Light"/>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TextBlock Text="Предпросмотр" HorizontalAlignment="Right" Foreground="#FFDBE7F3" FontWeight="Light" Margin="5"/>
            <elements:Thumbler Grid.Column="1" Margin="5"/>
        </Grid>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\PreviewToolsView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    /// <summary>
    /// Interaction logic for PreviewToolsView.xaml
    /// </summary>
    public partial class PreviewToolsView : UserControl
    {
        public PreviewToolsView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\RelayCommand.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    public class RelayCommand : ICommand
    {
        private Action<object> execute;
        private Func<object, bool> canExecute;

        public event EventHandler CanExecuteChanged
        {
            add { CommandManager.RequerySuggested += value; }
            remove { CommandManager.RequerySuggested -= value; }
        }

        public RelayCommand(Action<object> execute, Func<object, bool> canExecute = null)
        {
            this.execute = execute;
            this.canExecute = canExecute;
        }

        public bool CanExecute(object parameter)
        {
            return this.canExecute == null || this.canExecute(parameter);
        }

        public void Execute(object parameter)
        {
            this.execute(parameter);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\SingleEditorOptions.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    public static class SingleEditorOptions
    {
        public static EditorOptions EditorOptions;
        private static void Initialize()
        {
            EditorOptions = new EditorOptions();
        }

        public static EditorOptions GetOptions()
        {
            if (EditorOptions == null)
                Initialize();
            return EditorOptions;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\SingleToolsManager.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Common;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    public class SingleToolsManager
    {
        public IToolsManager ToolsManager;
        private void Initialize(GeneralMode mode = GeneralMode.Normal)
        {
            if (ToolsManager == null)
                ToolsManager = new ToolsManager();
        }

        public IToolsManager GetManager()
        {
            if (ToolsManager == null)
                Initialize();
            return ToolsManager;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\TestContent.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.TestContent"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <Storyboard x:Key="Storyboard1" RepeatBehavior="Forever">
            <DoubleAnimationUsingPath Duration="0:0:10" Source="X" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="eba">
                <DoubleAnimationUsingPath.PathGeometry>
                    <PathGeometry Figures="M197.5,0 C197.5,109.07624 109.07624,197.5 0,197.5 C-109.07624,197.5 -197.5,109.07624 -197.5,0 C-197.5,-109.07624 -109.07624,-197.5 0,-197.5 C109.07624,-197.5 197.5,-109.07624 197.5,0 z"/>
                </DoubleAnimationUsingPath.PathGeometry>
            </DoubleAnimationUsingPath>
            <DoubleAnimationUsingPath Duration="0:0:10" Source="Y" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="eba">
                <DoubleAnimationUsingPath.PathGeometry>
                    <PathGeometry Figures="M197.5,0 C197.5,109.07624 109.07624,197.5 0,197.5 C-109.07624,197.5 -197.5,109.07624 -197.5,0 C-197.5,-109.07624 -109.07624,-197.5 0,-197.5 C109.07624,-197.5 197.5,-109.07624 197.5,0 z"/>
                </DoubleAnimationUsingPath.PathGeometry>
            </DoubleAnimationUsingPath>
        </Storyboard>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
        </EventTrigger>
    </UserControl.Triggers>
    <Viewbox>
    <Grid Height="400" Width="400">
        <Ellipse x:Name="elli1" Fill="#FF6E5B37" Stroke="#FF4FB6B6" StrokeThickness="5"  Height="400" Width="400"/>
        <Ellipse x:Name="eba" Height="20" Width="20" Fill="Blue" RenderTransformOrigin="0.5,0.5">
            <Ellipse.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                </TransformGroup>
            </Ellipse.RenderTransform>
        </Ellipse>
        <Grid>
            <Grid>
                <Button x:Name="button1" Height="30" Width="30" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="20"/>
            </Grid>
        </Grid>
    </Grid>
    </Viewbox>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\TestContent.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension
{
    /// <summary>
    /// Interaction logic for TestContent.xaml
    /// </summary>
    public partial class TestContent : UserControl
    {
        public TestContent()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Behaviors\IMouseCaptureProxy.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Behaviors
{
    public interface IMouseCaptureProxy
    {
        event EventHandler Capture;
        event EventHandler Release;

        void OnMouseDown(object sender, MouseCaptureArgs e);
        void OnMouseMove(object sender, MouseCaptureArgs e);
        void OnMouseUp(object sender, MouseCaptureArgs e);
    }

    public class MouseCaptureArgs
    {
        public double X { get; set; }
        public double Y { get; set; }
        public bool LeftButton { get; set; }
        public bool RightButton { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Behaviors\ISize.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Behaviors
{
    public interface ISize
    {
        void OnSizeChanged(object sender, SizeChangedEventArgs e);
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Behaviors\MouseCaptureBehavior.cs

using Microsoft.Xaml.Behaviors;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Behaviors
{
    public class MouseCaptureBehavior : Behavior<FrameworkElement>
    {
        public static readonly DependencyProperty ProxyProperty = DependencyProperty.RegisterAttached(
            "Proxy",
            typeof(IMouseCaptureProxy),
            typeof(MouseCaptureBehavior),
            new PropertyMetadata(null, OnProxyChanged));

        public static void SetProxy(DependencyObject source, IMouseCaptureProxy value)
        {
            source.SetValue(ProxyProperty, value);
        }

        public static IMouseCaptureProxy GetProxy(DependencyObject source)
        {
            return (IMouseCaptureProxy)source.GetValue(ProxyProperty);
        }

        private static void OnProxyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.OldValue is IMouseCaptureProxy)
            {
                (e.OldValue as IMouseCaptureProxy).Capture -= (d as MouseCaptureBehavior).OnCapture;
                (e.OldValue as IMouseCaptureProxy).Release -= (d as MouseCaptureBehavior).OnRelease;
            }
            if (e.NewValue is IMouseCaptureProxy)
            {
                (e.NewValue as IMouseCaptureProxy).Capture += (d as MouseCaptureBehavior).OnCapture;
                (e.NewValue as IMouseCaptureProxy).Release += (d as MouseCaptureBehavior).OnRelease;
            }
        }

        private void OnCapture(object sender, EventArgs e)
        {
            AssociatedObject.CaptureMouse();
        }

        private void OnRelease(object sender, EventArgs e)
        {
            AssociatedObject.ReleaseMouseCapture();
        }

        protected override void OnAttached()
        {
            base.OnAttached();
            this.AssociatedObject.MouseDown += OnMouseDown;
            this.AssociatedObject.MouseMove += OnMouseMove;
            this.AssociatedObject.MouseUp += OnMouseUp;
        }

        protected override void OnDetaching()
        {
            base.OnDetaching();
            this.AssociatedObject.MouseDown -= OnMouseDown;
            this.AssociatedObject.MouseMove -= OnMouseMove;
            this.AssociatedObject.MouseUp -= OnMouseUp;
        }

        private void OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            var proxy = GetProxy(this);
            if (proxy != null)
            {
                var pos = e.GetPosition(this.AssociatedObject);
                var args = new MouseCaptureArgs
                {
                    X = pos.X,
                    Y = pos.Y,
                    LeftButton = (e.LeftButton == MouseButtonState.Pressed),
                    RightButton = (e.RightButton == MouseButtonState.Pressed)
                };
                proxy.OnMouseDown(this, args);
            }
        }

        private void OnMouseMove(object sender, MouseEventArgs e)
        {
            var proxy = GetProxy(this);
            if (proxy != null)
            {
                var pos = e.GetPosition(this.AssociatedObject);
                var args = new MouseCaptureArgs
                {
                    X = pos.X,
                    Y = pos.Y,
                    LeftButton = (e.LeftButton == MouseButtonState.Pressed),
                    RightButton = (e.RightButton == MouseButtonState.Pressed)
                };
                proxy.OnMouseMove(this, args);
            }
        }

        private void OnMouseUp(object sender, MouseButtonEventArgs e)
        {
            var proxy = GetProxy(this);
            if (proxy != null)
            {
                var pos = e.GetPosition(this.AssociatedObject);
                var args = new MouseCaptureArgs
                {
                    X = pos.X,
                    Y = pos.Y,
                    LeftButton = (e.LeftButton == MouseButtonState.Pressed),
                    RightButton = (e.RightButton == MouseButtonState.Pressed)
                };
                proxy.OnMouseUp(this, args);
            }
        }

    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Behaviors\MouseDropBehavior.cs

using Microsoft.Xaml.Behaviors;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Behaviors
{
    public class MouseDropBehavior : Behavior<FrameworkElement>
    {
        public static IDrop GetProxy(DependencyObject obj)
        {
            return (IDrop)obj.GetValue(ProxyProperty);
        }

        public static void SetProxy(DependencyObject obj, IDrop value)
        {
            obj.SetValue(ProxyProperty, value);
        }

        public static readonly DependencyProperty ProxyProperty =
            DependencyProperty.RegisterAttached("Proxy", typeof(IDrop), typeof(MouseDropBehavior), new PropertyMetadata(null));


        protected override void OnAttached()
        {
            base.OnAttached();
            AssociatedObject.Drop += AssociatedObject_Drop;
        }

        protected override void OnDetaching()
        {
            base.OnDetaching();
            AssociatedObject.Drop -= AssociatedObject_Drop;
        }
        private void AssociatedObject_Drop(object sender, DragEventArgs e)
        {
            var proxy = GetProxy(this);
            if (proxy != null)
            {
                var pos = e.GetPosition(this.AssociatedObject);
                var args = new DropArgs
                {
                    X = pos.X,
                    Y = pos.Y,
                    Data=e.Data
                };
                proxy.OnDrop(this, args);
            }
        }

    }

    public class DropArgs
    {
        public double X { get; set; }
        public double Y { get; set; }
        public IDataObject Data { get; set; }
    }

    public interface IDrop
    {
        void OnDrop(object sender, DropArgs e);
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Behaviors\SizeBehavior.cs

using Microsoft.Xaml.Behaviors;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Behaviors
{
    public class SizeBehavior : Behavior<FrameworkElement>
    {
        public static ISize GetProxy(DependencyObject obj)
        {
            return (ISize)obj.GetValue(ProxyProperty);
        }

        public static void SetProxy(DependencyObject obj, ISize value)
        {
            obj.SetValue(ProxyProperty, value);
        }

        public static readonly DependencyProperty ProxyProperty =
            DependencyProperty.RegisterAttached("Proxy", typeof(ISize), typeof(SizeBehavior), new PropertyMetadata(null));

        protected override void OnAttached()
        {
            base.OnAttached();
            AssociatedObject.SizeChanged += AssociatedObject_SizeChanged; 
        }

        protected override void OnDetaching()
        {
            base.OnDetaching();
            AssociatedObject.SizeChanged -= AssociatedObject_SizeChanged;
        }

        private void AssociatedObject_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            var proxy = GetProxy(this);
            if (proxy != null)
                proxy?.OnSizeChanged(this, e);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Common\BindingResourceExtension.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Common
{
    public class BindingResourceExtension : StaticResourceExtension
    {
        public BindingResourceExtension() : base() { }

        public BindingResourceExtension(object resourceKey) : base(resourceKey) { }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            var binding = base.ProvideValue(serviceProvider) as BindingBase;
            if (binding != null)
                return binding.ProvideValue(serviceProvider);
            else
                return null; //or throw an exception
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Common\Common.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Common
{
    public static class Common
    {
       public static Random RND = new Random();
        public enum Mode
        {
            Add,
            Remove,
            Update
        }
    }

    public enum GeneralMode
    {
        Normal,
        Editor
    }

    public static class ReflectionHelper
    {
        public static DependencyProperty GetDependencyProperty(this FrameworkElement fe, string propertyName)
        {
            var propertyNamesToCheck = new List<string> { propertyName, propertyName + "Property" };
            var type = fe.GetType();
            return (from propertyname in propertyNamesToCheck
                    select type.GetPublicStaticField(propertyname)
                        into field
                    where field != null
                    select (DependencyProperty)field.GetValue(fe))
                .FirstOrDefault();
        }

        public static FieldInfo GetPublicStaticField(this Type type, string fieldName)
        {
            return type.GetField(fieldName, BindingFlags.FlattenHierarchy | BindingFlags.Public | BindingFlags.Static);
        }
    }
}



*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\Arrow.cs

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.CustomBrushes;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public class Arrow : NotifyBase, ITool, ISelectable
    {
        public event EventHandler Selected;
        public event EventHandler<IBaseElement> PreviewMouseDown;
        public event EventHandler<IBaseElement> PreviewMouseUp;
        public string ID
        {
            get => _model.ID;
            set => _model.ID = value;
        }

        public Point Point
        {
            get { return _model.Position; }
            set
            {
                _model.Position = value;
                OnPropertyChanged();
                UpdateLine();
            }
        }

        public Point ControlPoint1
        {
            get { return _model.ControlPoint1; }
            set
            {
                _model.ControlPoint1 = value;
                OnPropertyChanged();
                UpdateLine();
            }
        }
        public Point ControlPoint2
        {
            get { return _model.ControlPoint2; }
            set
            {
                _model.ControlPoint2 = value;
                OnPropertyChanged();
                UpdateLine();
            }
        }
        public Point EndPoint
        {
            get { return _model.EndPoint; }
            set
            {
                _model.EndPoint = value;
                OnPropertyChanged();
                UpdateLine();
            }
        }

        #region CalculateArrow
        public Geometry Geometry => GetGeometry();
        public Geometry ArrowHeadGeometry => GetArrowHead();
        private Geometry GetArrowHead()
        {
            PathGeometry geometry = new PathGeometry();
            PathFigure figure = (Geometry as PathGeometry).Figures[0];
            PathFigure arrow = CalculateArrow(figure);
            geometry.Figures.Add(arrow);
            return geometry;
        }
        private Geometry GetGeometry()
        {
            PathGeometry geomerty = new PathGeometry();
            PathFigure figure = new PathFigure
            {
                StartPoint = _model.Position
            };
            PolyBezierSegment polyBezierSeg = new PolyBezierSegment();
            polyBezierSeg.Points.Add(_model.ControlPoint1);
            polyBezierSeg.Points.Add(_model.ControlPoint2);
            polyBezierSeg.Points.Add(_model.EndPoint);
            figure.Segments.Add(polyBezierSeg);
            geomerty.Figures.Add(figure);

            return geomerty;
        }
        private double _arrowLength = 30;
        private double _arrowAngle = 60;
        private bool _isArrowClosed = true;
        private PathFigure CalculateArrow(PathFigure pathfig)
        {
            PolyBezierSegment polyseg = pathfig.Segments.Last() as PolyBezierSegment;
            Point pt1 = polyseg.Points[1];
            Point pt2 = polyseg.Points[2];

            Matrix matx = new Matrix();
            Vector vect = pt1 - pt2;
            vect.Normalize();
            vect *= _arrowLength;

            matx.Rotate(_arrowAngle / 2);
            PathFigure pf = new PathFigure();
            PolyLineSegment polyLineSegment = new PolyLineSegment();
            pf.Segments.Add(polyLineSegment);

            pf.StartPoint = pt2 + vect * matx;
            polyLineSegment.Points.Add(pt2);

            matx.Rotate(-_arrowAngle);
            polyLineSegment.Points.Add(pt2 + vect * matx);
            pf.IsClosed = _isArrowClosed;

            return pf;
        }
        #endregion
        private void UpdateLine()
        {
            OnPropertyChanged("Geometry");
            OnPropertyChanged("ArrowHeadGeometry");
        }
        public RelayCommand CurrentSelect_Command => new RelayCommand(obj =>
        {
            Selected?.Invoke(this, new EventArgs());
        });
        public Brush Color
        {
            get { return _model.Color; }
            set
            {
                _model.Color = value;
                OnPropertyChanged();
            }
        }

        public bool IsDashed
        {
            get { return _model.IsDashed; }
            set 
            {
                _model.IsDashed = value;
                OnPropertyChanged();
            }
        }

        private bool _isSelected;
        public bool IsSelected
        {
            get { return _isSelected; }
            set
            {
                _isSelected = value;
                OnPropertyChanged();
            }
        }

        public Brush Brush { get; set; } = ArrowBrush.GetBrush();
        public string Component_Name { get; set; } = nameof(Arrow);
        public string Description { get; set; } = "Стрелка";
        public FrameworkElement AssociatedObject { get; set; }
        public double X { get; set; }
        public double Y { get; set; }
        public double Width { get; set; }
        public double Height { get; set; }

        public RelayCommand PreviewMouseDownCommand => new RelayCommand(obj =>
        {
            if (obj is IBaseElement element)
                PreviewMouseDown?.Invoke(this, element);
        });

        public RelayCommand PreviewMouseUpCommand => new RelayCommand(obj =>
        {
            if (obj is IBaseElement element)
                PreviewMouseUp?.Invoke(this, element);
        });

        private double _opacity = 0.0;
        public double Opacity
        {
            get { return _opacity; }
            set
            {
                _opacity = value;
                OnPropertyChanged();
            }
        }

        public EditorOptions EditorOptions { get; set; }
        public Arrow()
        {

        }

        private readonly ArrowScenarioModel _model;
        public Arrow(ArrowScenarioModel model)
        {
            _model = model;
            if (_model.ControlPoint1 == _model.ControlPoint2 &&
                _model.ControlPoint1 == _model.EndPoint)
            {
                _model.EndPoint = new Point(_model.Position.X + 100, _model.Position.Y + 100);
                _model.ControlPoint1 = new Point(_model.EndPoint.X, _model.EndPoint.Y);
                _model.ControlPoint2 = new Point(_model.Position.X, _model.Position.Y);
            }
        }

        public void Start()
        {
            Opacity = 1.0;
        }

        public void Stop()
        {
            Opacity = 0.0;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\CallingMehtodByTimer.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public class CallingMehtodByTimer : NotifyBase, ITool
    {
        public string ID
        {
            get { return _model.ID; }
            set { _model.ID = value; }
        }

        public string MethodName
        {
            get { return _model.MethodName; }
            set
            {
                _model.MethodName = value;
                OnPropertyChanged();
            }
        }

        public TimeSpan TimerInterval
        {
            get => _model.TimerInterval;
            set
            {
                _model.TimerInterval = value;
                OnPropertyChanged();
            }
        }

        public string Component_Name { get; set; } = nameof(CallingMehtodByTimer);
        public string Description { get; set; } = "Вызов метода [таймер]";
        public Brush Brush { get; set; } = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFF7111"));
        public FrameworkElement AssociatedObject { get; set; }

        private readonly CallingMethodByTimerScenarioModel _model;
        private readonly IToolsManager _toolsManager;
        private readonly DispatcherTimer _timer;
        public CallingMehtodByTimer()
        {

        }

        public CallingMehtodByTimer(CallingMethodByTimerScenarioModel model, IToolsManager toolsManager)
        {
            _model = model;
            _toolsManager = toolsManager;
            _timer = new DispatcherTimer();
            _timer.Tick += _timer_Tick;
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            _method.Invoke();
        }

        private Action _method;
        public void Start()
        {
            if (_model.TimerInterval != TimeSpan.Zero)
            {
                _timer.Interval = TimerInterval;
                if (!string.IsNullOrEmpty(MethodName) && !string.IsNullOrWhiteSpace(MethodName))
                {
                    KeyValuePair<string, Action>? method = _toolsManager.UsedMethods.FirstOrDefault(f => f.Key == MethodName);
                    if (method != null)
                    {
                        _method = method.Value.Value;
                        _timer.Start();
                    }
                }
                
            }
        }

        public void Stop()
        {
            _timer.Stop();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\CallingMethod.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public class CallingMethod : NotifyBase, ITool
    {
        public string ID
        {
            get { return _model.ID; }
            set { _model.ID = value; }
        }

        public string MethodName
        {
            get { return _model.MethodName; }
            set 
            {
                _model.MethodName = value;
                OnPropertyChanged();
            }
        }

        public string Component_Name { get; set; } = nameof(CallingMethod);
        public string Description { get; set; } = "Вызов метода";
        public Brush Brush { get; set; } = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFF05685"));
        public FrameworkElement AssociatedObject { get; set; }

        private readonly CallingMethodScenarioModel _model;
        private readonly IToolsManager _toolsManager;
        public CallingMethod()
        {

        }
        public CallingMethod(CallingMethodScenarioModel model, IToolsManager toolsManager)
        {
            _toolsManager = toolsManager;
            _model = model;
        }
        public void Start()
        {
            if (!string.IsNullOrEmpty(MethodName) && !string.IsNullOrWhiteSpace(MethodName))
            {
                KeyValuePair<string, Action>? method = _toolsManager.UsedMethods.FirstOrDefault(f => f.Key == MethodName);
                if (method != null)
                    method.Value.Value?.Invoke();
            }
        }

        public void Stop()
        {
           
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ColorAnimation.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public class ColorAnimation : NotifyBase, ITool
    {
        public Brush Brush { get; set; } = Brushes.Green;

        public Brush Color
        {
            get { return _model.Color; }
            set
            {
                _model.Color = value;
                if (_model.Color != null)
                    CreateAnimation();
                OnPropertyChanged();
            }
        }

        public string ID
        {
            get { return _model.ID; }
            set { _model.ID = value; }
        }
        public string Component_Name { get; set; } = nameof(ColorAnimation);
        public string Description { get; set; } = "Цвет [анимация]";
        public FrameworkElement AssociatedObject { get; set ; }

        private Storyboard animation;
        public ColorAnimation()
        {
           
        }

        public ColorAnimation(FrameworkElement associatedObject)
        {
            AssociatedObject = associatedObject;
           
        }
        private readonly ColorSegmentScenarioModel _model;
        public ColorAnimation(ColorSegmentScenarioModel model)
        {
            _model = model;
        }

        private void CreateAnimation()
        {
            if (AssociatedObject != null)
            {
                animation = new Storyboard();
                animation.RepeatBehavior = RepeatBehavior.Forever;
                var cAUKF = new ColorAnimationUsingKeyFrames();
                cAUKF.KeyFrames.Add(new EasingColorKeyFrame((Color)ColorConverter.ConvertFromString((Color as SolidColorBrush).Color.ToString()), TimeSpan.FromMilliseconds(0)));
                cAUKF.KeyFrames.Add(new EasingColorKeyFrame((Color)ColorConverter.ConvertFromString("#00000000"), TimeSpan.FromMilliseconds(200)));
                cAUKF.KeyFrames.Add(new EasingColorKeyFrame((Color)ColorConverter.ConvertFromString((Color as SolidColorBrush).Color.ToString()), TimeSpan.FromMilliseconds(400)));
                cAUKF.KeyFrames.Add(new EasingColorKeyFrame((Color)ColorConverter.ConvertFromString("#00000000"), TimeSpan.FromMilliseconds(600)));
                cAUKF.KeyFrames.Add(new EasingColorKeyFrame((Color)ColorConverter.ConvertFromString((Color as SolidColorBrush).Color.ToString()), TimeSpan.FromMilliseconds(800)));

                PropertyPath colorTargetPath = null;
                if (AssociatedObject is Shape obj)
                {
                    var property = Common.ReflectionHelper.GetDependencyProperty(AssociatedObject, "Stroke");
                    if (property != null)
                    {
                        if (AssociatedObject.GetValue(property) == null)
                            obj.Stroke = Brushes.Transparent;
                        colorTargetPath = new PropertyPath("(Shape.Stroke).(SolidColorBrush.Color)");
                    }
                    else
                        obj.Stroke = Brushes.Black;
                }
                else
                {
                    var property = Common.ReflectionHelper.GetDependencyProperty(AssociatedObject, "Background");
                    if (property != null)
                    {
                        if (AssociatedObject.GetValue(property) == null)
                            AssociatedObject.SetValue(property, Brushes.Transparent);
                        colorTargetPath = new PropertyPath("(Panel.Background).(SolidColorBrush.Color)");
                    }
                    else
                        return;
                }

                Storyboard.SetTarget(cAUKF, AssociatedObject);
                Storyboard.SetTargetProperty(cAUKF, colorTargetPath);
                animation.Children.Add(cAUKF);
            }
        }

        public void Start()
        {
            CreateAnimation();
            if (animation != null)
                animation.Begin();
        }

        public void Stop()
        {
            if (animation != null)
            {
                animation.Stop();
               
                
            }
        }

        private PropertyInfo GetProperty(FrameworkElement AssociatedObject, string propertyString)
        {
            try
            {
                var type = AssociatedObject.GetType();
                var property = type.GetProperty(propertyString);
                
                return property;
            }
            catch
            {
                return null;
            }
        }
        private object SetPropertyValue(FrameworkElement AssociatedObject, string propertyString, object value)
        {
            var type = AssociatedObject.GetType();
            var property = type.GetProperty(propertyString);
            try
            {
                property.SetValue(AssociatedObject, value);
                return value;
            }
            catch (Exception ex)
            {
                return ex;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ColorChanger.cs

using Microsoft.Xaml.Behaviors;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public class ColorChanger : NotifyBase, ITool
    {
        public Brush Color
        {
            get { return _model.Color; }
            set
            {
                _model.Color = value;
                OnPropertyChanged();
            }
        }

        private Brush _defaultValue;

        public Brush DefaultValue
        {
            get { return _defaultValue; }
            set { _defaultValue = value; }
        }

        public string Component_Name { get; set; } = nameof(ColorChanger);
        public string Description { get; set; } = "Изменение цвета";
        private FrameworkElement _associatedObject;

        public FrameworkElement AssociatedObject
        {
            get { return _associatedObject; }
            set
            {
                _associatedObject = value;
                if (value != null)
                    SetDefaultValue();
            }
        }

        public Brush Brush { get; set; } = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFed2b2e"));
        public string ID
        {
            get { return _model.ID; }
            set { _model.ID = value; }
        }

        public ColorChanger()
        {

        }

        public ColorChanger(FrameworkElement associatedObject)
        {
            AssociatedObject = associatedObject;

        }

        private readonly ColorSegmentScenarioModel _model;
        public ColorChanger(ColorSegmentScenarioModel model)
        {
            _model = model;
        }

        public void Start()
        {
            if (_objectType == ObjectType.Shape)
                ((Shape)AssociatedObject).Stroke = Color;
            else
                SetPropertyValue(AssociatedObject, "BorderBrush", Color);
        }

        private ObjectType _objectType;
        private void SetDefaultValue()
        {
            if (AssociatedObject is Shape obj)
            {
                _objectType = ObjectType.Shape;
                if (obj.Stroke != null)
                    DefaultValue = obj.Stroke;
            }
            else
            {
                var propertyValue = GetPropertyValue(AssociatedObject, "BorderBrush");

                if (propertyValue != null)
                {
                    DefaultValue = (SolidColorBrush)propertyValue;
                    _objectType = ObjectType.FrameworkElement;
                }
            }
        }

        public void Stop()
        {
            if (_objectType == ObjectType.Shape)
                ((Shape)AssociatedObject).Stroke = _defaultValue;
            else
                SetPropertyValue(AssociatedObject, "BorderBrush", _defaultValue);
        }

        private object GetPropertyValue(FrameworkElement AssociatedObject, string propertyString)
        {
            var type = AssociatedObject.GetType();
            var property = type.GetProperty(propertyString);
            var value = property.GetValue(AssociatedObject);
            return value;
        }

        private object SetPropertyValue(FrameworkElement AssociatedObject, string propertyString, object value)
        {
            var type = AssociatedObject.GetType();
            var property = type.GetProperty(propertyString);
            try
            {
                property.SetValue(AssociatedObject, value);
                return value;
            }
            catch (Exception ex)
            {
                return ex;
            }
        }
    }

    enum ObjectType
    {
        Unknown,
        Shape,
        FrameworkElement
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ComponentTemplates.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components"
                    xmlns:common="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Common"
                    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
                    xmlns:draw="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw"
                    xmlns:markers="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw.Markers"
                    xmlns:markers_converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw.Markers.Converters">
    <DataTemplate DataType="{x:Type local:MediaPlayer}">
        <Border x:Name="player_border_part" BorderThickness="0.5" BorderBrush="{x:Null}">
            <Grid x:Name="root_part_grid" Height="{Binding Height}" Width="{Binding Width}" Opacity="{Binding Opacity}">
                <ContentPresenter x:Name="mediaElementInPlayer" Content="{Binding PlayerElement}" Opacity="1.0"/>
                <Grid x:Name="noVideoIcon" Height="64" Width="64" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.0">
                    <Path Data="M32,22c-6.627,0-12,5.372-12,12c0,6.627,5.373,12,12,12s12-5.373,12-12S38.627,22,32,22z M61,12H48.243l-5.095-5.094
				l-0.002,0.003C42.602,6.35,41.843,6,41,6H23c-0.976,0-1.835,0.474-2.383,1.196L15.813,12H3c-1.657,0-3,1.343-3,3v40
				c0,1.657,1.343,3,3,3h58c1.657,0,3-1.343,3-3V15C64,13.343,62.657,12,61,12z M32,52c-9.941,0-18-8.059-18-18
				c0-9.941,8.059-18,18-18c9.941,0,18,8.059,18,18C50,43.941,41.941,52,32,52z" Stroke="#FF6E6E6E" StrokeThickness="4" />
                    <Path Data="M32,0C14.327,0,0,14.327,0,32s14.327,32,32,32s32-14.327,32-32S49.673,0,32,0z M32,58C17.641,58,6,46.359,6,32
				c0-6.098,2.115-11.694,5.63-16.128L48.128,52.37C43.693,55.886,38.098,58,32,58z M52.37,48.128L15.873,11.63
				C20.307,8.115,25.902,6,32,6c14.359,0,26,11.641,26,26C58,38.098,55.887,43.693,52.37,48.128z" Fill="#FFCF0000" RenderTransformOrigin="0.5,0.5">
                        <Path.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform ScaleX="0.9" ScaleY="0.9"/>
                                <SkewTransform/>
                                <RotateTransform/>
                                <TranslateTransform Y="2"/>
                            </TransformGroup>
                        </Path.RenderTransform>
                    </Path>
                </Grid>
            </Grid>
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="PreviewMouseDown" >
                    <i:InvokeCommandAction Command="{Binding PreviewMouseDownCommand}" CommandParameter="{Binding}"/>
                </i:EventTrigger>
                <i:EventTrigger EventName="PreviewMouseUp" >
                    <i:InvokeCommandAction Command="{Binding PreviewMouseUpCommand}" CommandParameter="{Binding}"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Border>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Source}" Value="{x:Null}">
                <Setter TargetName="root_part_grid" Property="Background" Value="#C03C76D1" />
                <Setter TargetName="mediaElementInPlayer" Property="Opacity" Value="0.0"/>
                <Setter TargetName="noVideoIcon" Property="Opacity" Value="1.0"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding EditorOptions.Mode}" Value="{x:Static common:GeneralMode.Editor}">
                <Setter TargetName="player_border_part" Property="BorderBrush" Value="#FF8CB8FF" />
                <Setter TargetName="player_border_part" Property="Background" Value="#6B115CD3" />
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
    <DataTemplate DataType="{x:Type local:TextTool}">
        <Viewbox Height="{Binding Height}" Width="{Binding Width}">
        <Border x:Name="player_border_part" BorderThickness="0.5" BorderBrush="{x:Null}" >
            <TextBlock Text="{Binding Text}" Foreground="{Binding Foreground}" FontSize="{Binding FontSize}" Opacity="{Binding Opacity}"/>
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="PreviewMouseDown" >
                    <i:InvokeCommandAction Command="{Binding PreviewMouseDownCommand}" CommandParameter="{Binding}"/>
                </i:EventTrigger>
                <i:EventTrigger EventName="PreviewMouseUp" >
                    <i:InvokeCommandAction Command="{Binding PreviewMouseUpCommand}" CommandParameter="{Binding}"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Border>
        </Viewbox>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding EditorOptions.Mode}" Value="{x:Static common:GeneralMode.Editor}">
                <Setter TargetName="player_border_part" Property="BorderBrush" Value="#FFE5FF8C" />
                <Setter TargetName="player_border_part" Property="Background" Value="#6BD3D311" />
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
    <SolidColorBrush x:Key="Line.Default" Color="White"/>
    <SolidColorBrush x:Key="Line.MouseOver" Color="Violet"/>
   
    <DataTemplate DataType="{x:Type markers:ControlPointViewModel}" x:Shared="false">
        <Rectangle Stroke="Violet" StrokeThickness="0.8" Fill="#00000000" Height="10" Width="10" Margin="{Binding Point, Converter={markers_converters:PointToMarginConverter}}">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseDown">
                    <i:InvokeCommandAction Command="{Binding MouseDown}"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Rectangle>
    </DataTemplate>
    <DataTemplate DataType="{x:Type markers:PointMarkerViewModel}" x:Shared="false" >
        <Ellipse Stroke="AliceBlue" Fill="#00000000" Height="10" Width="10" Margin="{Binding Point, Converter={markers_converters:PointToMarginConverter}}">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseDown">
                    <i:InvokeCommandAction Command="{Binding MouseDown}"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Ellipse>
    </DataTemplate>
    <DataTemplate DataType="{x:Type markers:SubLineViewModel}" x:Shared="false">
        <Line Stroke="Cyan" StrokeThickness="0.6"
                  X1="{Binding Point.X}"
                  Y1="{Binding Point.Y}"
                  X2="{Binding EndPoint.X}"
                  Y2="{Binding EndPoint.Y}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type draw:SelectedLineSegmentViewModel}" x:Shared="false">
        <Path x:Name="selectedLine" Stroke="Wheat" StrokeThickness="4.0">
            <Path.Data>
                <PathGeometry>
                    <PathFigure StartPoint="{Binding Point}">
                        <BezierSegment Point1="{Binding ControlPoint1}"
                                           Point2="{Binding ControlPoint2}"
                                           Point3="{Binding EndPoint}"/>
                    </PathFigure>
                </PathGeometry>
            </Path.Data>
        </Path>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding IsDashed}" Value="True">
                <Setter TargetName="selectedLine" Property="StrokeDashArray" Value="8 5"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
    <DataTemplate DataType="{x:Type local:Arrow}" x:Shared="False">
        <Grid>
            <Path x:Name="arrowLine"
                  Data="{Binding Geometry}"
                  Opacity="{Binding Opacity}"
                  Stroke="{Binding Color}">
                <Path.Style>
                    <Style TargetType="Path">
                        <Setter Property="StrokeThickness" Value="4.0" />
                        <Setter Property="StrokeDashCap" Value="Round"/>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Stroke" Value="{StaticResource Line.MouseOver}" />
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Path.Style>
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseDown">
                        <i:InvokeCommandAction Command="{Binding CurrentSelect_Command}" CommandParameter="{Binding}"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Path>
            <Path x:Name="arrowHead"
                  Data="{Binding ArrowHeadGeometry}"
                  Opacity="{Binding Opacity}"
                  Stroke="{Binding Color}">
                <Path.Style>
                    <Style TargetType="Path">
                        <Setter Property="StrokeThickness" Value="4.0" />
                        <Setter Property="Fill" Value="{StaticResource Line.Default}" />
                    </Style>
                </Path.Style>
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseDown">
                        <i:InvokeCommandAction Command="{Binding CurrentSelect_Command}" CommandParameter="{Binding}"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Path>
        </Grid>
        <DataTemplate.Triggers>
            <Trigger SourceName="arrowLine" Property="IsMouseOver" Value="true">
                <Setter TargetName="arrowLine" Property="Stroke" Value="{StaticResource Line.MouseOver}" />
                <Setter TargetName="arrowHead" Property="Stroke" Value="{StaticResource Line.MouseOver}" />
            </Trigger>
            <DataTrigger Binding="{Binding IsDashed}" Value="True">
                <Setter TargetName="arrowLine" Property="StrokeDashArray" Value="8 5"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\EndScenario.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public class EndScenario : NotifyBase, ITool
    {
        public string ID
        {
            get { return _model.ID; }
            set { _model.ID = value; }
        }
        public string Component_Name { get; set; } = nameof(EndScenario);
        public string Description { get; set; } = "Конец сценария";
        public Brush Brush { get; set; } = Brushes.Black;
        public FrameworkElement AssociatedObject { get; set; }

        private readonly SegmentScenarioModel _model;
        private readonly IToolsManager _toolsManager;
        public EndScenario()
        {

        }

        public EndScenario(SegmentScenarioModel model, IToolsManager toolsManager)
        {
            _toolsManager = toolsManager;
            _model = model;
        }
        public void Start()
        {
            _toolsManager.CallEndScenario();
        }

        public void Stop()
        {
            
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\IBaseElement.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public interface IBaseElement
    {
        event EventHandler<IBaseElement> PreviewMouseDown;
        event EventHandler<IBaseElement> PreviewMouseUp;
        double X { get; set; }
        double Y { get; set; }
        double Width { get; set; }
        double Height { get; set; }
        RelayCommand PreviewMouseDownCommand { get; }
        RelayCommand PreviewMouseUpCommand { get; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\IColor.cs

using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public interface IColor
    {
        Brush Color { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\IContextMenuCommands.cs

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    internal interface IContextMenuCommands
    {
    }
}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\IMedia.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public interface IMedia
    {
        string Source { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\IStopper.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public interface IStopper
    {
        event EventHandler<IStopper> WaitingAction;
        void Resume();
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\IText.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public interface IText
    {
        Brush Foreground { get; set; }
        double FontSize { get; set; }
        string Text { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ITool.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public interface ITool
    {
        string ID { get; set; }
        string Component_Name { get; set; }
        string Description { get; set; }
        Brush Brush { get; set; }
        FrameworkElement AssociatedObject { get; set; }
        void Start();
        void Stop();
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\IToolSelector.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public interface IToolSelector
    {
        ITool SelectedTool { get; set; }
        event EventHandler<ITool> SelectingTool;
        void SelectTool(object sender, ITool tool);
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\MediaPlayer.cs

using Microsoft.Win32;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public class MediaPlayer: NotifyBase, ITool, IBaseElement
    {
        public event EventHandler<IBaseElement> PreviewMouseDown;
        public event EventHandler<IBaseElement> PreviewMouseUp;
        public Brush Brush { get; set; } = Brushes.Blue;
        public string Component_Name { get; set; } = nameof(MediaPlayer);
        public string Description { get; set; } = "Видео";

        public Uri Source
        {
            get
            {
                if (_model.Source != null)
                    return new Uri(@_model.Source, UriKind.Relative);
                return null;
            }
            set
            {
                _model.Source = value.OriginalString;
                PlayerElement.Source = new Uri(_model.Source, UriKind.Relative);
                OnPropertyChanged();
            }
        }

        private MediaPlayerState _state;
        public MediaPlayerState State
        {
            get { return _state; }
            set 
            { 
                _state = value;
                var state = _state;
                if (state == MediaPlayerState.Stop)
                    Stop();
                else if (state == MediaPlayerState.Play)
                    Start();
                OnPropertyChanged();
            }
        }

        public FrameworkElement AssociatedObject { get; set; }

        public MediaElement PlayerElement { get; set; }
        public double X
        {
            get { return _model.Position.X; }
            set
            {
                var newPoint = new Point(value, Y);
                _model.Position = newPoint;
                OnPropertyChanged();
            }
        }
        public double Y
        {
            get { return _model.Position.Y; }
            set
            {
                var newPoint = new Point(X, value);
                _model.Position = newPoint;
                OnPropertyChanged();
            }
        }

        public double Width
        {
            get { return _model.Width; }
            set
            {
                if (value > 0)
                    _model.Width = value;
                OnPropertyChanged();
            }
        }
        public double Height 
        {
            get { return _model.Height; }
            set 
            {
                if (value > 0)
                    _model.Height = value;
                OnPropertyChanged();
            }
        }
        public string ID
        {
            get { return _model.ID; }
            set { _model.ID = value; }
        }

        private double _opacity = 0.0;

        public double Opacity
        {
            get { return _opacity; }
            set 
            {
                _opacity = value;
                OnPropertyChanged();
            }
        }

        public EditorOptions EditorOptions { get; set; }
        public RelayCommand PreviewMouseDownCommand => new RelayCommand(obj =>
        {
            if (obj is IBaseElement element)
                PreviewMouseDown?.Invoke(this, element);
        });
        public RelayCommand PreviewMouseUpCommand => new RelayCommand(obj =>
        {
            if (obj is IBaseElement element)
                    PreviewMouseUp?.Invoke(this, element);
        });

        public MediaPlayer()
        {
            EditorOptions = SingleEditorOptions.GetOptions();
            PlayerElement = new MediaElement();
            PlayerElement.LoadedBehavior = MediaState.Manual;
        }

        private readonly MediaSegmentScenarioModel _model;
        public MediaPlayer(MediaSegmentScenarioModel model)
        {
            _model = model;
            EditorOptions = SingleEditorOptions.GetOptions();
            PlayerElement = new MediaElement();
            PlayerElement.LoadedBehavior = MediaState.Manual;
            PlayerElement.Source = Source;
            PlayerElement.MediaOpened += PlayerElement_MediaOpened;
            PlayerElement.Play();
        }

        private bool _fileOpen = false;
        private void PlayerElement_MediaOpened(object sender, RoutedEventArgs e)
        {
            PlayerElement.Pause();
            PlayerElement.Position = TimeSpan.FromMilliseconds(250);
            _fileOpen = true;
        }

        public void Start()
        {
            if (_fileOpen)
            {
                Opacity = 1.0;
                //PlayerElement.Source = Source;
                //PlayerElement.Position = TimeSpan.FromSeconds(0);
                PlayerElement.Play();
            }
        }

        public void Stop()
        {
            Opacity = 0.0;
            PlayerElement.Stop();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\MediaPlayerState.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public enum MediaPlayerState
    {
        Play,
        Stop
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ScenarioStopAndWait.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Threading;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public class ScenarioStopAndWait : ITool, IStopper
    {
        public event EventHandler<IStopper> WaitingAction;
        public string ID
        {
            get { return _model.ID; }
            set { _model.ID = value; }
        }
        public string Component_Name { get; set; } = nameof(ScenarioStopAndWait);
        public string Description { get; set; } = "Ожидание внешней активности";
        public Brush Brush { get; set; } = Brushes.DarkOrchid;
        public FrameworkElement AssociatedObject { get; set; }

        private readonly SegmentScenarioModel _model;
        public ScenarioStopAndWait()
        {

        }

        private readonly IToolsManager _toolsManager;
        public ScenarioStopAndWait(SegmentScenarioModel model, IToolsManager toolsManager)
        {
            _model = model;
            _toolsManager = toolsManager;
        }

        public void Start()
        {
            if (_toolsManager.RootTimer != null)
            {
                _toolsManager.RootTimer.Stop();
                WaitingAction?.Invoke(this, this);
            }
        }

        public void Resume()
        {
            if (_toolsManager.RootTimer != null)
                _toolsManager.RootTimer.Start();
        }

        public void Stop()
        {
            if (_toolsManager.RootTimer != null)
                _toolsManager.RootTimer.Stop();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\SoundPlayer.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using Microsoft.Win32;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public class SoundPlayer : NotifyBase, ITool, IDisposable
    {
        public Brush Brush { get; set; } = Brushes.Cyan;

        [DllImport("winmm.dll")]
        private static extern long mciSendString(string lpstrCommand, StringBuilder lpstrReturnString, int uReturnLength, int hwdCallBack);

        public string Source
        {
            get { return _model.Source; }
            set
            {
                _model.Source = value;
                OnPropertyChanged();
            }
        }

        public string Component_Name { get; set; } = nameof(SoundPlayer);
        public string Description { get; set; } = "Звук";
        public FrameworkElement AssociatedObject { get; set; }
        public string ID
        {
            get { return _model.ID; }
            set { _model.ID = value; }
        }
        public SoundPlayer()
        {
           
        }
        private readonly MediaSegmentScenarioModel _model;
        public SoundPlayer(MediaSegmentScenarioModel model)
        {
            _model = model;
        }

        public void Start()
        {
             open(Source);
             play();
        }

        public void Stop()
        {
             stop();
        }

        public async Task<long> openAsync(string File)
        {
            string Format = @"open ""{0}"" type MPEGVideo alias MediaFile";
            string command = string.Format(Format, File);
            return await Task.Run(() =>
            {
                return mciSendString(command, null, 0, 0);
            });
        }

        private async Task<long> playAsync()
        {
            string command = "play MediaFile";
            return await Task.Run(() =>
            {
                return mciSendString(command, null, 0, 0);
            });
        }

        private async Task<long> stopAsync()
        {
            string command = "stop MediaFile";
            return await Task.Run(() =>
            {
                return mciSendString(command, null, 0, 0);
            });
        }

       

        public void open(string File)
        {
            string Format = @"open ""{0}"" type MPEGVideo alias MediaFile";
            string command = string.Format(Format, File);
            mciSendString(command, null, 0, 0);
        }

        private void play()
        {
            string command = "play MediaFile";
            mciSendString(command, null, 0, 0);
        }

        private void stop()
        {
            string command = "stop MediaFile";
            mciSendString(command, null, 0, 0);
            close();
        }

        private void close()
        {
            string sCommand = "close MediaFile";
            mciSendString(sCommand, null, 0, 0);
        }

        public void Dispose()
        {
            stop();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\TextTool.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components
{
    public class TextTool : NotifyBase, ITool, IBaseElement
    {
        public event EventHandler<IBaseElement> PreviewMouseDown;
        public event EventHandler<IBaseElement> PreviewMouseUp;
        public string Component_Name { get; set; } = nameof(TextTool);
        public string Description { get; set; } = "Текст";
        public Brush Brush { get; set; } = Brushes.Yellow;
        public FrameworkElement AssociatedObject { get; set; }
        public double X
        {
            get { return _model.Position.X; }
            set
            {
                var newPoint = new Point(value, Y);
                _model.Position = newPoint;
                OnPropertyChanged();
            }
        }
        public double Y
        {
            get { return _model.Position.Y; }
            set
            {
                var newPoint = new Point(X, value);
                _model.Position = newPoint;
                OnPropertyChanged();
            }
        }

        public string ID
        {
            get { return _model.ID; }
            set { _model.ID = value; }
        }

        public double Width
        {
            get { return _model.Width; }
            set
            {
                if (value > 0)
                    _model.Width = value;
                OnPropertyChanged();
            }
        }
        public double Height
        {
            get { return _model.Height; }
            set
            {
                if (value > 0)
                    _model.Height = value;
                OnPropertyChanged();
            }
        }

        public Brush Foreground
        {
            get { return _model.Foreground; }
            set
            {
                _model.Foreground = value;
                OnPropertyChanged();
            }
        }

        public double FontSize
        {
            get { return _model.FontSize; }
            set
            {
                _model.FontSize = value;
                OnPropertyChanged();
            }
        }

        public string Text
        {
            get { return _model.Text; }
            set
            {
                _model.Text = value;
                OnPropertyChanged();
            }
        }

        public RelayCommand PreviewMouseDownCommand => new RelayCommand(obj =>
        {
            if (obj is IBaseElement element)
                PreviewMouseDown?.Invoke(this, element);
        });
        public RelayCommand PreviewMouseUpCommand => new RelayCommand(obj =>
        {
            if (obj is IBaseElement element)
                PreviewMouseUp?.Invoke(this, element);
        });

        private double _opacity = 0.0;

        public double Opacity
        {
            get { return _opacity; }
            set
            {
                _opacity = value;
                OnPropertyChanged();
            }
        }

        public EditorOptions EditorOptions { get; set; }

        public TextTool()
        {
            EditorOptions = SingleEditorOptions.GetOptions();
            Opacity = 0.0;
        }

        private readonly TextSegmentScenarioModel _model;
        public TextTool(TextSegmentScenarioModel model)
        {
            _model = model;
            EditorOptions = SingleEditorOptions.GetOptions();
            Opacity = 0.0;
        }

        public void Start()
        {
            Opacity = 1.0;
        }

        public void Stop()
        {
            Opacity = 0.0;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\CustomBrushes\ArrowBrush.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.CustomBrushes
{
    public class ArrowBrush
    {
        public static Brush GetBrush()
        {
            var rect = new RectangleGeometry(new Rect(new Size(30, 20)));

            GeometryDrawing rectDrawing = new GeometryDrawing(
                Brushes.Blue,
                null,
                rect
                );


            var line1 = new LineGeometry(new Point(5, 10), new Point(25, 10));
            GeometryDrawing arrowDrawing = new GeometryDrawing(
               Brushes.White,
               new Pen(Brushes.White, 3),
               line1
               );

            GeometryGroup arrowHeadGroup = new GeometryGroup();
            
            var line2 = new LineGeometry(new Point(25, 10), new Point(20, 5));
            var line3 = new LineGeometry(new Point(25, 10), new Point(20, 15));
            arrowHeadGroup.Children.Add(line2);
            arrowHeadGroup.Children.Add(line3);

            GeometryDrawing arrowHeadDrawing = new GeometryDrawing(
                Brushes.White,
                new Pen(Brushes.White, 2),
                arrowHeadGroup
                );

            DrawingGroup drawingGroup = new DrawingGroup();
            drawingGroup.Children.Add(rectDrawing);
            drawingGroup.Children.Add(arrowDrawing);
            drawingGroup.Children.Add(arrowHeadDrawing);

            DrawingBrush brush = new DrawingBrush(drawingGroup)
            {
                Stretch = Stretch.None,
                AlignmentX = AlignmentX.Center,
                AlignmentY = AlignmentY.Center,
                ViewportUnits = BrushMappingMode.Absolute,
                Viewport = new Rect(0, 0, 30, 20),
                TileMode = TileMode.Tile,
            };
            
            brush.Freeze();

            return brush;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\CustomBrushes\SlashedBrush.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.CustomBrushes
{
    public class SlashedBrush
    {
        public static Brush GetBrush()
        {
            GeometryDrawing rectDrawing = new GeometryDrawing(
                Brushes.Blue,
                null,
                new RectangleGeometry(new Rect(0, 0, 15, 20)
                ));

            GeometryDrawing lineDrawing = new GeometryDrawing(
                null,
                new Pen(Brushes.Yellow, 5),
                new LineGeometry(new Point(5,20), new Point(10,0)
                ));

            DrawingGroup drawingGroup = new DrawingGroup();
            drawingGroup.Children.Add(rectDrawing);
            drawingGroup.Children.Add(lineDrawing);

            DrawingBrush brush = new DrawingBrush(drawingGroup)
            {
                Stretch = Stretch.None,
                AlignmentX = AlignmentX.Left,
                AlignmentY = AlignmentY.Top,
                ViewportUnits = BrushMappingMode.Absolute,
                Viewport = new Rect(0, 0, 15, 20),
                TileMode = TileMode.Tile,
            };
            brush.Freeze();

            return brush;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\ArrowPropertiesViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor
{
    public class ArrowPropertiesViewModel : NotifyBase
    {
        public bool IsYes
        {
            get { return this.DashedState == DashedState.Yes; }
            set { this.DashedState = value ? DashedState.Yes : DashedState; }
        }

        public bool IsNo
        {
            get { return this.DashedState == DashedState.No; }
            set { this.DashedState = value ? DashedState.No : DashedState; }
        }

        public Brush Stroke
        {
            get { return _arrow.Color; }
            set 
            {
                _arrow.Color = value;
                OnPropertyChanged();
            }
        }

        public DashedState DashedState
        {
            get
            {
                if (_arrow.IsDashed)
                    return DashedState.Yes;
                return DashedState.No;
            }
            set
            {
                _arrow.IsDashed = value == DashedState.Yes;
                OnPropertyChanged("IsDashed");
                OnPropertyChanged("IsYes");
                OnPropertyChanged("IsNo");
            }
        }

        private readonly Arrow _arrow;
        public ArrowPropertiesViewModel(Arrow arrow)
        {
            _arrow = arrow;
        }
    }

    public enum DashedState
    {
        Yes,
        No
    }


}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\CallingMethodByTimerPropertiesViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor
{
    public class CallingMethodByTimerPropertiesViewModel : NotifyBase 
    {
        public List<string> MethodNames
        {
            get { return _toolsManager.UsedMethods.Keys.ToList(); }
        }

        public TimeSpan TimerInterval
        {
            get 
            { 
                return _callingMethodByTimer.TimerInterval;
            }
            set 
            {
                _callingMethodByTimer.TimerInterval = value;
                OnPropertyChanged();
            }
        }

        public string MethodName
        {
            get => !string.IsNullOrEmpty(_callingMethodByTimer.MethodName) && !string.IsNullOrWhiteSpace(_callingMethodByTimer.MethodName)
                    ? _callingMethodByTimer.MethodName
                    : "Нажмите для выбора файла";
            set
            {
                _callingMethodByTimer.MethodName = value;
                OnPropertyChanged();
            }
        }

        private readonly IToolsManager _toolsManager;
        private readonly CallingMehtodByTimer _callingMethodByTimer;
        public CallingMethodByTimerPropertiesViewModel(CallingMehtodByTimer callingMethodByTimer, IToolsManager toolsManager)
        {
            _toolsManager = toolsManager;
            _callingMethodByTimer = callingMethodByTimer;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\CallingMethodPropertiesViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor
{
    public class CallingMethodPropertiesViewModel : NotifyBase
    {
        public List<string> MethodNames
        {
            get { return _toolsManager.UsedMethods.Keys.ToList(); }
        }

        public string MethodName
        {
            get => !string.IsNullOrEmpty(_callingMethod.MethodName) && !string.IsNullOrWhiteSpace(_callingMethod.MethodName)
                    ? _callingMethod.MethodName
                    : "Нажмите для выбора файла";
            set
            {
                _callingMethod.MethodName = value;
                OnPropertyChanged();
            }
        }

        private readonly IToolsManager _toolsManager;
        private readonly CallingMethod _callingMethod;
        public CallingMethodPropertiesViewModel(CallingMethod callingMethod, IToolsManager toolsManager)
        {
            _toolsManager = toolsManager;
            _callingMethod = callingMethod;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\ColorAnimationPropertiesViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor
{
    public class ColorAnimationPropertiesViewModel : NotifyBase
    {
        public Brush Color
        {
            get { return _colorAnimanion.Color; }
            set
            {
                _colorAnimanion.Color = value;
                OnPropertyChanged();
            }
        }

        private readonly ColorAnimation _colorAnimanion;
        public ColorAnimationPropertiesViewModel(ColorAnimation colorAnimanion)
        {
            _colorAnimanion = colorAnimanion;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\ColorChangerPropertiesViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor
{
    public class ColorChangerPropertiesViewModel : NotifyBase
    {
        public Brush Color
        {
            get { return _colorChanger.Color; }
            set
            {
                _colorChanger.Color = value;
                OnPropertyChanged();
            }
        }

        private readonly ColorChanger _colorChanger;
        public ColorChangerPropertiesViewModel(ColorChanger colorChanger)
        {
            _colorChanger = colorChanger;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\EditToolProperties.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor.EditToolProperties"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Updk7.Tests.Wpf;component/Source/Psychophysical/LearningTasksExtension/Components/ToolsEditor/Resources.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <ContentPresenter Content="{Binding}"/>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\EditToolProperties.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor
{
    public partial class EditToolProperties : UserControl
    {
        public EditToolProperties()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\MediaPlayerPropertiesViewModel.cs

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor
{
    public class MediaPlayerPropertiesViewModel : NotifyBase
    {
        public string Source
        {
            get
            {
                if (player.Source != null)
                    return player.Source.OriginalString;
                else return "Нажмите для выбора файла";
            }
            set
            {
                player.Source = new Uri($@"{ value }", UriKind.Relative);
                OnPropertyChanged();
            }
        }

        private readonly MediaPlayer player;

        public MediaPlayerPropertiesViewModel(MediaPlayer mediaPlayer)
        {
            player = mediaPlayer;
        }

        public RelayCommand SourceChangingCommand => new RelayCommand(obj =>
        {
            var destinationPath = @"Media\Video";
            string CombinedPath = @Path.Combine(Directory.GetCurrentDirectory(), $@"{destinationPath}");
            var filePath = IOService.ShowOpenFileDialog(CombinedPath);
            if (!string.IsNullOrWhiteSpace(filePath) && !string.IsNullOrEmpty(filePath))
            {
                var fileName = Path.GetFileName(filePath);
                var newRelativePath = $@"{destinationPath}\{fileName}";

                var currrentDirectory = Directory.GetCurrentDirectory();
                var mediaVIdeoDirectory = $"{ currrentDirectory }\\Media\\Video";
                var isExistCatalog = Directory.Exists(mediaVIdeoDirectory);
                if (!isExistCatalog)
                    Directory.CreateDirectory(mediaVIdeoDirectory);

                try
                {
                    File.Copy(filePath, newRelativePath);
                }
                catch (IOException ex)
                {

                }
                Source = newRelativePath;
            }
        });
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\Resources.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor"
                    xmlns:brushSelector="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor.BrushSelector" xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Source.Psychophysical.LearningTasksExtension.Components.ToolsEditor.Converters">
    <DataTemplate DataType="{x:Type local:MediaPlayerPropertiesViewModel}">
        <Border Background="#FF3D4757" MinWidth="350" MinHeight="150">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock Text="Файл" Foreground="#FFB2D0FF" Margin="5" VerticalAlignment="Center"/>
                <TextBlock Text="{Binding Source}" Grid.Column="1" Background="#FF5F7291" Margin="5" Foreground="#FFB2D0FF" Padding="3">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseDown">
                        <i:InvokeCommandAction Command="{Binding SourceChangingCommand}"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                </TextBlock>
            </Grid>
        </Border>
    </DataTemplate>

    <Style TargetType="ComboBox" x:Key="BrushSelector">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <UniformGrid Background="Black"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="ItemTemplate">
            <Setter.Value>
                <DataTemplate DataType="{x:Type SolidColorBrush}">
                    <Rectangle Width="18" Height="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Width}" Margin="2" Fill="{Binding}"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="ComboBox" x:Key="BrushesSelector" BasedOn="{StaticResource BrushSelector}">
        <Setter Property="ItemsSource" Value="{x:Static brushSelector:BrushesToList.Brushes}"/>
    </Style>

    <DataTemplate DataType="{x:Type local:TextToolPropertiesViewModel}">
        <Border Background="#FF3D4757" MinWidth="350" MinHeight="150">
            <Grid TextBlock.Foreground="#FFB2D0FF">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock Text="Текст" Margin="5" VerticalAlignment="Center"/>
                <TextBox Text="{Binding Text, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Background="#FF5F7291" Margin="5" Width="150" Padding="3"/>

                <TextBlock Grid.Row="1" Text="Размер шрифта" Margin="5" VerticalAlignment="Center"/>
                <Slider Grid.Row="1" Grid.Column="1" Minimum="10" Maximum="72" Value="{Binding FontSize, UpdateSourceTrigger=PropertyChanged}" Width="150" Margin="5"/>

                <TextBlock Grid.Row="2" Text="Цвет текста" Margin="5" VerticalAlignment="Center"/>
                <ComboBox Grid.Row="2" Grid.Column="1" Name="BrushSel" VerticalAlignment="Center" Style="{StaticResource BrushesSelector}" SelectedValue="{Binding Foreground,UpdateSourceTrigger=PropertyChanged}"/>
            </Grid>
        </Border>
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:SoundPlayerPropertiesViewModel}">
        <Border Background="#FF3D4757" MinWidth="350" MinHeight="150">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock Text="Файл" Foreground="#FFB2D0FF" Margin="5" VerticalAlignment="Center"/>
                <TextBlock Text="{Binding Source}" Grid.Column="1" Background="#FF5F7291" Margin="5" Foreground="#FFB2D0FF" Padding="3">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseDown">
                        <i:InvokeCommandAction Command="{Binding SourceChangingCommand}"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                </TextBlock>
            </Grid>
        </Border>
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:ColorChangerPropertiesViewModel}">
        <Border Background="#FF3D4757" MinWidth="350" MinHeight="150">
            <Grid TextBlock.Foreground="#FFB2D0FF">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock Text="Цвет" Margin="5" VerticalAlignment="Center"/>
                <ComboBox Grid.Column="1"
                          Name="BrushSel"
                          VerticalAlignment="Center"
                          Style="{StaticResource BrushesSelector}"
                          SelectedValue="{Binding Color, UpdateSourceTrigger=PropertyChanged}"/>
            </Grid>
        </Border>
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:ColorAnimationPropertiesViewModel}">
        <Border Background="#FF3D4757" MinWidth="350" MinHeight="150">
            <Grid TextBlock.Foreground="#FFB2D0FF">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock Text="Цвет" Margin="5" VerticalAlignment="Center"/>
                <ComboBox Grid.Column="1"
                          Name="BrushSel"
                          VerticalAlignment="Center"
                          Style="{StaticResource BrushesSelector}"
                          SelectedValue="{Binding Color, UpdateSourceTrigger=PropertyChanged}"/>
            </Grid>
        </Border>
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:CallingMethodPropertiesViewModel}">
        <Border Background="#FF3D4757" MinWidth="350" MinHeight="150">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock Text="Активность" Foreground="#FFB2D0FF" Margin="5" VerticalAlignment="Center"/>
                <ComboBox ItemsSource="{Binding MethodNames}" Grid.Column="1" SelectedValue="{Binding MethodName, UpdateSourceTrigger=PropertyChanged}"/>
            </Grid>
        </Border>
    </DataTemplate>

    <DataTemplate DataType="{x:Type local:CallingMethodByTimerPropertiesViewModel}">
        <Border Background="#FF3D4757" MinWidth="350" MinHeight="150">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock Text="Активность" Foreground="#FFB2D0FF" Margin="5" VerticalAlignment="Center"/>
                <ComboBox ItemsSource="{Binding MethodNames}" Grid.Column="1" SelectedValue="{Binding MethodName, UpdateSourceTrigger=PropertyChanged}"/>

                <TextBlock Grid.Row="1" Text="Интервал вызова метода" Foreground="#FFB2D0FF" Margin="5" VerticalAlignment="Center"/>
                <Grid Grid.Row="1" Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Text="{Binding TimerInterval, Converter={converters:DoubleToTimeSpan_MillisecondsConverter}}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    <Slider Grid.Row="1" Minimum="50" Maximum="500" Value="{Binding TimerInterval, UpdateSourceTrigger=PropertyChanged, Converter={converters:DoubleToTimeSpan_MillisecondsConverter}}" Width="150" Margin="5"/>
                </Grid>
            </Grid>
        </Border>
    </DataTemplate>
    <DataTemplate DataType="{x:Type local:ArrowPropertiesViewModel}">
        <Border Background="#FF3D4757" MinWidth="350" MinHeight="150">
            <Grid TextBlock.Foreground="#FFB2D0FF">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock Grid.Row="0"
                           Text="Цвет"
                           Margin="5"
                           VerticalAlignment="Center"/>
                <ComboBox Grid.Row="0"
                          Grid.Column="1"
                          Name="BrushSel" 
                          VerticalAlignment="Center"
                          Style="{StaticResource BrushesSelector}" 
                          SelectedValue="{Binding Stroke,UpdateSourceTrigger=PropertyChanged}"/>
               
                <TextBlock
                    Grid.Row="1"
                    Text="Пунктирная"
                    Margin="5"
                    VerticalAlignment="Center"/>
                <Grid 
                    Grid.Row="1" 
                    Grid.Column="1"
                    Margin="5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <RadioButton Content="Да" GroupName="selectDashed" Grid.Column="0" IsChecked="{Binding IsYes}"/>
                    <RadioButton Content="Нет" GroupName="selectDashed" Grid.Column="1" IsChecked="{Binding IsNo}"/>
                </Grid>
            </Grid>
        </Border>
    </DataTemplate>
</ResourceDictionary>


*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\SoundPlayerPropertiesViewModel.cs

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor
{
    public class SoundPlayerPropertiesViewModel : NotifyBase
    {
        public string Source
        {
            get
            {
                if (!string.IsNullOrEmpty(player.Source)&&!string.IsNullOrWhiteSpace(player.Source))
                    return player.Source;
                else return "Нажмите для выбора файла";
            }
            set
            {
                player.Source = value;
                OnPropertyChanged();
            }
        }

        private readonly SoundPlayer player;

        public SoundPlayerPropertiesViewModel(SoundPlayer soundPlayer)
        {
            player = soundPlayer;
        }

        public RelayCommand SourceChangingCommand => new RelayCommand(obj =>
        {
            Uri uri = new Uri(@"Media\Audio", UriKind.Relative);
            string destinationPath = uri.OriginalString;
            string CombinedPath = @Path.Combine(Directory.GetCurrentDirectory(), $@"{destinationPath}");
            var filePath = IOService.ShowOpenFileDialog(CombinedPath);
            if (!string.IsNullOrWhiteSpace(filePath) && !string.IsNullOrEmpty(filePath))
            {
                var fileName = Path.GetFileName(filePath);
                var newRelativePath = $@"{destinationPath}/{fileName}";
                try
                {
                    File.Copy(filePath, newRelativePath);
                }
                catch (IOException ex)
                {

                }
                Source = newRelativePath;
            }
        });
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\TextToolPropertiesViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor
{
    public class TextToolPropertiesViewModel : NotifyBase
    {
        public string Text
        {
            get { return textTool.Text; }
            set 
            {
                textTool.Text = value;
                OnPropertyChanged();
            }
        }

        public double FontSize
        {
            get { return textTool.FontSize; }
            set 
            {
                textTool.FontSize = value;
                OnPropertyChanged(); 
            }
        }

        public Brush Foreground
        {
            get { return textTool.Foreground; }
            set 
            {
                textTool.Foreground = value;
                OnPropertyChanged();
            }
        }

        private readonly TextTool textTool;
        public TextToolPropertiesViewModel(TextTool textTool)
        {
            this.textTool = textTool;
        }

    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\BrushSelector\BrushesToList.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor.BrushSelector
{
	public static class BrushesToList
	{
        public static IEnumerable<SolidColorBrush> Brushes { get; private set; }

        static BrushesToList()
		{
			List<SolidColorBrush> brushes = new List<SolidColorBrush>();

			foreach (PropertyInfo propInfo in typeof(System.Windows.Media.Brushes).GetProperties(BindingFlags.Public | BindingFlags.Static))
				if (propInfo.PropertyType == typeof(SolidColorBrush))
					brushes.Add((SolidColorBrush)propInfo.GetValue(null, null));

			Brushes = brushes;
		}
	}
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Components\ToolsEditor\Converters\DoubleToTimeSpan_MillisecondsConverter.cs

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Source.Psychophysical.LearningTasksExtension.Components.ToolsEditor.Converters
{
    public class DoubleToTimeSpan_MillisecondsConverter : MarkupExtension, IValueConverter
    {
        private DoubleToTimeSpan_MillisecondsConverter _converter;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var time = (TimeSpan)value;
            return time;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var time = (double)value;
            return TimeSpan.FromMilliseconds(time);
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new DoubleToTimeSpan_MillisecondsConverter();
            return _converter;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Converters\NegateBooleanToVisibilityConverter.cs

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Converters
{
    public class NegateBooleanToVisibilityConverter : MarkupExtension, IValueConverter
    {
        private NegateBooleanToVisibilityConverter _converter;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var booLValue = (bool)value;
            if (booLValue)
                return Visibility.Collapsed;
            return Visibility.Visible;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new NegateBooleanToVisibilityConverter();
            return _converter;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Elements\Arrow.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Elements
{
    public class Arrow : Shape
    {
        protected PathGeometry pathgeo;
        protected PathFigure pathfigLine;
        protected PolyLineSegment polysegLine;

        PathFigure pathfigHead1;
        PolyLineSegment polysegHead1;
        PathFigure pathfigHead2;
        PolyLineSegment polysegHead2;

        public static readonly DependencyProperty PointsProperty =
           DependencyProperty.Register("Points",
               typeof(PointCollection), typeof(Arrow),
               new FrameworkPropertyMetadata(null,
                       FrameworkPropertyMetadataOptions.AffectsMeasure));

        public PointCollection Points
        {
            set { SetValue(PointsProperty, value); }
            get { return (PointCollection)GetValue(PointsProperty); }
        }

        public static readonly DependencyProperty ArrowAngleProperty =
            DependencyProperty.Register("ArrowAngle",
                typeof(double), typeof(Arrow),
                new FrameworkPropertyMetadata(45.0,
                        FrameworkPropertyMetadataOptions.AffectsMeasure));

        public double ArrowAngle
        {
            set { SetValue(ArrowAngleProperty, value); }
            get { return (double)GetValue(ArrowAngleProperty); }
        }

        public static readonly DependencyProperty ArrowLengthProperty =
            DependencyProperty.Register("ArrowLength",
                typeof(double), typeof(Arrow),
                new FrameworkPropertyMetadata(12.0,
                        FrameworkPropertyMetadataOptions.AffectsMeasure));

        public double ArrowLength
        {
            set { SetValue(ArrowLengthProperty, value); }
            get { return (double)GetValue(ArrowLengthProperty); }
        }

        public static readonly DependencyProperty ArrowEndsProperty =
            DependencyProperty.Register("ArrowEnds",
                typeof(ArrowEnds), typeof(Arrow),
                new FrameworkPropertyMetadata(ArrowEnds.End,
                        FrameworkPropertyMetadataOptions.AffectsMeasure));

        public ArrowEnds ArrowEnds
        {
            set { SetValue(ArrowEndsProperty, value); }
            get { return (ArrowEnds)GetValue(ArrowEndsProperty); }
        }

        public static readonly DependencyProperty IsArrowClosedProperty =
            DependencyProperty.Register("IsArrowClosed",
                typeof(bool), typeof(Arrow),
                new FrameworkPropertyMetadata(false,
                        FrameworkPropertyMetadataOptions.AffectsMeasure));

        public bool IsArrowClosed
        {
            set { SetValue(IsArrowClosedProperty, value); }
            get { return (bool)GetValue(IsArrowClosedProperty); }
        }

        public Arrow()
        {
            Points = new PointCollection();
            pathgeo = new PathGeometry();

            pathfigLine = new PathFigure();
            polysegLine = new PolyLineSegment();
            pathfigLine.Segments.Add(polysegLine);

            pathfigHead1 = new PathFigure();
            polysegHead1 = new PolyLineSegment();
            pathfigHead1.Segments.Add(polysegHead1);

            pathfigHead2 = new PathFigure();
            polysegHead2 = new PolyLineSegment();
            pathfigHead2.Segments.Add(polysegHead2);
        }

        protected override Geometry DefiningGeometry
        {
            get
            {
                pathgeo.Figures.Clear();

                if (Points.Count > 0)
                {
                    pathfigLine.StartPoint = Points[0];
                    polysegLine.Points.Clear();

                    for (int i = 1; i < Points.Count; i++)
                        polysegLine.Points.Add(Points[i]);

                    pathgeo.Figures.Add(pathfigLine);
                }

                int count = polysegLine.Points.Count;

                if (count > 0)
                {
                    if ((ArrowEnds & ArrowEnds.Start) == ArrowEnds.Start)
                    {
                        Point pt1 = pathfigLine.StartPoint;
                        Point pt2 = polysegLine.Points[0];
                        pathgeo.Figures.Add(CalculateArrow(pathfigHead1, pt2, pt1));
                    }

                    if ((ArrowEnds & ArrowEnds.End) == ArrowEnds.End)
                    {
                        Point pt1 = count == 1 ? pathfigLine.StartPoint :
                                                 polysegLine.Points[count - 2];
                        Point pt2 = polysegLine.Points[count - 1];
                        pathgeo.Figures.Add(CalculateArrow(pathfigHead2, pt1, pt2));
                    }
                }
                return pathgeo;
            }
        }

        PathFigure CalculateArrow(PathFigure pathfig, Point pt1, Point pt2)
        {
            Matrix matx = new Matrix();
            Vector vect = pt1 - pt2;
            vect.Normalize();
            vect *= ArrowLength;

            PolyLineSegment polyseg = pathfig.Segments[0] as PolyLineSegment;
            polyseg.Points.Clear();
            matx.Rotate(ArrowAngle / 2);
            pathfig.StartPoint = pt2 + vect * matx;
            polyseg.Points.Add(pt2);

            matx.Rotate(-ArrowAngle);
            polyseg.Points.Add(pt2 + vect * matx);
            pathfig.IsClosed = IsArrowClosed;

            return pathfig;
        }
    }

    [Flags]
    public enum ArrowEnds
    {
        None = 0,
        Start = 1,
        End = 2,
        Both = 3
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Elements\Thumbler.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Elements.Thumbler"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Elements" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
             mc:Ignorable="d" 
             d:DesignHeight="20" d:DesignWidth="200">
    <UserControl.Resources>
        <Style TargetType="{x:Type local:Thumbler}">
            <Style.Setters>
                <Setter Property="Width" Value="70" />
                <Setter Property="Height" Value="22" />
                <Setter Property="SnapsToDevicePixels" Value="True"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:Thumbler}">
                            <Border x:Name="border_PART_root" CornerRadius="10" Background="#FFE5E5E5" BorderThickness="1">
                                <Border x:Name="brd_PART_thumb" Grid.ColumnSpan="2" Width="33" CornerRadius="10" Height="18" Background="#FF4C4C4C" BorderThickness="1" Margin="0,0,33,0">
                                    <TextBlock x:Name="Tbx_PART_thumb" Grid.Column="0" HorizontalAlignment="Center" Text="ON" Foreground="#FFFEFEFE"/>
                                </Border>
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="MouseDown" >
                                        <i:InvokeCommandAction Command="{Binding MouseDownCommand}"/>
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </Border>
                            <ControlTemplate.Triggers>
                                <DataTrigger Binding="{Binding SwitchPosition}" Value="True">
                                    <Setter TargetName="Tbx_PART_thumb" Property="Text" Value="ON"/>
                                    <Setter TargetName="brd_PART_thumb" Property="Background" Value="#FF549154"/>
                                    <Setter TargetName="brd_PART_thumb" Property="Margin" Value="0,0,33,0"/>
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard x:Name="leftToRightSB">
                                            <Storyboard Storyboard.TargetName="brd_PART_thumb" >
                                                <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin">
                                                    <EasingThicknessKeyFrame KeyTime="0:0:0.1" Value="0,0,33,0"/>
                                                </ThicknessAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <StopStoryboard BeginStoryboardName="leftToRightSB"/>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding SwitchPosition}" Value="False">
                                    <Setter TargetName="Tbx_PART_thumb" Property="Text" Value="OFF"/>
                                    <Setter TargetName="brd_PART_thumb" Property="Background" Value="#FFAE3F3F"/>
                                    <Setter TargetName="brd_PART_thumb" Property="Margin" Value="33,0,0,0"/>
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard x:Name="rigthToLeftSB">
                                            <Storyboard Storyboard.TargetName="brd_PART_thumb" >
                                                <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin">
                                                    <EasingThicknessKeyFrame KeyTime="0:0:0.1" Value="33,0,0,0"/>
                                                </ThicknessAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <StopStoryboard BeginStoryboardName="rigthToLeftSB"/>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style.Setters>
        </Style>
    </UserControl.Resources>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Elements\Thumbler.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Elements
{
    public partial class Thumbler : UserControl
    {
        public Thumbler()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Elements\ThumblerViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Elements
{
    public class ThumblerViewModel : NotifyBase
    {
        public event EventHandler<bool> OnOff;
        private bool _switchPosition;

        public bool SwitchPosition
        {
            get { return _switchPosition; }
            set
            {
                _switchPosition = value;
                OnPropertyChanged();
            }
        }

        public RelayCommand MouseDownCommand => new RelayCommand(obj =>
        {
            SwitchPosition = !SwitchPosition;
            OnOff.Invoke(this, _switchPosition);
        });
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\CanvasPanelView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels.CanvasPanelView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
             xmlns:behaviors="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Behaviors"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Components/ComponentTemplates.xaml"/>
                <ResourceDictionary Source="PanelsResource.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid x:Name="panel_PART_grid">
        <i:Interaction.Behaviors>
            <behaviors:SizeBehavior Proxy="{Binding}"/>
        </i:Interaction.Behaviors>
        <ItemsControl ItemsSource="{Binding ComponentElements}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <Canvas AllowDrop="True" Background="#00000000">
                        <i:Interaction.Behaviors>
                            <behaviors:MouseCaptureBehavior Proxy="{Binding}"/>
                            <behaviors:MouseDropBehavior Proxy="{Binding}"/>
                        </i:Interaction.Behaviors>
                    </Canvas>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemContainerStyle>
                <Style TargetType="ContentPresenter">
                    <Setter Property="Canvas.Left" Value="{Binding X}"/>
                    <Setter Property="Canvas.Top" Value="{Binding Y}"/>
                </Style>
            </ItemsControl.ItemContainerStyle>
        </ItemsControl>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\CanvasPanelView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels
{
    public partial class CanvasPanelView : UserControl
    {
        public CanvasPanelView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\CanvasPanelViewModel.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Behaviors;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.ViewModels;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw.Markers;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels
{
    public class CanvasPanelViewModel : NotifyBase, IMouseCaptureProxy, IDrop, ISize
    {
        public event EventHandler Capture;
        public event EventHandler Release;

        public string Name { get; set; } = "Canvas-Panel";

        private ObservableCollection<IBaseElement> _componentElements = new ObservableCollection<IBaseElement>();
        public ObservableCollection<IBaseElement> ComponentElements
        {
            get { return _componentElements; }
            set
            {
                _componentElements = value;
                OnPropertyChanged();
            }
        }

        private Brush _background;

        public Brush Background
        {
            get { return _background; }
            set { _background = value;
                OnPropertyChanged();
            }
        }

        private Brush _borderBrush;

        public Brush BorderBrush
        {
            get { return _borderBrush; }
            set 
            {
                _borderBrush = value;
                OnPropertyChanged();
            }
        }

        private Thickness _borderThickness;

        public Thickness BorderThickness
        {
            get { return _borderThickness; }
            set 
            { 
                _borderThickness = value;
                OnPropertyChanged();
            }
        }
        private readonly Brush _defaultBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#2F1695FF"));
        private readonly Brush _defaultBorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFF0202"));
        private readonly Thickness _defaultBorderThickness = new Thickness(1);

        public readonly List<ElementScenarioModel> Model;
        public readonly IToolsManager _toolsManager;
        private readonly EditorOptions editorOptions;
        public CanvasPanelViewModel(List<ElementScenarioModel> model, IToolsManager toolsManager)
        {
            _toolsManager = toolsManager;
            editorOptions = SingleEditorOptions.GetOptions();
            editorOptions.PropertyChanged += EditorOptions_PropertyChanged;
            Model = model;
            Initialize();
        }

        private void EditorOptions_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (editorOptions.Mode == Common.GeneralMode.Normal)
            {
                if (_selectedSimpleTool != null)
                {
                    RemoveResizer();
                    _selectedSimpleTool = null;
                    _fromToolElement = false;
                }
                Background = Brushes.Transparent;
                BorderBrush = Brushes.Transparent;
                BorderThickness = new Thickness(0);
                LockElements();
            }
            else if(editorOptions.Mode == Common.GeneralMode.Editor)
            {
                Background = _defaultBackground;
                BorderBrush = _defaultBorderBrush;
                BorderThickness = _defaultBorderThickness;
                UnlockElements();
            }
        }

        private bool _isLock = false;
        private void LockElements() => _isLock = true;
        private void UnlockElements() => _isLock = false;

        private void Initialize()
        {
            _toolsManager.SelectingTool += ToolsManager_SelectingTool;
            for (int i = 0; i < Model.Count; i++)
            {
                foreach (SegmentScenarioModel segment in Model[i].Segments)
                {
                    ITool tool = _toolsManager.GetTool(this, segment);
                    if (tool is IBaseElement toolElement)
                    {
                        ComponentElements.Add(toolElement);
                        toolElement.PreviewMouseDown += ToolElement_PreviewMouseDown;
                        toolElement.PreviewMouseUp += ToolElement_PreviewMouseUp;
                    }
                }
                Model[i].ElementsUpdated += Model_ElementsUpdated;
            }
            editorOptions.OnPropertyChanged(nameof(editorOptions.Mode));
        }

        private void ToolsManager_SelectingTool(object sender, ITool e)
        {
            if (!_isLock)
            {
                if (!(sender is CanvasPanelViewModel))
                {
                    if (sender != this)
                    {
                        if (e is IBaseElement baseElement)
                        {
                            if (_selectedSimpleTool != null)
                            {
                                if (_selectedSimpleTool.Content != baseElement)
                                {
                                    RemoveResizer();
                                    _selectedSimpleTool = null;
                                    AddResizer(baseElement);
                                }
                            }
                            else
                            {
                                RemoveResizer();
                                AddResizer(baseElement);
                            }
                        }
                        else
                        {
                            ClearSelected();
                            RemoveResizer();
                            _selectedSimpleTool = null;
                        }
                    }
                }
            }
        }

        private void Model_ElementsUpdated(object sender, SegmentScenarioEventArgs e)
        {
            switch (e.Mode)
            {
                case Common.Common.Mode.Add:
                    if (e.UpdatedSegmentScenario.IsBase)
                        AddSegment(e.UpdatedSegmentScenario);
                    break;
                case Common.Common.Mode.Remove:
                    RemoveSegment(e.UpdatedSegmentScenario);
                    break;
                case Common.Common.Mode.Update:
                    break;
            }
        }

        public void AddSegment(SegmentScenarioModel model)
        {
            ITool tool = _toolsManager.GetTool(this, model);
            if (tool is IBaseElement toolElement)
            {
                toolElement.PreviewMouseDown += ToolElement_PreviewMouseDown;
                toolElement.PreviewMouseUp += ToolElement_PreviewMouseUp;
                if (tool is ISelectable selectable)
                {
                    selectable.Selected += CurrentFromCollection_Selected;
                }
                ComponentElements.Add(toolElement);
            }
        }

      

        public void RemoveSegment(SegmentScenarioModel model)
        {
            IBaseElement existViewModel = null;
            for (int i = 0; i < ComponentElements.Count; i++)
            {
                if (ComponentElements[i] is ISelectable selectable)
                {
                    existViewModel = ComponentElements[i];
                    selectable.Selected -= CurrentFromCollection_Selected;
                }
                else if (ComponentElements[i] is ITool tool)
                {
                    if (tool.ID == model.ID)
                    {
                        existViewModel = ComponentElements[i];
                        break;
                    }
                }
                else if (ComponentElements[i] is ResizerViewModel resizer)
                {
                    if ((resizer.Content as ITool).ID == model.ID)
                    {
                        existViewModel = ComponentElements[i];
                        RemoveResizer();
                        existViewModel = resizer.Content;
                        _selectedSimpleTool = null;
                    }
                    break;
                }
                
            }
            if (existViewModel != null)
            {
                existViewModel.PreviewMouseDown -= ToolElement_PreviewMouseDown;
                existViewModel.PreviewMouseUp -= ToolElement_PreviewMouseUp;
                if (existViewModel is ResizerViewModel resizer)
                {
                    resizer.DirectionEvent -= CanvasPanelViewModel_DirectionEvent;
                    resizer.PreviewMouseDown -= ToolElement_PreviewMouseDown;
                    resizer.PreviewMouseUp -= ToolElement_PreviewMouseUp;
                }
                else if (existViewModel is ISelectable)
                {
                    ClearSelected(); 
                }
                ComponentElements.Remove(existViewModel);
            }
        }

        private ResizerViewModel _selectedSimpleTool = null;
        private void AddResizer(IBaseElement baseElement)
        {
            _toolsManager.SelectTool(this, baseElement as ITool);
            _selectedSimpleTool = new ResizerViewModel();
            _selectedSimpleTool.DirectionEvent += CanvasPanelViewModel_DirectionEvent;

            ComponentElements.Remove(baseElement);
            _selectedSimpleTool.Content = baseElement;
            ComponentElements.Add(_selectedSimpleTool);
        }

        private Direction _direction;

        /// <summary>
        /// Эвент направления, с какой стороны тянем за маркер изменения размера
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CanvasPanelViewModel_DirectionEvent(object sender, ResizerEventArgs e)
        {
            if (!_isLock)
            {
                _direction = e.Direction;
                _fromToolElement = true;
            }
        }

        private void RemoveResizer()
        {
            if (_selectedSimpleTool != null)
            {
                _selectedSimpleTool.DirectionEvent -= CanvasPanelViewModel_DirectionEvent;
                _selectedSimpleTool.PreviewMouseDown -= ToolElement_PreviewMouseDown;
                _selectedSimpleTool.PreviewMouseUp -= ToolElement_PreviewMouseUp;
                ComponentElements.Remove(_selectedSimpleTool);
                IBaseElement element = _selectedSimpleTool.Content;
                element.PreviewMouseDown += ToolElement_PreviewMouseDown;
                element.PreviewMouseUp += ToolElement_PreviewMouseUp;
                ComponentElements.Add(element);
                _toolsManager.SelectTool(this, null);
            }
        }

        private bool _fromToolElement = false;
        private void ToolElement_PreviewMouseDown(object sender, IBaseElement e)
        {
            if (!_isLock)
            {
                if (_selectedSimpleTool != null && _selectedSimpleTool.Content != e)
                    RemoveResizer();
                if (_selectedSimpleTool == null || _selectedSimpleTool.Content != e)
                    AddResizer(e);
                _fromToolElement = true;
            }
        }
        private void ToolElement_PreviewMouseUp(object sender, IBaseElement e)
        {
            
        }

        public void OnDrop(object sender, DropArgs e)
        {
            if (!_isLock)
            {
                Point position = new Point(e.X, e.Y);

                string _droppedToolName = (string)e.Data.GetData(DataFormats.Text);
                if (_droppedToolName != null)
                {
                    SegmentScenarioModel newModel = ToolsModelFactory.GetToolModel(_droppedToolName);
                    newModel.ToolName = _droppedToolName;
                    newModel.From = TimeSpan.FromSeconds(0);
                    newModel.To = TimeSpan.FromSeconds(10);
                    newModel.Height = 200;
                    newModel.Width = 400;
                    newModel.Position = position;
                    newModel.IsBase = true;
                    newModel.SegmentType = SegmentTypes.Regular;

                    ITool baseTool = _toolsManager.GetTool(this, newModel);
                    newModel.ID = baseTool.ID;
                    if (baseTool is IBaseElement)
                    {
                        ElementScenarioModel subModel = Model.First(f => f.Name == newModel.Type);
                        if (subModel != null)
                        {
                            subModel.AddElementScenario(newModel);
                        }
                    }
                }
            }
        }

        private bool _captured;
        private Point offset;
        public void OnMouseDown(object sender, MouseCaptureArgs e)
        {
            if (!_isLock)
            {
                if (_fromToolElement)
                {
                    if (_selectedSimpleTool != null)
                    {
                        Point currentLeftAngle = new Point(_selectedSimpleTool.X, _selectedSimpleTool.Y);
                        Point point = new Point(e.X, e.Y);
                        offset = new Point(point.X - currentLeftAngle.X, point.Y - currentLeftAngle.Y);
                        _captured = true;
                        Capture?.Invoke(this, new EventArgs());
                    }
                }
                else
                {
                    if (_selectedSimpleTool != null)
                    {
                        RemoveResizer();
                        _selectedSimpleTool = null;
                        _fromToolElement = false;
                    }
                }
            }
        }
        public void OnMouseMove(object sender, MouseCaptureArgs e)
        {
            if (!_isLock)
            {
                if (_selectedSimpleTool != null && _captured)
                {
                    switch (_direction)
                    {
                        case Direction.Unknown:
                            _selectedSimpleTool.X = e.X - offset.X;
                            _selectedSimpleTool.Y = e.Y - offset.Y;
                            break;
                        case Direction.Left:
                            var offsetLeft = _selectedSimpleTool.X - e.X;
                            _selectedSimpleTool.X = e.X;
                            _selectedSimpleTool.Width += offsetLeft;
                            break;
                        case Direction.Right:
                            _selectedSimpleTool.Width = e.X - _selectedSimpleTool.X;
                            break;
                        case Direction.Top:
                            var offsetTop = _selectedSimpleTool.Y - e.Y;
                            _selectedSimpleTool.Y = e.Y;
                            _selectedSimpleTool.Height += offsetTop;
                            break;
                        case Direction.Bottom:
                            _selectedSimpleTool.Height = e.Y - _selectedSimpleTool.Y;
                            break;
                        case Direction.LeftTop:
                            Point offsetLeftTop = new Point(_selectedSimpleTool.X - e.X, _selectedSimpleTool.Y - e.Y);
                            _selectedSimpleTool.X = e.X;
                            _selectedSimpleTool.Width += offsetLeftTop.X;
                            _selectedSimpleTool.Y = e.Y;
                            _selectedSimpleTool.Height += offsetLeftTop.Y;
                            break;
                        case Direction.RightTop:
                            var offsetRightTop = _selectedSimpleTool.Y - e.Y;
                            _selectedSimpleTool.Y = e.Y;
                            _selectedSimpleTool.Height += offsetRightTop;
                            _selectedSimpleTool.Width = e.X - _selectedSimpleTool.X;
                            break;
                        case Direction.LeftBottom:
                            var offsetLeftBottom = _selectedSimpleTool.X - e.X;
                            _selectedSimpleTool.X = e.X;
                            _selectedSimpleTool.Width += offsetLeftBottom;
                            _selectedSimpleTool.Height = e.Y - _selectedSimpleTool.Y;
                            break;
                        case Direction.RightBottom:
                            _selectedSimpleTool.Width = e.X - _selectedSimpleTool.X;
                            _selectedSimpleTool.Height = e.Y - _selectedSimpleTool.Y;
                            break;
                    }
                }
                else if(_selectedObject != null)
                    _selectedObject.Point = new Point(e.X, e.Y);
            }
        }
        public void OnMouseUp(object sender, MouseCaptureArgs e)
        {
            if (!_isLock)
            {
                if (_selectedObject != null)
                {
                    _selectedObject = null;
                }

                _direction = Direction.Unknown;
                _fromToolElement = false;
                _captured = false;
                Release?.Invoke(this, new EventArgs());
            }
        }

        private Size? _baseSize = null;
        public void OnSizeChanged(object sender, SizeChangedEventArgs e)
        {
            _baseSize = e.PreviousSize;
            var newSize = e.NewSize;

            var newWidthManyTimes = newSize.Width / _baseSize.Value.Width;
            var newHeightManyTimes = newSize.Height / _baseSize.Value.Height;

            for (int i = 0; i < ComponentElements.Count; i++)
            {
                IBaseElement element = ComponentElements[i];
                if (element is ISelectable s)
                {
                    if (s is Arrow arrow)
                    {
                        arrow.Point = new Point(arrow.Point.X * newWidthManyTimes, arrow.Point.Y * newHeightManyTimes);
                        arrow.ControlPoint1 = new Point(arrow.ControlPoint1.X * newWidthManyTimes, arrow.ControlPoint1.Y * newHeightManyTimes);
                        arrow.ControlPoint2 = new Point(arrow.ControlPoint2.X * newWidthManyTimes, arrow.ControlPoint2.Y * newHeightManyTimes);
                        arrow.EndPoint = new Point(arrow.EndPoint.X * newWidthManyTimes, arrow.EndPoint.Y * newHeightManyTimes);
                    }
                }
                else
                {
                    element.Height *= newWidthManyTimes;
                    element.Width *= newHeightManyTimes;
                    element.Y *= newWidthManyTimes;
                    element.X *= newHeightManyTimes;
                }
            }
        }

        #region Draw
       
        private ISelectable _selectedObject = null;
        private readonly List<ISelectable> _currentSelectedLineElements = new List<ISelectable>();
        private ISelectable _oldValue = null;
        private void ClearSelected()
        {
            foreach (ISelectable element in _currentSelectedLineElements)
            {
                element.Selected -= CurrentFromCollection_Selected;
                ComponentElements.Remove(element);
            }
            _currentSelectedLineElements.Clear();
            _selectedObject = null;
            _oldValue = null;
        }

        private void CurrentFromCollection_Selected(object sender, EventArgs e)
        {
            if (sender is Arrow line)
            {
                if (line != _oldValue)
                {
                    if (_currentSelectedLineElements.Count != 0)
                    {
                        ClearSelected();
                    }

                    InitializeSelectable(line);

                    foreach (ISelectable selectableElement in _currentSelectedLineElements)
                    {
                        ComponentElements.Add(selectableElement);
                        selectableElement.Selected += CurrentFromCollection_Selected;
                    }
                    line.Opacity = 0.0;
                    _oldValue = line;
                }
            }
            else
            {
                _selectedObject = sender as ISelectable;
            }
        }

        private void InitializeSelectable(Arrow line)
        {
            SelectedLineSegmentViewModel segmentLine = new SelectedLineSegmentViewModel(line);

            ControlPointViewModel controlPoint1 = new ControlPointViewModel(segmentLine,1);
            ControlPointViewModel controlPoint2 = new ControlPointViewModel(segmentLine,2);
            PointMarkerViewModel pointMarkerStart = new PointMarkerViewModel(segmentLine,1);
            PointMarkerViewModel pointMarkerEnd = new PointMarkerViewModel(segmentLine,2);
            SubLineViewModel subline1 = new SubLineViewModel(segmentLine.Point, segmentLine.ControlPoint2);
            SubLineViewModel subline2 = new SubLineViewModel(segmentLine.EndPoint, segmentLine.ControlPoint1);
            _currentSelectedLineElements.Add(segmentLine);
            _currentSelectedLineElements.Add(subline1);
            _currentSelectedLineElements.Add(subline2);
            _currentSelectedLineElements.Add(pointMarkerStart);
            _currentSelectedLineElements.Add(pointMarkerEnd);
            _currentSelectedLineElements.Add(controlPoint1);
            _currentSelectedLineElements.Add(controlPoint2);
        }
        #endregion Draw
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\ComponentTemplateSelector.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels
{
    public class ComponentTemplateSelector:DataTemplateSelector
    {
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            return null;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\DrawMode.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels
{
    public enum DrawMode
    {
        None,
        Select,
        NewLine
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\DrawPanelViewModel.cs

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Behaviors;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw.Markers;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels
{
    //public class DrawPanelViewModel : NotifyBase, IMouseCaptureProxy
    //{
       

    //    private LineViewModel _currentLine = null;
    //    private ISelectable _selectedObject = null;
    //    public void OnMouseDown(object sender, MouseCaptureArgs e)
    //    {
    //        Capture?.Invoke(this, new EventArgs());
    //    }

    //    public void OnMouseMove(object sender, MouseCaptureArgs e)
    //    {
           
    //        if (DrawToolsViewModel.DrawMode == DrawMode.Select && _selectedObject != null)
    //        {
    //            _selectedObject.Point = new RefPoint(e.X, e.Y);
    //        }
    //    }

    //    public void OnMouseUp(object sender, MouseCaptureArgs e)
    //    {
    //        _selectedObject = null;
    //        ISelectable currentFromCollection = ComponentElements.FirstOrDefault(f => f == _currentLine);
    //        if (currentFromCollection != null)
    //            currentFromCollection.Selected += CurrentFromCollection_Selected;
    //    }
    //}
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\IToolsManager.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels
{
    public interface IToolsManager : IToolSelector, IDisposable
    {
        /// <summary>
        /// Methods from control
        /// </summary>
        Dictionary<string, Action> UsedMethods { get; set; }
        DispatcherTimer RootTimer { get; }
        List<ITool> UsedTools { get; set; }
        object CurrentTool { get; set; }
        RelayCommand CloseEditToolPropertiesCommand { get; }
        void ShowCurrentToolOptions(ITool controlComponent);
        event EventHandler<IStopper> WaitiongOuterAction;
        event EventHandler EndScenario;
        event EventHandler<ControlComponentEventArgs> SetSampleTool;
        void CallEndScenario();
        bool RemoveTool(SegmentScenarioModel model);
        ITool GetTool(object caller, SegmentScenarioModel model);
        ITool CreateTool(object caller, SegmentScenarioModel model);
    }

    public class ControlComponentEventArgs : EventArgs
    {
        public ITool Tool { get; set; }
        public object Caller { get; set; }

        public ControlComponentEventArgs(ITool tool, object caller)
        {
            Tool = tool;
            Caller = caller;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\PanelsResource.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels"
                    xmlns:i="http://schemas.microsoft.com/xaml/behaviors">
    <DataTemplate DataType="{x:Type local:ResizerViewModel}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Rectangle Height="{Binding HeightButtonResize}" Width="{Binding WidthButtonResize}" Fill="#19FFD74A" Stroke="#FFFFE070" StrokeThickness="0.8">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseDown">
                        <i:InvokeCommandAction Command="{Binding PreviewMouseDownCommand}" CommandParameter="LeftTop"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Rectangle>
            <Rectangle Grid.Column="1" Height="{Binding HeightButtonResize}" Width="{Binding WidthButtonResize}" Fill="#19FFD74A" Stroke="#FFFFE070" StrokeThickness="0.8">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseDown">
                        <i:InvokeCommandAction Command="{Binding PreviewMouseDownCommand}" CommandParameter="Top"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Rectangle>
            <Rectangle Grid.Column="2" Height="{Binding HeightButtonResize}" Width="{Binding WidthButtonResize}" Fill="#19FFD74A" Stroke="#FFFFE070" StrokeThickness="0.8">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseDown">
                        <i:InvokeCommandAction Command="{Binding PreviewMouseDownCommand}" CommandParameter="RightTop"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Rectangle>
            <Rectangle Grid.Row="1" Height="{Binding HeightButtonResize}" Width="{Binding WidthButtonResize}" Fill="#19FFD74A" Stroke="#FFFFE070" StrokeThickness="0.8">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseDown">
                        <i:InvokeCommandAction Command="{Binding PreviewMouseDownCommand}" CommandParameter="Left"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Rectangle>
            <Rectangle Grid.Row="1" Grid.Column="2" Height="{Binding HeightButtonResize}" Width="{Binding WidthButtonResize}" Fill="#19FFD74A" Stroke="#FFFFE070" StrokeThickness="0.8">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseDown">
                        <i:InvokeCommandAction Command="{Binding PreviewMouseDownCommand}" CommandParameter="Right"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Rectangle>
            <Rectangle Grid.Row="2" Height="{Binding HeightButtonResize}" Width="{Binding WidthButtonResize}" Fill="#19FFD74A" Stroke="#FFFFE070" StrokeThickness="0.8">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseDown">
                        <i:InvokeCommandAction Command="{Binding PreviewMouseDownCommand}" CommandParameter="LeftBottom"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Rectangle>
            <Rectangle Grid.Row="2" Grid.Column="1" Height="{Binding HeightButtonResize}" Width="{Binding WidthButtonResize}" Fill="#19FFD74A" Stroke="#FFFFE070" StrokeThickness="0.8">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseDown">
                        <i:InvokeCommandAction Command="{Binding PreviewMouseDownCommand}" CommandParameter="Bottom"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Rectangle>
            <Rectangle Grid.Row="2" Grid.Column="2" Height="{Binding HeightButtonResize}" Width="{Binding WidthButtonResize}" Fill="#19FFD74A" Stroke="#FFFFE070" StrokeThickness="0.8">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseDown">
                        <i:InvokeCommandAction Command="{Binding PreviewMouseDownCommand}" CommandParameter="RightBottom"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Rectangle>
            <ContentPresenter Grid.Column="1" Grid.Row="1" Content="{Binding Content}"/>
        </Grid>
    </DataTemplate>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\ResizerViewModel.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels
{
    public class ResizerViewModel : NotifyBase, IBaseElement
    {
        public event EventHandler<IBaseElement> PreviewMouseDown;
        public event EventHandler<IBaseElement> PreviewMouseUp;
        public event EventHandler<ResizerEventArgs> DirectionEvent;
        public RelayCommand PreviewMouseDownCommand => new RelayCommand(obj =>
        {
            Direction direction = Direction.Left;
            var value = obj.ToString();
            switch (value)
            {
                case "Left":
                    direction = Direction.Left;
                    break;
                case "Right":
                    direction = Direction.Right;
                    break;
                case "Top":
                    direction = Direction.Top;
                    break;
                case "Bottom":
                    direction = Direction.Bottom;
                    break;
                case "LeftTop":
                    direction = Direction.LeftTop;
                    break;
                case "RightTop":
                    direction = Direction.RightTop;
                    break;
                case "LeftBottom":
                    direction = Direction.LeftBottom;
                    break;
                case "RightBottom":
                    direction = Direction.RightBottom;
                    break;

            }
            DirectionEvent?.Invoke(this, new ResizerEventArgs(direction));

        });
        public RelayCommand PreviewMouseUpCommand => new RelayCommand(obj =>
        {
            if (obj is IBaseElement element)
                PreviewMouseUp?.Invoke(this, element);
        });

        private bool _contentLoaded = false;

        private IBaseElement _content;

        public IBaseElement Content
        {
            get { return _content; }
            set 
            {
                _content = value;
                if (_content != null)
                {
                    PositionResizerCalculate();
                    _contentLoaded = true;
                }
                OnPropertyChanged();
            }
        }

        private double _x;
        public double X
        {
            get { return _x; }
            set
            {
                if (_x != value)
                {
                    if (_contentLoaded)
                        _content.X = value + _widthButtonResize;
                    _x = value;
                    OnPropertyChanged();
                }
            }
        }

        public double _y;
        public double Y
        {
            get { return _y; }
            set
            {
                if (_y != value)
                {
                    if (_contentLoaded)
                        _content.Y = value + _heightButtonResize;
                    _y = value;
                    OnPropertyChanged();
                }
            }
        }

        private double _width;
        public double Width
        {
            get { return _width; }
            set
            {
                if (_width != value)
                    _content.Width = value - _widthButtonResize * 2;
                _width = value;
                OnPropertyChanged();
            }
        }

        public double _height;
        public double Height
        {
            get { return _height; }
            set
            {
                if (_height != value)
                    _content.Height = value - _heightButtonResize * 2;
                _height = value;
                OnPropertyChanged();
            }
        }

        private double _heightButtonResize = 10;

        public double HeightButtonResize
        {
            get { return _heightButtonResize; }
            set { _heightButtonResize = value;
                OnPropertyChanged(); }
        }

        private double _widthButtonResize = 10;

        public double WidthButtonResize
        {
            get { return _widthButtonResize; }
            set
            {
                _widthButtonResize = value;
                OnPropertyChanged();
            }
        }

        private void PositionResizerCalculate()
        {
            X = _content.X - _widthButtonResize;
            Y = _content.Y - _heightButtonResize;
            Height = _content.Height + _heightButtonResize * 2;
            Width = _content.Width + _widthButtonResize * 2;
        }
    }

    public class ResizerEventArgs : EventArgs
    {
        public Direction Direction { get; set; }

        public ResizerEventArgs(Direction direction)
        {
            Direction = direction;
        }
    }

    public enum Direction
    {
        Unknown,
        Left,
        Right,
        Top,
        Bottom,
        LeftTop,
        RightTop,
        LeftBottom,
        RightBottom
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\Tools.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels
{
    public static class Tools
    {
        public static List<ITool> GetTools()
        {
            return new List<ITool>
            {
                new ColorChanger(),
                new ColorAnimation(),
                new MediaPlayer(),
                new SoundPlayer(),
                new TextTool(),
                new ScenarioStopAndWait(),
                new CallingMethod(),
                new CallingMehtodByTimer(),
                new EndScenario(),
                new Arrow()
            };
        }

        public static ITool CreateTool(SegmentScenarioModel model, IToolsManager toolsManager)
        {
            if (model.ID == null)
                model.ID = $"{model.ToolName}_{Guid.NewGuid()}";
            switch (model.ToolName)
            {
                case nameof(ColorChanger):
                    return new ColorChanger(model as ColorSegmentScenarioModel);
                case nameof(ColorAnimation):
                    return new ColorAnimation(model as ColorSegmentScenarioModel);
                case nameof(MediaPlayer):
                    {
                        if (model.Height <= 0)
                            model.Height = 150;
                        if (model.Width <= 0)
                            model.Width = 200;
                        return new MediaPlayer(model as MediaSegmentScenarioModel);
                    }
                case nameof(SoundPlayer):
                    return new SoundPlayer(model as MediaSegmentScenarioModel);
                case nameof(TextTool):
                    return new TextTool(model as TextSegmentScenarioModel);
                case nameof(ScenarioStopAndWait):
                    return new ScenarioStopAndWait(model, toolsManager);
                case nameof(CallingMethod):
                    return new CallingMethod(model as CallingMethodScenarioModel, toolsManager);
                case nameof(CallingMehtodByTimer):
                    return new CallingMehtodByTimer(model as CallingMethodByTimerScenarioModel, toolsManager);
                case nameof(EndScenario):
                    return new EndScenario(model, toolsManager);
                case nameof(Arrow):
                    return new Arrow(model as ArrowScenarioModel);
                default:
                    return null;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\ToolsManager.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components.ToolsEditor;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels
{
    public class ToolsManager : NotifyBase, IToolsManager
    {
        private object _currentTool = null;
        public object CurrentTool
        {
            get { return _currentTool; }
            set { _currentTool = value;
                OnPropertyChanged();
            }
        }

        public RelayCommand CloseEditToolPropertiesCommand => new RelayCommand(obj =>
        {
            CurrentTool = null;
        });
        public Dictionary<string, Action> UsedMethods { get; set; } = new Dictionary<string, Action>();
        public List<ITool> UsedTools { get; set; } = new List<ITool>();
        public ITool SelectedTool { get; set; }

        public DispatcherTimer RootTimer { get; } = new DispatcherTimer(DispatcherPriority.Render);
        

        public event EventHandler<ControlComponentEventArgs> SetSampleTool;
        public event EventHandler<ITool> SelectingTool;
        public event EventHandler<IStopper> WaitiongOuterAction;
        public event EventHandler EndScenario;

        public ToolsManager()
        {

        }
        
        public ITool CreateTool(object caller, SegmentScenarioModel model)
        {
            var tool = Tools.CreateTool(model, this);
                SetSampleTool?.Invoke(this,new ControlComponentEventArgs(tool, caller));
            if(tool is IStopper stopper)
                stopper.WaitingAction += Stopper_WaitingAction;
            UsedTools.Add(tool);
            return tool;
        }
        public bool RemoveTool(SegmentScenarioModel model)
        {
            return false;
        }
        private void Stopper_WaitingAction(object sender, IStopper e)
        {
            WaitiongOuterAction?.Invoke(this, e);
        }

        public void CallEndScenario()
        {
            EndScenario?.Invoke(this, new EventArgs());
        }

        public ITool GetTool(object caller, SegmentScenarioModel model)
        {
            ITool tool = null;
            if (model.ID != null)
                tool = UsedTools.FirstOrDefault(f => f.ID == model.ID);
            if (tool == null || model.ID == null) 
                tool = CreateTool(caller, model);
            return tool;
        }

        public void ShowCurrentToolOptions(ITool controlComponent)
        {
            string toolName = controlComponent.Component_Name;

            switch (controlComponent.Component_Name)
            {
                case nameof(MediaPlayer):
                    CurrentTool = new MediaPlayerPropertiesViewModel((MediaPlayer)controlComponent);
                    break;
                case nameof(TextTool):
                    CurrentTool = new TextToolPropertiesViewModel((TextTool)controlComponent);
                    break;
                case nameof(SoundPlayer):
                    CurrentTool = new SoundPlayerPropertiesViewModel((SoundPlayer)controlComponent);
                    break;
                case nameof(ColorChanger):
                    CurrentTool = new ColorChangerPropertiesViewModel((ColorChanger)controlComponent);
                    break;
                case nameof(ColorAnimation):
                    CurrentTool = new ColorAnimationPropertiesViewModel((ColorAnimation)controlComponent);
                    break;
                case nameof(CallingMethod):
                    CurrentTool = new CallingMethodPropertiesViewModel((CallingMethod)controlComponent, this);
                    break;
                case nameof(CallingMehtodByTimer):
                    CurrentTool = new CallingMethodByTimerPropertiesViewModel((CallingMehtodByTimer)controlComponent, this);
                    break;
                case nameof(Arrow):
                    CurrentTool = new ArrowPropertiesViewModel((Arrow)controlComponent);
                    break;
                case null:
                    CurrentTool = null;
                    break;
            }
        }

        public void SelectTool(object sender, ITool tool)
        {
            SelectedTool = tool;
            SelectingTool?.Invoke(sender, tool);
        }

        public void Dispose()
        {
            foreach (ITool tool in UsedTools)
            {
                if (tool is IStopper stopper)
                {
                    stopper.WaitingAction -= Stopper_WaitingAction;
                }
            }

            UsedTools.Clear();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\ToolsPanelView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels.ToolsPanelView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension"
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:tools="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels"
             mc:Ignorable="d" 
             d:DesignHeight="800" d:DesignWidth="350" Background="#FF334159">
    <Grid x:Name="toolsGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TextBlock Text="ПАНЕЛЬ ИНСТРУМЕНТОВ" FontSize="14" Padding="5" Background="#FF336799" Foreground="#FFDBE7F3" FontWeight="Light"/>
        <ListView Grid.Row="1" ItemsSource="{Binding Tools}" Background="{x:Null}" BorderThickness="0" TextBlock.Foreground="White" HorizontalContentAlignment="Stretch" SnapsToDevicePixels="True">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Canvas x:Name="tool_Panel" Height="15" Background="#00000000">
                        <TextBlock Text="{Binding Description}" x:Name="tbx" TextAlignment="Left" RenderTransformOrigin="0.0,0.5" SnapsToDevicePixels="True" Foreground="#FFFFFAE6">
                            <TextBlock.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform />
                                </TransformGroup>
                            </TextBlock.RenderTransform>
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="PreviewMouseDown">
                                <i:InvokeCommandAction 
                                                 Command="{Binding DataContext.MouseDownCommand, ElementName=toolsGrid}"
                                                 CommandParameter="{Binding ElementName=tbx}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </TextBlock>
                    </Canvas>
                    <DataTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard Storyboard.TargetName="tbx">
                                        <DoubleAnimation Storyboard.TargetProperty="RenderTransform.Children[0].ScaleX" To="1.2" Duration="0:0:0.08"/>
                                        <DoubleAnimation Storyboard.TargetProperty="RenderTransform.Children[0].ScaleY" To="1.2" Duration="0:0:0.08"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard Storyboard.TargetName="tbx">
                                        <DoubleAnimation Storyboard.TargetProperty="RenderTransform.Children[0].ScaleX" To="1.0" Duration="0:0:0.05"/>
                                        <DoubleAnimation Storyboard.TargetProperty="RenderTransform.Children[0].ScaleY" To="1.0" Duration="0:0:0.05"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\ToolsPanelView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels
{
    public partial class ToolsPanelView : UserControl
    {
        public ToolsPanelView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Panels\ToolsPanelViewModel.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels
{
    public class ToolsPanelViewModel : NotifyBase
    {
        private List<ITool> _tools;

        public List<ITool> Tools
        {
            get { return _tools; }
            set
            {
                _tools = value;
                OnPropertyChanged();
            }
        }

        public RelayCommand MouseDownCommand => new RelayCommand(obj =>
        {
            if (obj is FrameworkElement element)
            {
                if (element.DataContext is ITool tool)
                    DragDrop.DoDragDrop(element, tool.Component_Name, DragDropEffects.Copy);
            }
        });

        public ToolsPanelViewModel()
        {
            Initialize();
        }

        private void Initialize()
        {
            List<ITool> tools = Panels.Tools.GetTools();
            Tools = tools;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\ElementsView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.ElementsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline"
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="350">
    <Grid>
        <ListBox ItemsSource="{Binding Timelines}" Background="#FF173057" BorderThickness="0">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding ElementName}" Foreground="#FF6D98DB" />
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\ElementsView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    /// <summary>
    /// Interaction logic for ElementsView.xaml
    /// </summary>
    public partial class ElementsView : UserControl
    {
        public ElementsView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\ITimelineElement.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    public interface ITimelineElement
    {
        Brush Brush { get; set; }
        ITool ChangingElement { get; set; }
        TimeSpan From { get; set; }
        TimeSpan To { get; set; }

        void ChangeFrom(TimeSpan newValue);
        void ChangeTo(TimeSpan newValue);
        void SetTime(TimeSpan from, TimeSpan to);
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\ITimelineElementToWidthConverter.cs

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    public class ITimelineElementToWidthConverter : MarkupExtension, IValueConverter
    {
        private ITimelineElementToWidthConverter _converter;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var element = value as ITimelineElement;
            var width = element.To - element.From;
            if (width.TotalSeconds == 0)
                return 1;
            return width.TotalSeconds;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new ITimelineElementToWidthConverter();
            return _converter;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\RegularTimelineElement.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    public class RegularTimelineElement : NotifyBase, ITimelineElement
    {
        public ITool ChangingElement { get; set; }
        public TimeSpan From 
        {
            get { return Model.From; }
            set 
            {
                Model.From = value;
                OnPropertyChanged();
            }
        }
        
        public TimeSpan To
        {
            get { return Model.To; }
            set
            {
                Model.To = value;
                OnPropertyChanged();
            }
        }

        public Brush Brush { get; set; }
        public readonly SegmentScenarioModel Model;

        public RegularTimelineElement(ITool changingElement, SegmentScenarioModel model)
        {
            Model = model;
            ChangingElement = changingElement;
            SetTime(Model.From, Model.To);
            Brush = changingElement.Brush;
        }

        public void SetTime(TimeSpan from, TimeSpan to)
        {
            if (Validate(from, to))
            {
                From = from;
                To = to;
            }
            else
                throw new Exception("From To Validate not success!");
        }

        private bool Validate(TimeSpan from, TimeSpan to)
        {
            if (from > to)
                return false;
            return true;
        }

        public void ChangeFrom(TimeSpan newValue)
        {
            From = newValue;
        }

        public void ChangeTo(TimeSpan newValue)
        {
            To = newValue;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\ScenariosView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.ScenariosView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension"
             xmlns:timelineViewModels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.ViewModels"
             xmlns:timeline="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid >
        <ItemsControl x:Name="scenariosIC" ItemsSource="{Binding Timelines}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate DataType="{x:Type timelineViewModels:TimelineSegmentsContainerViewModel}">
                    <timeline:TimelineElementContainer/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\ScenariosView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    /// <summary>
    /// Interaction logic for ScenariosView.xaml
    /// </summary>
    public partial class ScenariosView : UserControl
    {
        public ScenariosView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\SegmentTypes.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    public enum SegmentTypes
    {
        Regular,
        Simple
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\SingleTimelineElement.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    public class SingleTimelineElement : NotifyBase, ITimelineElement
    {
        public ITool ChangingElement { get; set; }
        private TimeSpan _from;
        public TimeSpan From
        {
            get { return _from; }
            set
            {
                _from = value;
                OnPropertyChanged();
            }
        }
        private TimeSpan _to;
        public TimeSpan To
        {
            get { return _to; }
            set
            {
                _to = value;
                OnPropertyChanged();
            }
        }
        public Brush Brush { get; set; }
        public readonly SegmentScenarioModel Model;
        public SingleTimelineElement(ITool changingElement, SegmentScenarioModel model)
        {
            Model = model;
            ChangingElement = changingElement;
            SetTime(Model.From, Model.To);
            Brush = changingElement.Brush;
        }

        public void SetTime(TimeSpan from, TimeSpan to)
        {
            if (Validate(from, to))
            {
                From = from;
                To = to;
            }
            else
                throw new Exception("From To Validate not success!");
        }

        private bool Validate(TimeSpan from, TimeSpan to)
        {
            if (from > to)
                return false;
            return true;
        }

        public void ChangeFrom(TimeSpan newValue)
        {
            From = To = newValue;
        }

        public void ChangeTo(TimeSpan newValue)
        {
            From = To = newValue;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\StickBehavior.cs

using Microsoft.Xaml.Behaviors;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    public class StickBehavior:Behavior<FrameworkElement>
    {
        public FrameworkElement Panel
        {
            get { return (FrameworkElement)GetValue(PanelProperty); }
            set { SetValue(PanelProperty, value); }
        }

        public static readonly DependencyProperty PanelProperty =
            DependencyProperty.Register("Panel", typeof(FrameworkElement), typeof(StickBehavior), new PropertyMetadata(null));


        public TimeSpan CurrentTime
        {
            get { return (TimeSpan)GetValue(CurrentTimeProperty); }
            set { SetValue(CurrentTimeProperty, value); }
        }

        public static readonly DependencyProperty CurrentTimeProperty =
            DependencyProperty.Register("CurrentTime", typeof(TimeSpan), typeof(StickBehavior), new PropertyMetadata(TimeSpan.Zero, TimeChanged));


        public TimeSpan FullTime
        {
            get { return (TimeSpan)GetValue(FullTimeProperty); }
            set { SetValue(FullTimeProperty, value); }
        }

        public static readonly DependencyProperty FullTimeProperty =
            DependencyProperty.Register("FullTime", typeof(TimeSpan), typeof(StickBehavior), new PropertyMetadata(TimeSpan.Zero));


        private static void TimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var behavior = d as StickBehavior;
            var element = behavior.AssociatedObject;
            var currentTime = (TimeSpan)e.NewValue;
            double translatedLeft = 0.0;
            if (behavior.Panel is Canvas canvas)
            {
                var width = canvas.ActualWidth;
                var timeSeconds = behavior.FullTime.TotalSeconds;
                var oneInterval = width / timeSeconds;
                translatedLeft = currentTime.TotalSeconds * oneInterval;
            }
            element.SetValue(Canvas.LeftProperty, translatedLeft);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\Timeline.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Timeline"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline" xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid Background="#FF3A4B66">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <TextBlock Text="ЭЛЕМЕНТЫ" Foreground="#FF93B0DE" FontSize="16" Margin="5"/>
        <Grid Grid.Row="1" Background="#FF213554">
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <local:ElementsView Grid.Row="1"/>
        </Grid>
        <TextBlock Grid.Column="2" Text="СЦЕНАРИИ" Foreground="#FF93B0DE" FontSize="16" Margin="5"/>
        <Grid Grid.Column="2" HorizontalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <local:TimelineControlPanel/>
            <TextBlock Grid.Column="1" Text="{Binding CurrentTime, Converter={converters:TimespanFormatConverter}}"
                   FontSize="24"
                   TextAlignment="Center"
                   Foreground="#FFFFB93D"/>
        </Grid>
        <GridSplitter Width="2" Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" ResizeDirection="Columns" HorizontalAlignment="Stretch"/>
        <local:TimelineScenarios Grid.Column="2" Grid.Row="1" Background="#FF213554"/>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\Timeline.xaml.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.ViewModels;
using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    public partial class Timeline : UserControl
    {
        public Timeline()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\TimelineControlPanel.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.TimelineControlPanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline"
             mc:Ignorable="d" 
             d:DesignHeight="30" d:DesignWidth="85" Height="30" Width="90">
    <UserControl.Resources>
        <ResourceDictionary>
            <SolidColorBrush x:Key="buttonsContentBrush" Color="#161414"/>
            <SolidColorBrush x:Key="buttonsBackgroundBrush" Color="#C99194"/>
            <Style TargetType="Button">
                <Setter Property="BorderThickness" Value="0.0" />
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Button Grid.Column="0" Width="25"
                Height="25"
                Command="{Binding PlayCommand}"
                Background="{StaticResource buttonsBackgroundBrush}" >
            <Path Data="M46,32c0-1.099-0.592-2.06-1.475-2.583l0,0L22.561,16.438c-0.008-0.005-0.016-0.009-0.024-0.014l-0.011-0.007l0,0
				C22.079,16.153,21.557,16,21,16c-1.657,0-3,1.343-3,3v26c0,1.657,1.343,3,3,3c0.557,0,1.079-0.152,1.526-0.417l0,0l0.011-0.007
				c0.008-0.006,0.016-0.01,0.024-0.014l21.964-12.979l0,0C45.408,34.061,46,33.1,46,32z" Height="64" Width="64" Fill="{StaticResource buttonsContentBrush}">
                <Path.LayoutTransform>
                    <ScaleTransform ScaleX="0.25" ScaleY="0.25"/>
                </Path.LayoutTransform>
            </Path>
        </Button>
        <Button Grid.Column="1"
                Width="25"
                Height="25"
                Command="{Binding StopCommand}"
                Background="{StaticResource buttonsBackgroundBrush}">
            <Path Data="M43,18H21c-1.657,0-3,1.343-3,3v22c0,1.657,1.343,3,3,3h22c1.657,0,3-1.343,3-3V21C46,19.343,44.657,18,43,18z"
                  Height="64"
                  Width="64"
                  Fill="{StaticResource buttonsContentBrush}">
                <Path.LayoutTransform>
                    <ScaleTransform ScaleX="0.25" ScaleY="0.25"/>
                </Path.LayoutTransform>
            </Path>
        </Button>
        <Button Grid.Column="2"
                Width="25"
                Height="25"
                Command="{Binding RestartCommand}"
                Background="{StaticResource buttonsBackgroundBrush}">
            <Path Data="M61,22c-1.657,0-3,1.343-3,3v7c0,6.627-5.373,12-12,12H26v0.003h-2.987v-0.005
			H21.24l1.878-1.879c0.543-0.543,0.878-1.293,0.878-2.122c0-1.657-1.343-3-2.999-3c-0.828,0-1.578,0.336-2.121,0.879l-6.998,7.001
			C11.336,45.42,11,46.17,11,46.999c0,0.829,0.336,1.578,0.878,2.122l6.998,7.001C19.42,56.664,20.169,57,20.998,57
			c1.657,0,2.999-1.343,2.999-3c0-0.829-0.336-1.578-0.878-2.122l-1.873-1.874H27V50h19c9.941,0,18-8.059,18-18v-7
			C64,23.343,62.657,22,61,22z M38,20v-0.004h2.987v0.005h1.773l-1.878,1.879c-0.543,0.543-0.879,1.293-0.879,2.122
			c0,1.657,1.343,3,2.999,3c0.828,0,1.578-0.336,2.121-0.879l6.998-7.001C52.664,18.58,53,17.83,53,17.001
			c0-0.829-0.336-1.579-0.878-2.122l-6.998-7.001C44.581,7.336,43.831,7,43.003,7c-1.657,0-2.999,1.344-2.999,3.001
			c0,0.828,0.336,1.579,0.879,2.122l1.873,1.874H37V14H18C8.059,14,0,22.059,0,32v7c0,1.657,1.343,3,3,3c1.657,0,3-1.343,3-3v-7
			c0-6.627,5.373-12,12-12H38z"
                  Height="64"
                  Width="64"
                  Fill="{StaticResource buttonsContentBrush}">
                <Path.LayoutTransform>
                    <ScaleTransform ScaleX="0.25" ScaleY="0.25"/>
                </Path.LayoutTransform>
            </Path>
        </Button>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\TimelineControlPanel.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    /// <summary>
    /// Interaction logic for TimelineControlPanel.xaml
    /// </summary>
    public partial class TimelineControlPanel : UserControl
    {
        public TimelineControlPanel()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\TimelineElementContainer.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.TimelineElementContainer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline"
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
             xmlns:behaviors="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Behaviors"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800" Height="20">
    <Grid x:Name="rootGrid">
        <ItemsControl ItemsSource="{Binding Segments, UpdateSourceTrigger=PropertyChanged}" BorderBrush="#FF4F6281" BorderThickness="0,0,1,1">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <Canvas Background="#00000000" AllowDrop="True">
                        <i:Interaction.Behaviors>
                            <behaviors:MouseCaptureBehavior Proxy="{Binding}"/>
                            <behaviors:MouseDropBehavior Proxy="{Binding}"/>
                        </i:Interaction.Behaviors>
                    </Canvas>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemContainerStyle>
                <Style TargetType="ContentPresenter">
                    <Setter Property="Canvas.Left" Value="{Binding Left}"/>
                    <!--<Setter Property="Canvas.Top" Value="{Binding Y}"/>-->
                </Style>
            </ItemsControl.ItemContainerStyle>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <local:TimelineSegment Width="{Binding Width}" Height="{Binding Height}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
        
    </Grid>
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Loaded" >
            <i:InvokeCommandAction  
                     Command="{Binding Loaded_Command}"
                     CommandParameter="{Binding ElementName=rootGrid}" />
        </i:EventTrigger>
        <i:EventTrigger EventName="Unloaded" >
            <i:InvokeCommandAction  
                     Command="{Binding Unloaded_Command}"
                     CommandParameter="{Binding ElementName=rootGrid}" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\TimelineElementContainer.xaml.cs

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    public partial class TimelineElementContainer : UserControl
    {
        public TimelineElementContainer()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\TimelineScenarios.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.TimelineScenarios"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline"
             xmlns:viewModels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.ViewModels"
             xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Converters"
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
             xmlns:ns="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Common"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <local:ITimelineElementToWidthConverter x:Key="ITimelineElementToWidthConverter"/>
        <local:FromToXConverter x:Key="FromToXConverter"/>
        <converters:GetToPositionConverter x:Key="GetToPositionConverter"/>
    </UserControl.Resources>
    <Grid x:Name="scenarioGrid" Margin="0,0,20,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="25"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <ContentControl Grid.Row="0" DataContext="{Binding FocusedTimeline}">
            <Canvas>
                <TextBlock 
                    Canvas.Left="{Binding CurrentSegment.Left}"
                           Text="{Binding CurrentSegment.Element.From, Converter={converters:TimespanFormatConverter}}"
                    Foreground="Orange"/>
                <TextBlock
                    Canvas.Left="{Binding CurrentSegment.Right}"
                    Text="{Binding CurrentSegment.Element.To, Converter={converters:TimespanFormatConverter}}"
                    Foreground="Orange"/>
            </Canvas>
        </ContentControl>
        <TextBlock Text="{Binding FullTime}"
                   FontSize="12"
                   TextAlignment="Center"
                       HorizontalAlignment="Right"
                   VerticalAlignment="Center"
                   Foreground="#FFFFB93D"/>
        <TickBar Grid.Row="1" Fill="#FFB8B8B8" TickFrequency="1.0" Placement="Bottom" Height="5" VerticalAlignment="Bottom" x:Name="tickBar"/>
        <local:ScenariosView HorizontalContentAlignment="Stretch" Background="#00AEAEAE" Grid.Row="2"/>
        <Canvas x:Name="scenarioCanvas" Grid.RowSpan="3" Height="{Binding ActualHeight, ElementName=scenarioGrid}" IsHitTestVisible="False">
            <Button Height="{Binding ActualHeight, ElementName=scenarioGrid}" Width="2" Background="#FFFF9F15" x:Name="stick" BorderBrush="{x:Null}" BorderThickness="0">
                <i:Interaction.Behaviors>
                    <local:StickBehavior FullTime="{Binding FullTime, UpdateSourceTrigger=PropertyChanged}" CurrentTime="{Binding CurrentTime, UpdateSourceTrigger=PropertyChanged}" Panel="{Binding ElementName=scenarioCanvas}"/>
                </i:Interaction.Behaviors>
            </Button>
        </Canvas>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\TimelineScenarios.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    public partial class TimelineScenarios : UserControl
    {
        public TimelineScenarios()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\TimelineSegment.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.TimelineSegment"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline"
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
             xmlns:behaviors="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Behaviors"
             mc:Ignorable="d" 
             d:DesignHeight="15" d:DesignWidth="800">
    <UserControl.Resources>
        <Style TargetType="{x:Type local:TimelineSegment}">
            <Style.Setters>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:TimelineSegment}">
                            <Grid>
                                <Rectangle Fill="{Binding Brush}">
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="PreviewMouseDown" >
                                            <i:InvokeCommandAction 
                                                 Command="{Binding PreviewMouseDown_Command}"
                                                 CommandParameter="{Binding}" />
                                        </i:EventTrigger>

                                        <i:EventTrigger EventName="PreviewMouseUp" >
                                            <i:InvokeCommandAction 
                                                 Command="{Binding PreviewMouseUp_Command}"
                                                 CommandParameter="{Binding}" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </Rectangle>
                                <Rectangle Width="4" HorizontalAlignment="Left" x:Name="leftGrip" Fill="#00000000" Cursor="SizeWE">
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="PreviewMouseDown" >
                                            <i:InvokeCommandAction 
                                                 Command="{Binding PreviewMouseDown_LeftGrip_Command}"
                                                 CommandParameter="{Binding ElementName=leftGrip}" />
                                        </i:EventTrigger>

                                        <i:EventTrigger EventName="PreviewMouseUp" >
                                            <i:InvokeCommandAction 
                                                 Command="{Binding PreviewMouseUp_LeftGrip_Command}"
                                                 CommandParameter="{Binding ElementName=leftGrip}" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </Rectangle>
                                <Rectangle Width="4" HorizontalAlignment="Right" x:Name="rightGrip" Fill="#00000000" Cursor="SizeWE">
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="PreviewMouseDown" >
                                            <i:InvokeCommandAction 
                                                 Command="{Binding PreviewMouseDown_RightGrip_Command}"
                                                 CommandParameter="{Binding}" />
                                        </i:EventTrigger>

                                        <i:EventTrigger EventName="PreviewMouseUp" >
                                            <i:InvokeCommandAction 
                                                 Command="{Binding PreviewMouseUp_RightGrip_Command}"
                                                 CommandParameter="{Binding}" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </Rectangle>
                                <Grid.ContextMenu>
                                    <ContextMenu>
                                        <MenuItem Header="Настройка" Command="{Binding ChangingOptions_Command}" CommandParameter="{Binding}"/>
                                        <MenuItem Header="Удалить" Command="{Binding RemoveCommand}" CommandParameter="{Binding}"/>
                                    </ContextMenu>
                                </Grid.ContextMenu>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <DataTrigger Binding="{Binding IsSelected}" Value="True">
                                    <Setter TargetName="leftGrip" Property="Fill" Value="Orange"/>
                                    <Setter TargetName="rightGrip" Property="Fill" Value="Orange"/>
                                </DataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style.Setters>
        </Style>
    </UserControl.Resources>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\TimelineSegment.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    /// <summary>
    /// Interaction logic for TimelineSegment.xaml
    /// </summary>
    public partial class TimelineSegment : UserControl
    {
        public TimelineSegment()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\TimeToCanvasLeftConverter.cs

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    public class TimeToCanvasLeftConverter : MarkupExtension, IValueConverter
    {
        private TimeToCanvasLeftConverter _converter;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var time=TimeSpan.FromSeconds(100);
            var currentTime = (TimeSpan)value;
            double translatedWidth = 0.0;
            var canvas = parameter as Canvas;
            if (canvas != null)
            {
                var width = canvas.ActualWidth;
                var timeSeconds = time.TotalSeconds;
                var oneInterval = width / timeSeconds;
                translatedWidth = currentTime.TotalSeconds * width;
            }
            return translatedWidth;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new TimeToCanvasLeftConverter();
            return _converter;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\Converters\FromToXConverter.cs

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    public class FromToXConverter : MarkupExtension, IValueConverter
    {
        private FromToXConverter _converter;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var element = value as ITimelineElement;
            var x = element.From.TotalSeconds;
            return x;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new FromToXConverter();
            return _converter;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\Converters\GetToPositionConverter.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.ViewModels;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Converters
{
    public class GetToPositionConverter : MarkupExtension, IValueConverter
    {
        private GetToPositionConverter _converter;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var vm = value as TimelineSegmentViewModel;
            if (vm != null)
            {
                Debug.WriteLine($"{vm.Width}");
                return vm.Left + vm.Width;
            }
            return 0.0;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new GetToPositionConverter();
            return _converter;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\Converters\TimespanFormatConverter.cs

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Converters
{
    public class TimespanFormatConverter : MarkupExtension, IValueConverter
    {
        private TimespanFormatConverter _converter;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                var time = (TimeSpan)value;
                return time.ToString(@"hh\:mm\:ss\:ff");
            }
            catch
            {
                return "null";
            }

        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new TimespanFormatConverter();
            return _converter;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\Models\ElementScenarioModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using common = Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Common.Common;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models
{
    public class ElementScenarioModel
    {
        public event EventHandler<SegmentScenarioEventArgs> ElementsUpdated;
        /// <summary>
        /// Element Name
        /// </summary>
        public string Name { get; set; }

        public List<SegmentScenarioModel> Segments { get; set; } = new List<SegmentScenarioModel>();
        public void UpdateSegmentScenario(SegmentScenarioModel model)
        {
            var existModel = Segments.FirstOrDefault(f => f.ToolName == model.ToolName &&
                                                                     f.From == model.From &&
                                                                     f.To == model.To);
            if (existModel != null)
            {
                existModel.ToolName = model.ToolName;
                existModel.From = model.From;
                existModel.To = model.To;
                existModel.SegmentType = model.SegmentType;
                existModel.Position = model.Position;
                ElementsUpdated?.Invoke(this, new SegmentScenarioEventArgs(existModel, common.Mode.Update));
            }
        }

        public void AddElementScenario(SegmentScenarioModel model)
        {
            Segments.Add(model);
            ElementsUpdated?.Invoke(this, new SegmentScenarioEventArgs(model, common.Mode.Add));
        }

        public void RemoveElementScenario(SegmentScenarioModel model)
        {
            var existModel = Segments.FirstOrDefault(f => f.ToolName == model.ToolName &&
                                                                     f.From == model.From &&
                                                                     f.To == model.To);
            if (existModel != null)
            {
                Segments.Remove(existModel);
                ElementsUpdated?.Invoke(this, new SegmentScenarioEventArgs(existModel, common.Mode.Remove));
            }
        }

    }

    public class SegmentScenarioEventArgs:EventArgs
    {
        public common.Mode Mode { get; set; }
        public SegmentScenarioModel UpdatedSegmentScenario { get; set; }
        public SegmentScenarioEventArgs(SegmentScenarioModel updatedSegmentScenario, common.Mode mode)
        {
            UpdatedSegmentScenario = updatedSegmentScenario;
            Mode = mode;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\Models\SegmentScenarioModel.cs

using Newtonsoft.Json;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models
{
    public class SegmentScenarioModel
    {
        public string Type { get; set; }
        public string ID { get; set; }

        [JsonProperty("ToolName")]
        public string ToolName { get; set; }
        public TimeSpan From { get; set; }
        public TimeSpan To { get; set; }
        public double Width { get; set; }
        public double Height { get; set; }
        public SegmentTypes SegmentType { get; set; }
        public Point Position { get; set; }
        public bool IsBase { get; set; }
    }

    public class MediaSegmentScenarioModel : SegmentScenarioModel, IMedia
    {
        public string Source { get; set; }
    }

    public class TextSegmentScenarioModel : SegmentScenarioModel, IText
    {
        public Brush Foreground { get; set; } = Brushes.White;
        public double FontSize { get; set; } = 22.0;
        public string Text { get; set; } = "TEXT";
    }

    public class ColorSegmentScenarioModel : SegmentScenarioModel, IColor
    {
        public Brush Color { get; set; } = Brushes.White;
    }

    public class CallingMethodScenarioModel : SegmentScenarioModel
    {
        public string MethodName { get; set; }
    }

    public class CallingMethodByTimerScenarioModel : SegmentScenarioModel
    {
        public TimeSpan TimerInterval { get; set; }
        public string MethodName { get; set; }
    }

    public class ArrowScenarioModel : SegmentScenarioModel
    {
        public bool IsDashed { get; set; }
        public Brush Color { get; set; } = Brushes.White;
        public Point ControlPoint1 { get; set; }
        public Point ControlPoint2 { get; set; }
        public Point EndPoint { get; set; }

        public ArrowScenarioModel()
        {

        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\Models\StudyAssignmentModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using common = Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Common.Common;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models
{
    public class StudyAssignmentModel
    {
        public event EventHandler<ElementScenarioEventArgs> ElementsUpdated;
        public TimeSpan FullTime { get; set; }
        public List<ElementScenarioModel> Elements { get; set; } = new List<ElementScenarioModel>()
        {
            new ElementScenarioModel() { Name = "Common" },
            new ElementScenarioModel() { Name = "Media" },
            new ElementScenarioModel() { Name = "Audio" },
            new ElementScenarioModel() { Name = "Text" },
            new ElementScenarioModel() { Name = "Arrow" },
        };

        public void ElementNameUpdate(ElementScenarioModel model)
        {
            var curElement = Elements.FirstOrDefault(f => f.Name == model.Name);
            if (curElement != null)
            {
                curElement.Name = model.Name;
                ElementsUpdated?.Invoke(this, new ElementScenarioEventArgs(curElement, common.Mode.Update));
            }
        }

        public void AddElementScenario(ElementScenarioModel model)
        {
            Elements.Add(model);
            ElementsUpdated?.Invoke(this, new ElementScenarioEventArgs(model, common.Mode.Add));
        }

        public void RemoveElementScenario(ElementScenarioModel model)
        {
            var existModel = Elements.FirstOrDefault(f => f.Name == model.Name);
            if (existModel!=null)
            {
                Elements.Remove(existModel);
                ElementsUpdated?.Invoke(this, new ElementScenarioEventArgs(existModel, common.Mode.Remove));
            }
        }
        public StudyAssignmentModel(TimeSpan fullTime)
        {
            FullTime = fullTime;
        }
    }

    public class ElementScenarioEventArgs : EventArgs
    {
        public common.Mode Mode { get; set; }
        public ElementScenarioModel UpdatedElementScenario { get; set; }
        public ElementScenarioEventArgs(ElementScenarioModel updatedElementScenario, common.Mode mode )
        {
            UpdatedElementScenario = updatedElementScenario;
            Mode = mode;
        }
    }


}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\Models\ToolsModelFactory.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models
{
    public static class ToolsModelFactory
    {
        public static SegmentScenarioModel GetToolModel(string toolName)
        {
            switch (toolName)
            {
                case nameof(ColorChanger):
                    return new ColorSegmentScenarioModel();
                case nameof(ColorAnimation):
                    return new ColorSegmentScenarioModel();
                case nameof(MediaPlayer):
                    return new MediaSegmentScenarioModel() { Type = "Media" };
                case nameof(SoundPlayer):
                    return new MediaSegmentScenarioModel();
                case nameof(TextTool):
                    return new TextSegmentScenarioModel() { Type = "Text" };
                case nameof(CallingMethod):
                    return new CallingMethodScenarioModel();
                case nameof(CallingMehtodByTimer):
                    return new CallingMethodByTimerScenarioModel();
                case nameof(ScenarioStopAndWait):
                    return new SegmentScenarioModel();
                case nameof(EndScenario):
                    return new SegmentScenarioModel();
                case nameof(Arrow):
                    return new ArrowScenarioModel() 
                    {
                        Type = "Arrow"
                    };
                default:
                    return null;
            }    
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\ViewModels\MainViewModel.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.ViewModels;
using System;
using System.Windows;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Elements;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using System.IO;
using Updk7.Tests.Wpf.Source.Psychophysical.LearningTasksExtension;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.ViewModels
{
    public class MainViewModel : NotifyBase, IDisposable
    {
        public event EventHandler<IStopper> WaitingOuterAction;
        public event EventHandler Stop;
        public event EventHandler Try;
        public event EventHandler Replay;
        public event EventHandler ToTest;
        public event EventHandler ToTextInstruction;

        private FrameworkElement _content;
        public FrameworkElement Content
        {
            get { return _content; }
            set
            {
                _content = value;
                OnPropertyChanged();
            }
        }

        private bool _continueViewVisible = false;

        public bool ContinueViewVisible
        {
            get { return _continueViewVisible; }
            set 
            { 
                _continueViewVisible = value;
                OnPropertyChanged();
            }
        }

        private string _fileName;

        public string FileName
        {
            get { return _fileName; }
            set
            {
                _fileName = value;
                OnPropertyChanged();
            }
        }

        public RelayCommand Try_Command => new RelayCommand(obj =>
        {
            Try?.Invoke(this, new EventArgs());
        });

        public RelayCommand Replay_Command => new RelayCommand(obj => 
        {
            Replay?.Invoke(this, new EventArgs());
        });

        public RelayCommand ToTest_Command => new RelayCommand(obj =>
        {
            ToTest?.Invoke(this, new EventArgs());
        });

        public RelayCommand ToInstruction_Command => new RelayCommand(obj =>
        {
            ToTextInstruction?.Invoke(this, new EventArgs());
        });

        public RelayCommand Save_Command => new RelayCommand(obj =>
        {
            var currrentDirectory = Directory.GetCurrentDirectory();
            var scenarionsDirectory = $"{ currrentDirectory }\\Scenarions";
            var isExistScenariosCatalog = Directory.Exists(scenarionsDirectory);
            if (!isExistScenariosCatalog)
                Directory.CreateDirectory(scenarionsDirectory);

            var path = IOService.ShowSaveFileDialog(scenarionsDirectory);
            if (path == null)
                return;
            JsonFileGenerator.GenerateScenarioFile(path, Model);
        });

        public RelayCommand Open_Command => new RelayCommand(obj =>
        {
            var currrentDirectory = Directory.GetCurrentDirectory();
            var scenarionsDirectory = $"{ currrentDirectory }\\Scenarions";
            var isExistScenariosCatalog = Directory.Exists(scenarionsDirectory);
            if (!isExistScenariosCatalog)
                Directory.CreateDirectory(scenarionsDirectory);

            var path = IOService.ShowOpenFileDialog(scenarionsDirectory);
            if (path == null)
                return;
            Model = JsonFileGenerator.GetModel(path);
            Dispose();
            Initialize();
        });

        public StudyAssignmentModel Model;
        public ToolsPanelViewModel ToolsViewModel { get; set; }
        private CanvasPanelViewModel _placementViewModel;
        public CanvasPanelViewModel PlacementViewModel
        {
            get { return _placementViewModel; }
            set
            {
                _placementViewModel = value;
                OnPropertyChanged();
            }
        }
        private TimelinesViewModel _timelinesViewModel;
        public TimelinesViewModel TimelinesData 
        {
            get { return _timelinesViewModel; }
            set 
            {
                _timelinesViewModel = value;
                OnPropertyChanged();
            }
        }
        private ThumblerViewModel _switchMode;
        public ThumblerViewModel SwitchMode
        {
            get { return _switchMode; }
            set
            {
                _switchMode = value;
                OnPropertyChanged();
            }
        }
        private IToolsManager _toolsManager;
        public IToolsManager ToolsManager
        {
            get { return _toolsManager; }
            set 
            {
                _toolsManager = value;
                OnPropertyChanged();
            }
        }

        private bool _isLearningMode;

        public bool IsLearningMode
        {
            get { return _isLearningMode; }
            set 
            { 
                _isLearningMode = value;
                OnPropertyChanged();
            }
        }

        private bool _isBetweenTasks;

        public bool IsBetweenTasks
        {
            get { return _isBetweenTasks; }
            set
            {
                _isBetweenTasks = value;
                OnPropertyChanged();
            }
        }


        public EditorOptions Options { get; private set; }
        /// <summary>
        /// isLearning = false Включает режим редактора
        /// </summary>
        /// <param name="content"></param>
        /// <param name="model"></param>
        /// <param name="isLearning">Включает режим редактора</param>
        /// <param name="isBetweenTasks"></param>
        public MainViewModel(FrameworkElement content, StudyAssignmentModel model, string instructionName, bool isLearning = false, bool isBetweenTasks = false)
        {
            IsBetweenTasks = isBetweenTasks;
            IsLearningMode = isLearning;
            Model = model;
            Content = content;
            ToolsViewModel = new ToolsPanelViewModel();
            FileName = instructionName;
        }

        public void Initialize()
        {
            var singleManager = new SingleToolsManager();
            ToolsManager = singleManager.GetManager();
            ToolsManager.EndScenario += ToolsManager_EndScenario;
            ToolsManager.WaitiongOuterAction += ToolsManager_WaitiongOuterAction;
            Options = SingleEditorOptions.GetOptions();
            Options.Mode = Common.GeneralMode.Editor;
            SwitchMode = new ThumblerViewModel();
            if (IsLearningMode)
            {
                EditorOptions options = SingleEditorOptions.GetOptions();
                options.Mode = Common.GeneralMode.Normal;
                SwitchMode.SwitchPosition = true;
                options.OnPropertyChanged(nameof(options.Mode));
            }
            SwitchMode.OnOff += SwitchMode_OnOff;
            TimelinesData = new TimelinesViewModel(_content, Model, ToolsManager);
            PlacementViewModel = new CanvasPanelViewModel(Model.Elements, ToolsManager);
            ILearning learningControl = Content as ILearning;
            learningControl.LearningPanel = PlacementViewModel;
            TimelinesData.Play();
        }

        private void ToolsManager_EndScenario(object sender, EventArgs e)
        {
            ContinueViewVisible = true;
            TimelinesData?.Stop();
            Stop?.Invoke(sender, new EventArgs());
        }

        private void ToolsManager_WaitiongOuterAction(object sender, IStopper e)
        {
            WaitingOuterAction?.Invoke(this, e);
        }

        private void SwitchMode_OnOff(object sender, bool e)
        {
            EditorOptions options = SingleEditorOptions.GetOptions();
            options.Mode = !e ? Common.GeneralMode.Editor : Common.GeneralMode.Normal;
        }

        public void Dispose()
        {
            if (ToolsManager != null)
                ToolsManager.WaitiongOuterAction -= ToolsManager_WaitiongOuterAction;
            ToolsManager?.Dispose();
            if (SwitchMode != null)
                SwitchMode.OnOff -= SwitchMode_OnOff;
            TimelinesData?.Stop();
            SwitchMode = null;
            TimelinesData = null;
            PlacementViewModel = null;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\ViewModels\TimelineSegmentsContainerViewModel.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Behaviors;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.ViewModels
{
    public class TimelineSegmentsContainerViewModel : NotifyBase, IMouseCaptureProxy, IDrop
    {
        public event EventHandler Initialized;
        public event EventHandler<TimelineSegmentsContainerViewModel> Focused;
        public event EventHandler<TimelineSegmentViewModel> SelectedSegment;
        public FrameworkElement Object { get; set; }

        private bool _isInitialized;

        public bool IsInitialized
        {
            get { return _isInitialized; }
            set 
            {
                _isInitialized = value;
                OnPropertyChanged();
            }
        }

        public string ElementName
        {
            get
            {
                if (Object != null)
                    return Object.Name;
                return Model.Name;
            }
        }


        private double _panelX;

        public double PanelX
        {
            get { return _panelX; }
            set
            {
                _panelX = value;
                OnPropertyChanged();
            }
        }

        private double _panelY;

        public double PanelY
        {
            get { return _panelY; }
            set
            {
                _panelY = value;
                OnPropertyChanged();
            }
        }


        private double _actualWidth;

        public double ActualWidth
        {
            get { return _actualWidth; }
            set
            {
                _actualWidth = value;
                OnPropertyChanged();
            }
        }

        private TimeSpan _fullTime;

        public TimeSpan FullTime
        {
            get { return _fullTime; }
            set
            {
                _fullTime = value;
                OnPropertyChanged();
            }
        }

        private bool _loaded = false;
        public ObservableCollection<TimelineSegmentViewModel> Segments { get; set; } = new ObservableCollection<TimelineSegmentViewModel>();

        public event EventHandler Capture;
        public event EventHandler Release;

        public RelayCommand Loaded_Command => new RelayCommand(obj =>
        {
            if (!_loaded)
            {
                ActualWidth = ((FrameworkElement)obj).ActualWidth;
                Initialize(Model.Segments);
                ((FrameworkElement)obj).SizeChanged += Container_SizeChanged;
                _loaded = true;
            }
        });

        public RelayCommand Unloaded_Command => new RelayCommand(obj =>
        {
            if (_loaded)
            {
                ((FrameworkElement)obj).SizeChanged -= Container_SizeChanged;
            }
        });

        private void Container_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            if (e.NewSize.Width != e.PreviousSize.Width && e.PreviousSize != null)
            {
                ActualWidth = e.NewSize.Width;
                ReRenderElements(e.NewSize, e.PreviousSize);
            }
        }

        private void ReRenderElements(Size newSize, Size prevSize)
        {
            if (_loaded)
            {
                var offsetPercents = (newSize.Width / (prevSize.Width / 100)) / 100.0;


                var elemWidths = new Dictionary<TimelineSegmentViewModel, List<double>>();
                bool isNotPossible = false;
                foreach (var segment in Segments)
                {
                    var newWidth = segment.Width * offsetPercents;
                    var newStartPoint = (double)segment.Left * offsetPercents;

                    elemWidths.Add(segment, new List<double>
                {
                    newWidth,
                    newStartPoint
                });

                    if (newWidth < 0)
                        isNotPossible = true;
                }

                if (!isNotPossible)
                    foreach (var elemWidth in elemWidths)
                    {
                        elemWidth.Key.Width = elemWidth.Value[0];
                        elemWidth.Key.Left = elemWidth.Value[1];
                    }
            }
        }

        public readonly ElementScenarioModel Model;
        public IToolsManager _toolsManager;
        public TimelineSegmentsContainerViewModel(FrameworkElement @object, ElementScenarioModel model, TimeSpan fullTime, IToolsManager toolsManager)
        {
            _toolsManager = toolsManager;
            FullTime = fullTime;
            Object = @object;
            FullTime = fullTime;
            Model = model;
        }

        private void Initialize(List<SegmentScenarioModel> segmentModels)
        {
            var _segments = GetSegmentsFromModels(segmentModels);
            Segments = new ObservableCollection<TimelineSegmentViewModel>(_segments);
            OnPropertyChanged("Segments");
            IsInitialized = true;
            Initialized?.Invoke(this, new EventArgs());
            Model.ElementsUpdated += Model_ElementsUpdated;
        }
       

        private void Model_ElementsUpdated(object sender, SegmentScenarioEventArgs e)
        {
            switch (e.Mode)
            {
                case Common.Common.Mode.Add:
                    Segments.Add(AddSegmentFromModel(e.UpdatedSegmentScenario));
                    break;
                case Common.Common.Mode.Remove:
                    RemoveSegment(e.UpdatedSegmentScenario);
                    break;
                case Common.Common.Mode.Update:
                    break;
            }
        }

        private List<TimelineSegmentViewModel> GetSegmentsFromModels(List<SegmentScenarioModel> segmentModels)
        {
            var segments = new List<TimelineSegmentViewModel>();
            foreach (var model in segmentModels)
            {
               var segment = AddSegmentFromModel(model);
               segments.Add(segment);
            }
            return segments;
        }

        private TimelineSegmentViewModel AddSegmentFromModel(SegmentScenarioModel model)
        {
            ITimelineElement timelineElement = GetTimelineElementFromModel(model);
            double left = timelineElement.From.TotalSeconds * (ActualWidth / FullTime.TotalSeconds);
            double width = timelineElement.To.TotalSeconds * (ActualWidth / FullTime.TotalSeconds) - left;

            TimelineSegmentViewModel segment = new TimelineSegmentViewModel(this, timelineElement, SegmentTypes.Regular, model, _toolsManager)
            {
                Brush = timelineElement.Brush,
                Left = left,
                Width = width,
                Height = 20
            };
            segment.MouseDown += Segment_MouseDown;
            segment.MouseUp += Segment_MouseUp;
            segment.OnRemove += Segment_OnRemove;
            return segment;
        }

        private void Segment_OnRemove(object sender, TimelineSegmentViewModel e)
        {
            Model.RemoveElementScenario(e.Model);
        }

        private void RemoveSegment(SegmentScenarioModel model)
        {
            var segment = Segments.FirstOrDefault(f => f.Model == model);
            if (segment != null)
            {
                if (_toolsManager.SelectedTool != null)
                    if (_toolsManager.SelectedTool.ID == model.ID)
                        _toolsManager.SelectedTool = null;
                segment.MouseDown -= Segment_MouseDown;
                segment.MouseUp -= Segment_MouseUp;
                segment.OnRemove -= Segment_OnRemove;
                Segments.Remove(segment);
            }
        }

        private TimelineSegmentViewModel _currentSegment = null;

        public TimelineSegmentViewModel CurrentSegment
        {
            get { return _currentSegment; }
            set
            {
                _currentSegment = value;
                OnPropertyChanged();
            }
        }

        private GripType _actualGripType;
        private void Segment_MouseDown(object sender, SegmentEventArgs e)
        {
            _actualGripType = e.Grip;
            CurrentSegment = e.ViewModel;
            SelectedSegment?.Invoke(this, e.ViewModel);
            Focused?.Invoke(this, this);
        }
        private void Segment_MouseUp(object sender, SegmentEventArgs e)
        {

        }

        private ITimelineElement GetTimelineElementFromModel(SegmentScenarioModel model)
        {
            ITimelineElement timelineElement = null;
            ITool tool = _toolsManager.GetTool(this, model);

            if (tool != null)
            {
                tool.AssociatedObject = Object;
                switch (model.SegmentType)
                {
                    case SegmentTypes.Regular:
                        timelineElement = new RegularTimelineElement(tool, model);
                        break;
                    case SegmentTypes.Simple:
                        timelineElement = new SingleTimelineElement(tool, model);
                        break;
                }
                return timelineElement;
            }

            return null;
        }

        private bool _captured;
        private Point offset;//для сдвига точки внутри активного элемента
        public void OnMouseDown(object sender, MouseCaptureArgs e)
        {
            if (_currentSegment != null)
            {
                var currentLeftAngle = new Point(_currentSegment.Left, 0);
                var point = new Point(e.X, 0);
                //point = elli.TranslatePoint(point, canva);
                offset = new Point(point.X - currentLeftAngle.X, 0);
                _captured = true;
                Capture?.Invoke(this, new EventArgs());
            }
        }

        public void OnMouseMove(object sender, MouseCaptureArgs e)
        {
            if (_currentSegment != null)
            {
                if (_captured)
                {
                    switch (_actualGripType)
                    {
                        case GripType.Left:
                            var offsetLeft = _currentSegment.Left - e.X;
                            _currentSegment.Left = e.X;
                            _currentSegment.Element.From = TimeSpan.FromSeconds(e.X / (ActualWidth / FullTime.TotalSeconds));
                            _currentSegment.Width += offsetLeft;
                            break;
                        case GripType.Right:
                            _currentSegment.Width = e.X - _currentSegment.Left;
                            _currentSegment.Element.To = TimeSpan.FromSeconds((_currentSegment.Left + _currentSegment.Width) / (ActualWidth / FullTime.TotalSeconds));
                            break;
                        case GripType.Full:
                            _currentSegment.Left = e.X - offset.X;
                            _currentSegment.Element.From = TimeSpan.FromSeconds(_currentSegment.Left / (ActualWidth / FullTime.TotalSeconds));
                            _currentSegment.Element.To = TimeSpan.FromSeconds((_currentSegment.Left + _currentSegment.Width) / (ActualWidth / FullTime.TotalSeconds));
                            break;
                    }
                }
            }
        }

        public void OnMouseUp(object sender, MouseCaptureArgs e)
        {
            if (_currentSegment != null)
            {
                Focused?.Invoke(this, null);
                _currentSegment = null;
                _captured = false;
                Release?.Invoke(this, new EventArgs());
            }
        }

        public void OnDrop(object sender, DropArgs e)
        {
            string _droppedToolName = (string)e.Data.GetData(DataFormats.Text);
            if (_droppedToolName != null)
            {
                if (_droppedToolName != null && _droppedToolName != "")
                {
                    TimeSpan from = TimeSpan.FromSeconds(e.X / (ActualWidth / FullTime.TotalSeconds));
                    var to = from.Add(TimeSpan.FromSeconds(5));
                    SegmentScenarioModel newModel = ToolsModelFactory.GetToolModel(_droppedToolName);
                    newModel.ToolName = _droppedToolName;
                    newModel.From = from;
                    newModel.To = to;
                    newModel.Height = 200;
                    newModel.Width = 400;
                    newModel.Position = new Point(0, 0);
                    newModel.SegmentType = SegmentTypes.Regular;

                    ITool tool = _toolsManager.GetTool(this, newModel);

                    bool isBase = false;
                    if (tool is IBaseElement)
                        isBase = true;

                    newModel.ID = tool.ID;
                    newModel.IsBase = isBase;
                    Model.AddElementScenario(newModel);
                }
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\ViewModels\TimelineSegmentViewModel.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Behaviors;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.ViewModels;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline
{
    public class TimelineSegmentViewModel : NotifyBase
    {
        public event EventHandler<SegmentEventArgs> MouseDown;
        public event EventHandler<SegmentEventArgs> MouseUp;
        public event EventHandler<TimelineSegmentViewModel> OnRemove;

        private TimelineSegmentsContainerViewModel _parent;

        public TimelineSegmentsContainerViewModel Parent
        {
            get { return _parent; }
            set 
            {
                _parent = value;
                OnPropertyChanged();
            }
        }

        public ITimelineElement Element { get; set; }

        private Brush _brush;

        public Brush Brush
        {
            get { return _brush; }
            set 
            {
                _brush = value;
                OnPropertyChanged();
            }
        }

        private double _left;

        public double Left
        {
            get { return _left; }
            set 
            {
                _left = value;
                Right = _left + _width;
                OnPropertyChanged();
            }
        }

        private double _width;

        public double Width
        {
            get { return _width; }
            set 
            {
                _width = value;
                Right = _left + _width;
                OnPropertyChanged();
            }
        }

        private double _height;

        public double Height
        {
            get { return _height; }
            set
            {
                _height = value;
                OnPropertyChanged();
            }
        }

        private double _right;

        public double Right
        {
            get { return _right; }
            set 
            { 
                _right = value; 
                OnPropertyChanged();
            }
        }

        private bool _isSelected;

        public bool IsSelected
        {
            get { return _isSelected; }
            set 
            { 
                _isSelected = value;
                OnPropertyChanged();
            }
        }

        private bool _isActive;

        public bool IsActive
        {
            get { return _isActive; }
            set 
            {
                _isActive = value;
                OnPropertyChanged();
            }
        }

        private SegmentTypes _segmentType;

        public SegmentTypes SegmentType
        {
            get { return _segmentType; }
            set 
            { 
                _segmentType = value;
                OnPropertyChanged();
            }
        }

        public void Start()
        {
            if (!_isActive)
            {
                Element.ChangingElement.Start();
                IsActive = true;
            }
        }

        public void Stop()
        {
            if (_isActive)
            {
                if (!(Element.ChangingElement is ScenarioStopAndWait))
                    Element.ChangingElement.Stop();
                IsActive = false;
            }
        }

        public RelayCommand PreviewMouseDown_LeftGrip_Command => new RelayCommand(obj =>
        {
            MouseDown?.Invoke(this, new SegmentEventArgs(GripType.Left, this));
        });

        public RelayCommand PreviewMouseUp_LeftGrip_Command => new RelayCommand(obj =>
        {
            MouseUp?.Invoke(this, new SegmentEventArgs(GripType.Left, this));
        });

        public RelayCommand PreviewMouseDown_Command => new RelayCommand(obj =>
        {
            MouseDown?.Invoke(this, new SegmentEventArgs(GripType.Full, this));
        });

        public RelayCommand PreviewMouseUp_Command => new RelayCommand(obj =>
        {
            MouseUp?.Invoke(this, new SegmentEventArgs(GripType.Full, this));
        });

        public RelayCommand PreviewMouseDown_RightGrip_Command => new RelayCommand(obj =>
        {
            MouseDown?.Invoke(this, new SegmentEventArgs(GripType.Right, this));
        });

        public RelayCommand PreviewMouseUp_RightGrip_Command => new RelayCommand(obj =>
        {
            MouseUp?.Invoke(this, new SegmentEventArgs(GripType.Right, this));
        });

        public RelayCommand ChangingOptions_Command => new RelayCommand(obj =>
        {
            _toolsManager.ShowCurrentToolOptions(Element.ChangingElement);
        });

        public RelayCommand RemoveCommand => new RelayCommand(obj =>
        {
            OnRemove?.Invoke(this, this);
        });

        public readonly SegmentScenarioModel Model;
        private readonly IToolsManager _toolsManager;
        public TimelineSegmentViewModel(TimelineSegmentsContainerViewModel parent, ITimelineElement element, SegmentTypes segmentType, SegmentScenarioModel model, IToolsManager toolsManager)
        {
            _toolsManager = toolsManager;
            Parent = parent;
            Element = element;
            SegmentType = segmentType;
            Model = model;
        }

        public TimelineSegmentViewModel()
        {

        }
    }

    public class SegmentEventArgs : EventArgs
    {
        public GripType Grip { get; set; }
        public TimelineSegmentViewModel ViewModel { get; set; }

        public SegmentEventArgs(GripType grip, TimelineSegmentViewModel viewModel)
        {
            Grip = grip;
            ViewModel = viewModel;
        }
    }

    public enum GripType
    {
        Left,
        Right,
        Full
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Timeline\ViewModels\TimelinesViewModel.cs

using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Source.Psychophysical.LearningTasksExtension;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Timeline.ViewModels
{
    public class TimelinesViewModel : NotifyBase
    {
        public event EventHandler Initialized;

        public TimeSpan FullTime
        {
            get { return _model.FullTime; }
            set
            {
                _model.FullTime = value;
                OnPropertyChanged();
            }
        }

        private TimeSpan _currentTime;

        public TimeSpan CurrentTime
        {
            get { return _currentTime; }
            set
            {
                _currentTime = value;
                OnPropertyChanged();
            }
        }

        private TimelineSegmentsContainerViewModel _focusedTimeline;

        public TimelineSegmentsContainerViewModel FocusedTimeline
        {
            get { return _focusedTimeline; }
            set 
            {
                _focusedTimeline = value;
                OnPropertyChanged();
            }
        }

        private ObservableCollection<TimelineSegmentsContainerViewModel> _timelines = new ObservableCollection<TimelineSegmentsContainerViewModel>();

        public ObservableCollection<TimelineSegmentsContainerViewModel> Timelines
        {
            get { return _timelines; }
            set
            {
                _timelines = value;
                OnPropertyChanged();
            }
        }

        #region Commands
        public RelayCommand PlayCommand => new RelayCommand(obj =>
        {
            Play();
        });

        public RelayCommand StopCommand => new RelayCommand(obj =>
        {
            Stop();
        });

        public RelayCommand PauseCommand => new RelayCommand(obj =>
        {
            Pause();
        });

        public RelayCommand RestartCommand => new RelayCommand(obj =>
        {
            Restart();
        });

        #endregion

        private FrameworkElement _content;
        private StudyAssignmentModel _model;
        private IToolsManager _toolsManager;
        public TimelinesViewModel(FrameworkElement content, StudyAssignmentModel model, IToolsManager toolsManager)
        {
            _toolsManager = toolsManager;
            _content = content;
            _model = model;
            Initialize();
        }

        private void Initialize()
        {
            _toolsManager.RootTimer.Interval = TimeSpan.FromMilliseconds(50);
            _toolsManager.RootTimer.Tick += _timer_Tick;

            ILearning learningControl = (ILearning)_content;
            _toolsManager.UsedMethods = learningControl.TestMethods;

            foreach (ElementScenarioModel model in _model.Elements)
            {
                var oneElement = learningControl.UsedElements.FirstOrDefault(f => f.Name == model.Name);
                if (oneElement == null && model.Name != "Common" &&
                                          model.Name != "Audio" &&
                                          model.Name != "Media" &&
                                          model.Name != "Text" &&
                                          model.Name != "Arrow")
                    throw new Exception("Element not found");
                else
                    AddTimeline(oneElement, model, FullTime);
            }
            _model.ElementsUpdated += _model_ElementsUpdated;
            _toolsManager.SelectingTool += _toolsManager_SelectingTool;
        }

        private void _model_ElementsUpdated(object sender, ElementScenarioEventArgs e)
        {
            switch (e.Mode)
            {
                case Common.Common.Mode.Add:
                    var oneElement = (FrameworkElement)_content.FindName(e.UpdatedElementScenario.Name);
                    if (oneElement == null)
                        throw new Exception("Element not found");
                    else
                        AddTimeline(oneElement, e.UpdatedElementScenario, FullTime);
                    break;
                case Common.Common.Mode.Remove:
                    RemoveTimeline(e.UpdatedElementScenario);
                    break;
                case Common.Common.Mode.Update:
                    break;
            }
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            CurrentTime = _currentTime.Add(TimeSpan.FromMilliseconds(50));
            for (int i = 0; i < Timelines.Count; i++)
            {
                for (int j = 0; j < Timelines[i].Segments.Count; j++)
                {
                    var segment = Timelines[i].Segments[j];
                    if (CurrentTime >= segment.Element.From && CurrentTime < segment.Element.To && !segment.IsActive)
                    {
                        segment.Start();
                    }

                    if (CurrentTime >= segment.Element.To && segment.IsActive)
                    {
                        segment.Stop();
                    }
                }
            }


            if (CurrentTime == FullTime)
            {
                Stop();
            }
        }

        public void Play()
        {
            _toolsManager.RootTimer.Start();
        }

        public void Pause()
        {
            _toolsManager.RootTimer.Stop();
        }

        public void Stop()
        {
            _toolsManager.RootTimer.Stop();
            foreach (var timeline in Timelines)
            {
                foreach (var segment in timeline.Segments)
                {
                    segment.IsActive = false;
                    segment.Element.ChangingElement.Stop();
                }
            }
            CurrentTime = TimeSpan.FromSeconds(0);
        }

        public void Restart()
        {
            Stop();
            _toolsManager.RootTimer.Start();
        }

        public void AddTimeline(FrameworkElement @object, ElementScenarioModel model, TimeSpan fulltime)
        {
            var timeline = new TimelineSegmentsContainerViewModel(@object, model, fulltime, _toolsManager);
            timeline.Focused += Timeline_Focused;
            timeline.SelectedSegment += Timeline_SelectedSegment;
            timeline.Initialized += Timeline_Initialized;
            Timelines.Add(timeline);
        }

        private void Timeline_Initialized(object sender, EventArgs e)
        {
            if (!Timelines.Any(f => !f.IsInitialized))
                Initialized?.Invoke(this, new EventArgs());
        }

        private void Timeline_Focused(object sender, TimelineSegmentsContainerViewModel e)
        {
            FocusedTimeline = e;
        }

        public void RemoveTimeline(ElementScenarioModel model)
        {
            var existViewModel = Timelines.FirstOrDefault(f => f.Model == model);
            if (existViewModel != null)
            {
                if (existViewModel == FocusedTimeline)
                    FocusedTimeline = null;
                existViewModel.Focused -= Timeline_Focused;
                existViewModel.SelectedSegment -= Timeline_SelectedSegment;
                existViewModel.Initialized -= Timeline_Initialized;
                Timelines.Remove(existViewModel);
            }
        }

        private TimelineSegmentViewModel _currentSelectedSegment = null;

        private void Timeline_SelectedSegment(object sender, TimelineSegmentViewModel e)
        {
            if (_toolsManager.SelectedTool != null)
            {
                if (_toolsManager.SelectedTool.ID != e.Element.ChangingElement.ID)
                {
                    TimelineSegmentViewModel oldValue = GetTimelineSegment(_toolsManager.SelectedTool.ID);
                    if(oldValue!=null)
                    oldValue.IsSelected = false;
                    if (oldValue != e)
                    {
                        if (_currentSelectedSegment != null)
                            _currentSelectedSegment.IsSelected = false;
                        _currentSelectedSegment = e;
                        e.IsSelected = true;
                        _toolsManager.SelectTool(this, e.Element.ChangingElement);
                    }
                }
            }
            else
            {
                if (_currentSelectedSegment != null)
                    _currentSelectedSegment.IsSelected = false;
                _currentSelectedSegment = e;
                e.IsSelected = true;
                _toolsManager.SelectTool(this, e.Element.ChangingElement);
            }
        }

        private void _toolsManager_SelectingTool(object sender, ITool e)
        {
            if (sender != this)
            {
                if (e != null)
                {
                    if (_currentSelectedSegment != null)
                        _currentSelectedSegment.IsSelected = false;
                    if (e != null)
                    {
                        TimelineSegmentViewModel newSelectedSegment = GetTimelineSegment(e.ID);
                        _currentSelectedSegment = newSelectedSegment;
                        if (newSelectedSegment != null)
                            _currentSelectedSegment.IsSelected = true;
                    }
                    else
                        _currentSelectedSegment = null;
                }
            }
        }

        private TimelineSegmentViewModel GetTimelineSegment(string toolId)
        {
            TimelineSegmentViewModel timelineSegment = null;
            foreach (TimelineSegmentsContainerViewModel timeline in Timelines)
            {
                TimelineSegmentViewModel value = timeline.Segments.FirstOrDefault(f => f.Element.ChangingElement.ID == toolId);
                if (value != null)
                {
                    timelineSegment = value;
                    break;
                }
            }
            return timelineSegment;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Tools\ISelectable.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools
{
    public interface ISelectable : IBaseElement
    {
        event EventHandler Selected;
        Point Point { get; set; }
        bool IsSelected { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Tools\Draw\SelectedLineSegmentViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw
{
    public class SelectedLineSegmentViewModel : NotifyBase, ISelectable
    {
        public event EventHandler Selected;
        public event EventHandler<IBaseElement> PreviewMouseDown;
        public event EventHandler<IBaseElement> PreviewMouseUp;
        private bool _isSelected;
        public bool IsSelected
        {
            get { return _isSelected; }
            set
            {
                _isSelected = value;
                OnPropertyChanged();
            }
        }

        public Point Point
        {
            get => _arrow.Point;
            set
            {
                _arrow.Point = value;
                OnPropertyChanged();
            }
        }
        public Point ControlPoint1 { get { return _arrow.ControlPoint1; } set { _arrow.ControlPoint1 = value;OnPropertyChanged(); } }
        public Point ControlPoint2 { get { return _arrow.ControlPoint2; } set { _arrow.ControlPoint2 = value; OnPropertyChanged(); } }
        public Point EndPoint { get { return _arrow.EndPoint; } set { _arrow.EndPoint = value; OnPropertyChanged(); } }

        private bool _isDashed;

        public bool IsDashed
        {
            get { return _isDashed; }
            set
            {
                _isDashed = value;
                OnPropertyChanged();
            }
        }

        public double X { get; set; }
        public double Y { get; set; }
        public double Width { get; set; }
        public double Height { get; set; }

        public RelayCommand PreviewMouseDownCommand => new RelayCommand((obj) => { });

        public RelayCommand PreviewMouseUpCommand => new RelayCommand((obj) => { });

        private readonly Arrow _arrow;
        public SelectedLineSegmentViewModel(Arrow arrow)
        {
            _arrow = arrow;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Tools\Draw\Markers\ControlPointViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw.Markers
{
    public class ControlPointViewModel : NotifyBase, ISelectable
    {
        public event EventHandler Selected;
        public event EventHandler<IBaseElement> PreviewMouseDown;
        public event EventHandler<IBaseElement> PreviewMouseUp;

        public RelayCommand MouseDown => new RelayCommand((obj) =>
        {
            Selected?.Invoke(this, new EventArgs());
        });

        public Point Point
        {
            get
            {
                if (_controlNumber == 1)
                    return _model.ControlPoint1;
                else return _model.ControlPoint2;
            }
            set
            {
                if (_controlNumber == 1)
                     _model.ControlPoint1 = value;
                else  _model.ControlPoint2 = value;
                OnPropertyChanged();
            }
        }
        private bool _isSelected;
        public bool IsSelected
        {
            get { return _isSelected; }
            set
            {
                _isSelected = value;
                OnPropertyChanged();
            }
        }

        public double X { get; set; } = 0;
        public double Y { get; set; } = 0;
        public double Width { get; set; }
        public double Height { get; set; }

        public RelayCommand PreviewMouseDownCommand => new RelayCommand((obj) => { });

        public RelayCommand PreviewMouseUpCommand => new RelayCommand((obj) => { });

        private readonly SelectedLineSegmentViewModel _model;
        private readonly int _controlNumber;
        public ControlPointViewModel(SelectedLineSegmentViewModel model, int controlNumber)
        {
            _model = model;
            _controlNumber = controlNumber;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Tools\Draw\Markers\PointMarkerViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw.Markers
{
    public class PointMarkerViewModel : NotifyBase, ISelectable
    {
        public event EventHandler Selected;
        public event EventHandler<IBaseElement> PreviewMouseDown;
        public event EventHandler<IBaseElement> PreviewMouseUp;

        public RelayCommand MouseDown => new RelayCommand((obj) =>
        {
            Selected?.Invoke(this, new EventArgs());
        });

        public Point Point
        {
            get
            {
                if (_startEndNumber == 1)
                    return _model.Point;
                else return _model.EndPoint;
            }
            set
            {
                if (_startEndNumber == 1)
                    _model.Point = value;
                else _model.EndPoint = value;
                OnPropertyChanged();
            }
        }
        private bool _isSelected;
        public bool IsSelected
        {
            get { return _isSelected; }
            set
            {
                _isSelected = value;
                OnPropertyChanged();
            }
        }

        public double X { get; set; }
        public double Y { get; set; }
        public double Width { get; set; }
        public double Height { get; set; }

        public RelayCommand PreviewMouseDownCommand => new RelayCommand((obj) => { });

        public RelayCommand PreviewMouseUpCommand => new RelayCommand((obj) => { });

        private readonly SelectedLineSegmentViewModel _model;
        private readonly int _startEndNumber;
        public PointMarkerViewModel(SelectedLineSegmentViewModel model, int startEndNumber)
        {
            _model = model;
            _startEndNumber = startEndNumber;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Tools\Draw\Markers\SubLineViewModel.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Components;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw.Markers
{
    public class SubLineViewModel : NotifyBase, ISelectable
    {
        public Point Point { get; set; }
        public Point EndPoint { get; set; }
        public bool IsSelected { get; set; }
        public double X { get; set; }
        public double Y { get; set; }
        public double Width { get; set; }
        public double Height { get; set; }

        public RelayCommand PreviewMouseDownCommand => new RelayCommand((obj) => { });

        public RelayCommand PreviewMouseUpCommand => new RelayCommand((obj) => { });

        public SubLineViewModel(Point startPoint, Point endPoint)
        {
            Point = startPoint;
            EndPoint = endPoint;
        }

        public event EventHandler Selected;
        public event EventHandler<IBaseElement> PreviewMouseDown;
        public event EventHandler<IBaseElement> PreviewMouseUp;
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LearningTasksExtension\Tools\Draw\Markers\Converters\PointToMarginConverter.cs

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
using System.Windows.Markup;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw;

namespace Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Tools.Draw.Markers.Converters
{
    public class PointToMarginConverter : MarkupExtension, IValueConverter
    {
        private PointToMarginConverter _converter;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var point = (Point)value;
            return new Thickness(point.X, point.Y, 0, 0);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new PointToMarginConverter();
            return _converter;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LevelOfPerceptionOfSpeedAndDistance\LevelOfPerceptionOfSpeedAndDistanceControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.LevelOfPerceptionOfSpeedAndDistance
{
    public class LevelOfPerceptionOfSpeedAndDistanceControl : NotifyViewModelBase, ILearning, IDisposable
    {
        public event EventHandler<Dictionary<string, object>> ReturnResults;

        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private Ellipse elMove;
        private Ellipse elStatic;
        private Ellipse elPath;
        private DispatcherTimer _hideTimer = new DispatcherTimer();
        private int counter = 0;
        private bool _isTestStart = false;
        public LevelOfPerceptionOfSpeedAndDistanceControl(bool isTestStart = false, TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            _isTestStart = isTestStart;
            Initialize();
            if (Mode == TestMode.Manual)
            {
                Loaded += LevelOfPerceptionOfSpeedAndDistanceControl_Loaded;
                TestMethods.Add("PressButton", () => PressButton());
                TestMethods.Add("NewIteration", () => NewIteration());
                TestMethods.Add("Dispose", () => Dispose());
                elMove.Name = "elMove";
                elStatic.Name = "elStatic";
                UsedElements.Add(elMove);
                UsedElements.Add(elStatic);
            }
        }

        private void LevelOfPerceptionOfSpeedAndDistanceControl_Loaded(object sender, RoutedEventArgs e)
        {
            Loaded -= LevelOfPerceptionOfSpeedAndDistanceControl_Loaded;
            InitializeNewIteration();
        }

        private void Initialize()
        {
            var canva = new Canvas();
            canva.Width = canva.Height = 500;
            Canva = canva;
            
            elPath = new Ellipse()
            {
                Stroke = Brushes.LightGreen,
                Height = 400,
                Width = 400
            };

            var sizeElStaticAndMove = Math.PI * elPath.Height / 60; //т к ширина и высота одинаковы, то берем высоту и вычисляем длину окружности и делим на 60

            elStatic = new Ellipse() { Fill = Brushes.Yellow, Height = sizeElStaticAndMove, Width = sizeElStaticAndMove };
            elMove = new Ellipse() { Fill = Common.Drawing.GetColor(Common.ColorsCircle.Green), Height = sizeElStaticAndMove, Width = sizeElStaticAndMove, Stroke = Brushes.White, StrokeThickness = 1.5 };
            elMove.SetValue(Canvas.LeftProperty, -elMove.Width / 2);
            elMove.SetValue(Canvas.TopProperty, -elMove.Height / 2);
            
            elPath.Visibility = Visibility.Hidden;
            elPath.SetValue(Canvas.LeftProperty, (canva.Width - elPath.Width) / 2);
            elPath.SetValue(Canvas.TopProperty, (canva.Height - elPath.Height) / 2);

            Canva.Children.Add(elStatic);
            Canva.Children.Add(elMove);
            Canva.Children.Add(elPath);

            _hideTimer.Tick += _hideTimer_Tick;
        }

        private bool _isShowResult = false;
        private void _hideTimer_Tick(object sender, EventArgs e)
        {
            if (_isShowResult)
            {
                _hideTimer.Interval = TimeSpan.FromSeconds(2);
                elMove.Visibility = Visibility.Hidden;
                elStatic.Visibility = Visibility.Hidden;
                _isShowResult = false;
                Stop();
            }
            else
            {
                elMove.Visibility = Visibility.Visible;
                elStatic.Visibility = Visibility.Visible;
                NewIteration();
                _hideTimer.Stop();
            }
        }

        public void PressButton()
        {
            if (_isActive)
            {
                _animation.Pause();
                _animationTimer.Stop();
                var transform = (elMove.RenderTransform as TransformGroup).Children.FirstOrDefault(f => f is TranslateTransform);//находиим трансформацию, нам нужео оффсет
                var xMove = transform.Value.OffsetX + Canvas.GetLeft(elMove);//получаем местоположение эллипса
                var yMove = transform.Value.OffsetY + Canvas.GetTop(elMove);
                var xStatic = Canvas.GetLeft(elStatic);
                var yStatic = Canvas.GetTop(elStatic);
                var lenght = Math.Sqrt(Math.Pow(xMove - xStatic, 2) + Math.Pow(yMove - yStatic, 2));//вычисляем расстояние между эллипсами, по левому верхнему углу контейнеров эллипсов
                bool res = false;
                //определяем результат
                if (lenght <= elStatic.Width)
                    res = true;
                else
                    res = false;
                AddResult(res);
            }
        }

        private List<bool> _results = new List<bool>();
        private void AddResult(bool result)
        {
            if (!_isTestStart && Mode != TestMode.Manual)
            {
                _results.Add(result);
                counter++;
            }
            if (counter == 30)
            {
                int exactHits = _results.Where(w => w).Count();
                Dictionary<string, object> res = new Dictionary<string, object>()
                {
                    ["Количество точных попаданий"] = exactHits
                };
                ReturnResults?.Invoke(this, res);
            }
            else
            {
                _isShowResult = true;
                _hideTimer.Interval = TimeSpan.FromSeconds(0.5);
                _hideTimer.Start();
            }
        }
        
        private TimeSpan GeneratePositionMove_Time(double time)
        {
            var fullCircle = time * 60;
            var quarter = fullCircle / 4;//четвертая часть времени пути
            var sixth = fullCircle / 6;//шестая часть времени пути
            var timeIntervalEnd = fullCircle - sixth;
            _animationTimer.Interval = TimeSpan.FromMilliseconds(fullCircle);
            Random rnd = new Random();
            if (Mode == TestMode.Manual)
            {
                var positionInTime = (int)timeIntervalEnd + 100;
                return TimeSpan.FromMilliseconds(positionInTime);
            }
            else
            {
                var positionInTime1 = rnd.Next(0, (int)quarter);
                var positionInTime2 = rnd.Next((int)timeIntervalEnd, (int)fullCircle);
                var position = rnd.Next(0, 2);

                if (position == 0)
                    return TimeSpan.FromMilliseconds(positionInTime1);
                else
                    return TimeSpan.FromMilliseconds(positionInTime2);
            }
        }

        private void SetPositionStaticEllipse(double angle)
        {
            var x = (elPath.Width / 2) * Math.Cos(toRadians(angle));
            var y = (elPath.Height / 2) * Math.Sin(toRadians(angle));
            x = x + (Canva.Width / 2) - (elStatic.Width / 2);
            y = y + (Canva.Height / 2) - (elStatic.Height / 2);

            elStatic.SetValue(Canvas.LeftProperty, x);
            elStatic.SetValue(Canvas.TopProperty, y);
        }


        private double toRadians(double angle)
        {
            return Math.PI * angle / 180;
        }
        private DispatcherTimer _timer = new DispatcherTimer();
        private DispatcherTimer _animationTimer = new DispatcherTimer();
        private bool _isActive = false;
        public void Start()
        {
            NewIteration();
        }

        private void NewIteration()
        {
            _animationTimer.Tick += _animationTimer_Tick;
            InitializeNewIteration();
            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick += _timer_Tick;
            _timer.Start();
        }

        private void InitializeNewIteration()
        {
            Random rnd = new Random();
            SelectAngle_Random(rnd);
            int time = GetTime_Random(rnd);

            CalculateAnimation(TimeSpan.FromMilliseconds(time * 60));

            _isActive = false;
            _animation.Begin();
            _animation.Seek(GeneratePositionMove_Time(time));
            _animation.Pause();
        }

        private int GetTime_Random(Random rnd)
        {
            int using_Time = Mode != TestMode.Manual ? rnd.Next(0, 2) : 0;
            int time = using_Time == 0 ? 35 : 50;
            return time;
        }

        private void SelectAngle_Random(Random rnd)
        {
            int angle = Mode != TestMode.Manual ? rnd.Next(-120, -60) : -60;
            SetPositionStaticEllipse(angle);
        }

        private void _animationTimer_Tick(object sender, EventArgs e)
        {
            _animationTimer.Stop();
            AddResult(false);
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            _timer.Stop();
            _isActive = true;
            _animation.Resume();
            _animationTimer.Start();
        }

        private void Clear()
        {
            _isActive = false;
            if (_animationTimer != null)
            {
                _animationTimer.Stop();
                _animationTimer.Tick -= _animationTimer_Tick;
            }
            if (_animation != null)
            {
                _animation.Stop();
                _animation.Remove();
            }
            if (_timer != null)
            {
                _timer.Tick -= _timer_Tick;
                _timer.Stop();
            }
        }

        public void Stop()
        {
            Clear();
        }

        Storyboard _animation = null;
        private void CalculateAnimation(Duration time)
        {
            elMove.RenderTransformOrigin = new Point(0.5, 0.5);
            TransformGroup tg = new TransformGroup();
            tg.Children.Add(new ScaleTransform());
            tg.Children.Add(new SkewTransform());
            tg.Children.Add(new RotateTransform());
            tg.Children.Add(new TranslateTransform());
            elMove.RenderTransform = tg;

            PathGeometry pG = new PathGeometry();

            Geometry gm = elPath.RenderedGeometry.GetFlattenedPathGeometry();
            pG.Transform = new TranslateTransform(50, 50);
            pG.AddGeometry(gm);

            DoubleAnimationUsingPath DAUPX = new DoubleAnimationUsingPath
            {
                PathGeometry = pG,
                Duration = time,
                Source = PathAnimationSource.X
            };
            Storyboard.SetTarget(DAUPX, elMove);
            Storyboard.SetTargetProperty(DAUPX,
                new PropertyPath("(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)"));

            DoubleAnimationUsingPath DAUPY = new DoubleAnimationUsingPath
            {
                PathGeometry = pG,
                Duration = time,
                Source = PathAnimationSource.Y
            };
            Storyboard.SetTarget(DAUPY, elMove);
            Storyboard.SetTargetProperty(DAUPY,
                new PropertyPath("(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"));
            _animation = new Storyboard
            {
                RepeatBehavior = RepeatBehavior.Forever,
                Children = new TimelineCollection() { DAUPX, DAUPY }
            };
        }

        public void Dispose()
        {
            Stop();
            _hideTimer.Tick -= _hideTimer_Tick;
            _hideTimer.Stop();
            elMove.Visibility = Visibility.Hidden;
            elStatic.Visibility = Visibility.Hidden;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LevelOfPerceptionOfSpeedAndDistance\LevelOfPerceptionOfSpeedAndDistanceViewModel.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.LevelOfPerceptionOfSpeedAndDistance
{
    public class LevelOfPerceptionOfSpeedAndDistanceViewModel:TestBase
    {
        public override event EventHandler<Results> Results;
        
        private PultButtons Buttons;
        private LevelOfPerceptionOfSpeedAndDistanceControl control;
        
        private bool _isShowResult = false;
        private bool _isManualStart;
        private bool _isTestStart;
        public LevelOfPerceptionOfSpeedAndDistanceViewModel(EnumTests testType, PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            TestType = testType;
            SetInstructions("levelOfPerceptionOfSpeedAndDistance");
            Manager.TraningTime = Common.GetSeconds(35);
        }

        public override FrameworkElement GetTestControl()
        {
            return new LevelOfPerceptionOfSpeedAndDistanceControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new LevelOfPerceptionOfSpeedAndDistanceControl(mode: LearningTasksExtension.TestMode.Manual);
            _isManualStart = true;
            _isTestStart = false;
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void ToDefault()
        {
            base.ToDefault();
            RegisteredResults.Clear();
        }

    
        public override void TestStart()
        {
            control = new LevelOfPerceptionOfSpeedAndDistanceControl(isTestStart: true);
            _isManualStart = false;
            _isTestStart = true;
            control.Loaded += Control_Loaded;
            TestCurrentView = control;
        }

        public override void Start()
        {
            _isTestStart = false;
            control = new LevelOfPerceptionOfSpeedAndDistanceControl();
            _isManualStart = false;
            _isTestStart = false;
            control.Loaded += Control_Loaded;
            control.ReturnResults += TestCurrentView_ReturnResults;
            TestCurrentView = control;
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Control_Loaded(object sender, RoutedEventArgs e)
        {
            control.Loaded -= Control_Loaded;
           
            Buttons = Pult as PultButtons;
            Buttons.UpdateInterval = TimeSpan.FromMilliseconds(50);
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            Buttons.Start();
            control.Start();
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception});
        }

        private Dictionary<string, object> RegisteredResults = new Dictionary<string, object>();

        private void TestCurrentView_ReturnResults(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
            Stop();
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Green)
                control.PressButton();
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.Loaded -= Control_Loaded;
                control.ReturnResults -= TestCurrentView_ReturnResults;
                control.Stop();
                control.Dispose();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\LevelOfPerceptionOfSpeedAndDistance\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LevelOfPerceptionOfSpeedAndDistance"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:LevelOfPerceptionOfSpeedAndDistanceControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:LevelOfPerceptionOfSpeedAndDistanceControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox>
                                        <ContentControl Focusable="False" Margin="5" Content="{Binding Canva, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:LevelOfPerceptionOfSpeedAndDistanceControl}}}"/>
                                    </Viewbox>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:LevelOfPerceptionOfSpeedAndDistanceControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                    DataContext="{Binding}"
                                                                    Background="{Binding Background}"
                                                                    BorderBrush="{Binding BorderBrush}"
                                                                    BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:LevelOfPerceptionOfSpeedAndDistanceViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:LevelOfPerceptionOfSpeedAndDistanceViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:LevelOfPerceptionOfSpeedAndDistanceViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\MethodAssesmentOperationMemory\Samples.cs


using System;
using System.Collections.Generic;
using Updk7.Tests.Wpf.Psychophysical.AssesmentMethodOnVolumeAttentions;

namespace Updk7.Tests.Wpf.Psychophysical.MethodAssesmentOperationMemory
{
    public class SamplesOperationMemory: ISamples
    {
        public List<Sample> SampleValues { get; private set; } = new List<Sample>()
        {
            new Sample(
                new string[8]
                   {
                        "R0C0 R2C3",
                        "R0C3 R3C1",
                        "R1C0 R3C3",
                        "R0C2 R3C0",
                        "R0C0 R3C2",
                        "R0C3 R2C0",
                        "R0C1 R3C3",
                        "R1C3 R3C0"
                   },
                TimeSpan.FromSeconds(15)),
              new Sample(
                 new string[8]
                   {
                       "R1C0 R2C2 R3C1",
                       "R0C2 R1C0 R2C1",
                       "R0C2 R1C1 R2C3",
                       "R1C2 R2C3 R3C1",
                       "R0C1 R1C3 R2C2",
                       "R1C3 R2C1 R3C2",
                       "R1C1 R2C0 R3C2",
                       "R0C1 R1C2 R2C0"
                   },
                TimeSpan.FromSeconds(15)),
               new Sample(
                 new string[8]
                   {
                       "R0C0 R1C2 R2C0 R2C1",
                       "R0C1 R0C3 R1C1 R2C2",
                       "R1C2 R1C3 R2C1 R3C3",
                       "R1C1 R2C2 R3C0 R3C2",
                       "R0C0 R0C2 R1C2 R2C1",
                       "R0C3 R1C1 R2C2 R2C3",
                       "R1C1 R2C1 R3C1 R3C3",
                       "R1C0 R1C1 R2C2 R3C0"
                   },
                TimeSpan.FromSeconds(15)),
               new Sample(
                 new string[8]
                   {
                       "R0C0 R1C0 R1C2 R2C2 R3C1",
                       "R0C2 R0C3 R1C0 R2C1 R2C2",
                       "R0C2 R1C1 R2C1 R2C3 R3C3",
                       "R1C1 R1C2 R2C3 R3C0 R3C1",
                       "R0C0 R0C1 R1C3 R2C1 R2C2",
                       "R0C3 R1C3 R1C1 R2C1 R3C2",
                       "R1C1 R1C2 R2C0 R3C2 R3C3",
                       "R0C1 R1C2 R2C2 R2C0 R3C0"
                   },
                TimeSpan.FromSeconds(15)),
               new Sample(
                 new string[8]
                   {
                       "R0C1 R0C2 R1C2 R2C0 R2C3 R3C1",
                       "R0C1 R1C0 R1C3 R2C2 R2C3 R3C1",
                       "R0C2 R1C0 R1C3 R2C1 R3C1 R3C2",
                       "R0C2 R1C0 R1C1 R2C0 R2C3 R3C2",
                       "R0C2 R1C0 R1C3 R2C0 R2C1 R3C2",
                       "R0C1 R0C2 R1C1 R2C0 R2C3 R3C2",
                       "R0C1 R1C2 R1C3 R2C3 R2C0 R3C1",
                       "R0C1 R1C0 R1C3 R2C2 R3C2 R3C1"
                   },
                TimeSpan.FromSeconds(15)),
               new Sample(
                 new string[8]
                   {
                       "R0C1 R0C3 R1C2 R2C1 R2C2 R2C3 R3C0",
                       "R0C1 R0C3 R1C2 R2C1 R2C2 R2C3 R3C0",
                       "R0C3 R1C0 R1C1 R1C2 R2C1 R3C0 R3C2",
                       "R0C0 R0C2 R1C1 R1C2 R2C0 R2C2 R3C3",
                       "R0C0 R0C2 R1C1 R2C0 R2C1 R2C2 R3C2",
                       "R0C0 R0C2 R1C1 R2C0 R2C1 R2C2 R3C3",
                       "R0C1 R0C3 R1C1 R1C2 R2C1 R2C3 R3C0",
                       "R0C0 R1C1 R1C2 R1C3 R2C2 R3C1 R3C3"
                   },
                TimeSpan.FromSeconds(20)),
                new Sample(
                 new string[8]
                   {
                       "R0C1 R0C3 R1C1 R1C2 R2C0 R2C2 R3C1 R3C3",
                       "R0C1 R1C0 R1C2 R1C3 R2C1 R2C2 R3C0 R3C3",
                       "R0C0 R0C2 R1C1 R1C3 R2C1 R2C2 R3C0 R3C2",
                       "R0C0 R0C3 R1C1 R1C2 R2C0 R2C1 R2C3 R3C2",
                       "R0C2 R1C0 R1C1 R1C3 R2C1 R2C2 R3C0 R3C3",
                       "R0C0 R0C2 R1C1 R1C2 R2C1 R2C3 R3C0 R3C2",
                       "R0C0 R0C3 R1C1 R1C2 R2C0 R2C2 R2C3 R3C1",
                       "R0C1 R0C3 R1C0 R1C2 R2C1 R2C2 R3C1 R3C3"
                   },
                TimeSpan.FromSeconds(20)),
                 new Sample(
                new string[8]
                   {
                       "R0C1 R0C2 R1C0 R1C2 R1C3 R2C1 R3C1 R3C2 R3C3",
                       "R0C2 R1C0 R1C1 R1C3 R2C0 R2C2 R2C3 R3C0 R3C2",
                       "R0C0 R0C1 R0C2 R1C2 R2C0 R2C1 R2C3 R3C1 R3C2",
                       "R0C1 R0C3 R1C0 R1C1 R1C3 R2C0 R2C2 R2C3 R3C1",
                       "R0C1 R1C0 R1C2 R1C3 R2C0 R2C1 R2C3 R3C1 R3C3",
                       "R0C1 R0C2 R1C0 R1C1 R1C3 R2C2 R3C0 R3C1 R3C2",
                       "R0C0 R0C2 R1C0 R1C2 R1C3 R2C0 R2C1 R2C3 R3C2",
                       "R0C1 R0C2 R0C3 R1C1 R2C0 R2C2 R2C3 R3C1 R3C2"
                   },
                TimeSpan.FromSeconds(25)),
        };
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\MethodCriticalFrequencyLightFlares\MethodCriticalFrequencyLightFlaresControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.MethodCriticalFrequencyLightFlares
{
    public class MethodCriticalFrequencyLightFlaresControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler StartBlinkUp;
        public event EventHandler StartBlinkDown;
        public event EventHandler<Dictionary<string, object>> ReturnResults;

        public List<int> _resultsLightFlares = new List<int>();
        public DispatcherTimer _transitionTimer = new DispatcherTimer();
        private string _numberCycle;
        public string NumberCycle
        {
            get { return _numberCycle; }
            set
            {
                _numberCycle = value;
                OnPropertyChanged();
            }
        }

        private bool _isInstruction;

        public bool IsInstruction
        {
            get { return _isInstruction; }
            set 
            { 
                _isInstruction = value;
                OnPropertyChanged();
            }
        }


        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        public MethodCriticalFrequencyLightFlaresControl(bool isInstruction = false, TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            IsInstruction = isInstruction;
            NumberCycle = "" + 1;
        }

        public void Start()
        {
            _transitionTimer.Interval = TimeSpan.FromSeconds(5);
            _transitionTimer.Tick += _transitionTimer_Tick;
            _transitionTimer.Start();
        }

        private bool _blinkUPDown = false;
        private void _transitionTimer_Tick(object sender, EventArgs e)
        {
            _transitionTimer.Stop();
            if (!_blinkUPDown)
            {
                StartBlinkUp?.Invoke(this, new EventArgs());
            }
            else
            {
                StartBlinkDown?.Invoke(this, new EventArgs());
            }
        }

        public void Stop()
        {
            _transitionTimer.Tick -= _transitionTimer_Tick;
            _transitionTimer.Stop();
        }

        private bool? _oldBlink = null;
        public void PressedButton(int frequency)
        {
            _resultsLightFlares.Add(frequency);
            if (_resultsLightFlares.Count != 6)
            {
                _transitionTimer.Start();
                _oldBlink = _blinkUPDown;
                _blinkUPDown = !_blinkUPDown;

                if (_oldBlink != null && _oldBlink.Value == true)
                {
                    var number = int.Parse(NumberCycle);
                    number++;
                    NumberCycle = $"{number}";
                }
            }
            else
            {
                SetResults();
            }
        }

        private void SetResults()
        {
            var averageUp = new List<int>() { _resultsLightFlares[0], _resultsLightFlares[2], _resultsLightFlares[4] }.Average();
            var averageDown = new List<int>() { _resultsLightFlares[1], _resultsLightFlares[3], _resultsLightFlares[5] }.Average();
            ReturnResults?.Invoke(this, new Dictionary<string, object>()
            {
                ["Частота нарастающих мельканий на 1-ом цикле"] = _resultsLightFlares[0],
                ["Частота нарастающих мельканий на 2-ом цикле"] = _resultsLightFlares[2],
                ["Частота нарастающих мельканий на 3-ом цикле"] = _resultsLightFlares[4],
                ["Частота убывающих мельканий на 1-ом цикле"] = _resultsLightFlares[1],
                ["Частота убывающих мельканий на 2-ом цикле"] = _resultsLightFlares[3],
                ["Частота убывающих мельканий на 3-ом цикле"] = _resultsLightFlares[5],
                ["Средняя частота по всем нарастающим мельканиям"] = (int)averageUp,
                ["Средняя частота по всем убывающим мельканиям"] = (int)averageDown,
                ["Средняя частота по всем циклам"] = (int)(_resultsLightFlares.Count > 0 ? _resultsLightFlares.Average() : 0.0)
            });
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\MethodCriticalFrequencyLightFlares\MethodCriticalFrequencyLightFlaresViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.MethodCriticalFrequencyLightFlares
{
    public class MethodCriticalFrequencyLightFlaresViewModel : TestBase
    {
        public override event EventHandler<Results> Results;
        
        private PultBlinkDown BlinkDown;
        private PultBlinkUp BlinkUp;
        private MethodCriticalFrequencyLightFlaresControl control;
        public MethodCriticalFrequencyLightFlaresViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            Manager.TraningTime = Common.GetSeconds(32);
            SetInstructions("мethodCriticalFrequencyLightFlares");
        }

        public override FrameworkElement GetTestControl()
        {
            return new MethodCriticalFrequencyLightFlaresControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new MethodCriticalFrequencyLightFlaresControl(isInstruction: true, mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            control = new MethodCriticalFrequencyLightFlaresControl();
            TestCurrentView = control;
            BlinkDown = Pult as PultBlinkDown;
            BlinkUp = AdditionalPult as PultBlinkUp;
            BlinkDown.ButtonPressed += BlinkDown_ButtonPressed;
            BlinkUp.ButtonPressed += BlinkUp_ButtonPressed;
            BlinkDown.Disconnected += Disconnected;
            BlinkUp.Disconnected += Disconnected;
            control.StartBlinkDown += Control_StartBlinkDown;
            control.StartBlinkUp += Control_StartBlinkUp;
            control.Start();
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override void Start()
        {
            control = new MethodCriticalFrequencyLightFlaresControl();
            TestCurrentView = control;
            BlinkDown = Pult as PultBlinkDown;
            BlinkUp = AdditionalPult as PultBlinkUp;
            BlinkDown.ButtonPressed += BlinkDown_ButtonPressed;
            BlinkUp.ButtonPressed += BlinkUp_ButtonPressed;
            BlinkDown.Disconnected += Disconnected;
            BlinkUp.Disconnected += Disconnected;
            control.ReturnResults += TestCurrentView_ReturnResults;
            control.StartBlinkDown += Control_StartBlinkDown;
            control.StartBlinkUp += Control_StartBlinkUp;
            control.Start();
        }

        private void Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception});
        }

        private void Control_StartBlinkUp(object sender, EventArgs e)
        {
            BlinkDown.Stop();
            BlinkUp.Start();
        }

        private void Control_StartBlinkDown(object sender, EventArgs e)
        {
            BlinkUp.Stop();
            BlinkDown.Start();
        }


        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void TestCurrentView_ReturnResults(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void BlinkUp_ButtonPressed(object sender, BlinkUpButtonPressedEvevntArgs e)
        {
            control.PressedButton(e.StopFrequency);
        }

        private void BlinkDown_ButtonPressed(object sender, BlinkDownButtonPressedEventArgs e)
        {
            control.PressedButton(e.StopFrequency);
        }

        public override void Stop()
        {
            base.Stop();
            if (BlinkDown != null)
            {
                BlinkDown.Disconnected -= Disconnected;
                BlinkDown.ButtonPressed -= BlinkDown_ButtonPressed;
                BlinkDown.Stop();
            }
            if (BlinkUp != null)
            {
                BlinkUp.Disconnected -= Disconnected;
                BlinkUp.ButtonPressed -= BlinkUp_ButtonPressed;
                BlinkUp.Stop();
            }
            if (control != null)
            {
                control.StartBlinkDown -= Control_StartBlinkDown;
                control.StartBlinkUp -= Control_StartBlinkUp;
                control.ReturnResults -= TestCurrentView_ReturnResults;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\MethodCriticalFrequencyLightFlares\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.MethodCriticalFrequencyLightFlares"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:MethodCriticalFrequencyLightFlaresControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:MethodCriticalFrequencyLightFlaresControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox x:Name="testView" Opacity="1.0">
                                        <Canvas Height="450" Width="800">
                                            <Path Data="M169.36418,186.13619 C169.36418,186.13619 130.72697,198.63611 101.18152,223.63611 
                                                  139.81771,225.90913 145.49999,222.49974 145.49999,222.49974 L129.59073,266.81781 C129.59073,266.81781
                                                  163.68264,231.59091 192.09179,225.90909 180.49126,196.6171 170.16435,189.39419 169.36418,186.13619 z"
                                                  Fill="#FFF4F4F5"
                                                  HorizontalAlignment="Left" 
                                                  Stretch="Fill" 
                                                  Stroke="Black"
                                                  Width="91.909"
                                                  Canvas.Left="111.922" 
                                                  Canvas.Top="190.431"/>
                                            <Path Data="M627.81818,185.5 C627.81818,185.5 698.90927,213.40922 706.86382,223.63649 683.00011,224.77267
                                                  664.81833,227.04539 664.81833,227.04539 L686.4092,259.99956 C686.4092,259.99956 625.04564,225.90902 
                                                  611.4093,227.04539 617.09119,211.13632 627.81818,185.5 627.81818,185.5 z"
                                                  Fill="#FFF4F4F5"
                                                  HorizontalAlignment="Right"
                                                  Stretch="Fill"
                                                  Stroke="Black"
                                                  Width="96.455"
                                                  Canvas.Left="608.95"
                                                  Canvas.Top="186.136"/>
                                            <Path Data="M183.5,199.5 L193.5,194.5 316.5,404.5 306,407.5 z"
                                                  Fill="#FFFFAF22"
                                                  HorizontalAlignment="Left"
                                                  Margin="183.5,194.5,0,10.5" 
                                                  Stretch="Fill"
                                                  Stroke="Black"
                                                  Width="134"/>
                                            <Path Data="M598.45208,191.5 L610.5,190 525.58801,403 514.5,398.5 z"
                                                  Fill="#FFFFAF22"
                                                  HorizontalAlignment="Right"
                                                  Stretch="Fill" 
                                                  Stroke="Black" 
                                                  Width="91.909" 
                                                  Canvas.Left="531.623" 
                                                  Canvas.Top="186.136"/>
                                            <Path Data="M165.31818,180.95455 C165.31818,180.95455 373.90944,57.726773 636.40944,177.04495 620.50081,216.81806
                                                  612.54579,240.68178 612.54579,240.68178 612.54579,240.68178 397.5003,158.49972 205.5002,251.49999 
                                                  189.5911,223.09065 165.31818,180.95455 165.31818,180.95455 z" 
                                                  Fill="#FFF4F4F5"
                                                  Margin="165.318,125.01,154.591,166.5" 
                                                  Stretch="Fill"
                                                  Stroke="Black"/>
                                            <TextBlock Text="Цикл:"
                                                       VerticalAlignment="Top" 
                                                       FontSize="40"
                                                       Canvas.Left="335.387"
                                                       Canvas.Top="142.972"/>
                                            <TextBlock Text="{Binding NumberCycle,
                                                              RelativeSource={RelativeSource FindAncestor,
                                                              AncestorType={x:Type local:MethodCriticalFrequencyLightFlaresControl}}}"
                                                       VerticalAlignment="Top"
                                                       FontSize="40"
                                                       Canvas.Left="442.947"
                                                       Canvas.Top="142.972"/>
                                            <TextBlock Text="Внимательно смотрите на светодиод!" 
                                                       VerticalAlignment="Top"
                                                       Canvas.Left="144.375" 
                                                       Canvas.Top="65.528"
                                                       FontSize="30"
                                                       Foreground="White"/>
                                        </Canvas>
                                    </Viewbox>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:MethodCriticalFrequencyLightFlaresControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                    DataContext="{Binding}"
                                                                    Background="{Binding Background}"
                                                                    BorderBrush="{Binding BorderBrush}"
                                                                    BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsInstruction, RelativeSource={RelativeSource Self}}" Value="True">
                            <Setter TargetName="testView" Property="Opacity" Value="0.0"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:MethodCriticalFrequencyLightFlaresViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:MethodCriticalFrequencyLightFlaresViewModel">
                    <ContentControl>
                        <Grid Background="#FF424242">
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:MethodCriticalFrequencyLightFlaresViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReactionToAMovingObject\Indicator.cs


using System;
using System.Windows;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.ReactionToAMovingObject
{
    public class Indicator : FrameworkElement
    {
        public ColorsCircle Color { get; set; }

        private Brush GetColorCircle(ColorsCircle color)
        {
            switch (color)
            {
                case ColorsCircle.Red:
                    return Brushes.Red;
                case ColorsCircle.Green:
                    return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF59EB51"));
                case ColorsCircle.Yellow:
                    return Brushes.Yellow;
                case ColorsCircle.Default:
                    return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF454A53"));
            }
            return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF454A53"));
        }

        private bool _IsEnabledIndicator;
        public bool IsEnabledIndicator
        {
            get { return _IsEnabledIndicator; }
            set
            {
                _IsEnabledIndicator = value;
                if (_IsEnabledIndicator)
                    DrawEnableEllipse(GetColorCircle(Color));
                else
                    DrawEllipse(GetColorCircle(ColorsCircle.Default));
            }
        }

        private VisualCollection children;

        public Indicator()
        {
            children = new VisualCollection(this);
            DrawEllipse(GetColorCircle(ColorsCircle.Default));
        }

        private void DrawEllipse(Brush color)
        {
            if (children.Count > 0)
                children.RemoveAt(0);
            DrawingVisual visual = new DrawingVisual();
            children.Add(visual);
            using (DrawingContext dc = visual.RenderOpen())
            {
                //Pen drawingpen = new Pen(Brushes.Black, 0.5);
                //dc.DrawEllipse(color, drawingpen, new Point(5, 5), 5, 5);
                dc.DrawEllipse(color, null, new Point(5, 5), 5.75, 5.75);
            }
        }

        private void DrawEnableEllipse(Brush color)
        {
            if (children.Count > 0)
                children.RemoveAt(0);
            DrawingVisual visual = new DrawingVisual();
            children.Add(visual);
            using (DrawingContext dc = visual.RenderOpen())
            {
                //Pen drawingpen = new Pen(Brushes.Black, 0.5);
                //dc.DrawEllipse(color, drawingpen, new Point(5, 5), 5, 5);
                dc.DrawEllipse(color, new Pen(Brushes.White, 1), new Point(5, 5), 5.75, 5.75);
            }
        }

        protected override int VisualChildrenCount
        {
            get { return children.Count; }
        }

        protected override Visual GetVisualChild(int index)
        {
            if (index < 0 || index >= children.Count)
            {
                throw new ArgumentOutOfRangeException();
            }

            return children[index];
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReactionToAMovingObject\ReactionToAMovingObjectControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.ReactionToAMovingObject
{
    public class ReactionToAMovingObjectControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler<bool> ResetTimer;

        private string _text;
        public string Text
        {
            get { return _text; }
            set
            {
                _text = value;
                OnPropertyChanged();
            }
        }

        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private List<Indicator> _indicators = new List<Indicator>();
        public ReactionToAMovingObjectControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            Initialize();
            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("Start", () =>Start());
                TestMethods.Add("Timer_Tick_20ms", () => _timer_Tick(this, new EventArgs()));
                TestMethods.Add("Stop", () => Stop());
            }
        }

        private int _countIndicators = 60;
        private int _indexDestinationIndicator = 0;
        private int _currentIndexIndicator = 0;
        private int _startIndexIndicator = 0;
        private TimeSpan timeIntervalMilliseconds = new TimeSpan(0, 0, 0, 0, 20);

        private bool _isReadyNewCycle = false;
        private int currentPresents = 0;
        private bool _isComplete = false;

        private DispatcherTimer _timer = new DispatcherTimer(DispatcherPriority.Render);

        public void Start()
        {
            _timer.Interval = TimeSpan.FromSeconds(2);
            _timer.Tick += _timer_Tick;
            _isReadyNewCycle = true;
            if (Mode != TestMode.Manual)
                _timer.Start();
        }

        private void Initialize()
        {
            Canva = new Canvas
            {
                Width = 500,
                Height = 500
            };
            generateCircles(new Size(Canva.Width, Canva.Height), _countIndicators);
            _indexDestinationIndicator = 0;
            _destinationIndicator.IsEnabledIndicator = true;
        }

        /// <summary>
        /// Запуск нового цикла движения индикатора
        /// </summary>
        private void StartNewQuestCycle()
        {
            _indicators[_currentIndexIndicator].IsEnabledIndicator = false;
            if (Mode != TestMode.Manual)
                _currentIndexIndicator = Common._rnd.Next(15, 30);
            else
            {
                _currentIndexIndicator = 10;
            }
            _startIndexIndicator = _currentIndexIndicator;
            _indicators[_currentIndexIndicator].IsEnabledIndicator = true;
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            if (!_isReadyNewCycle)
            {
                _indicators[_currentIndexIndicator].IsEnabledIndicator = false;

                if (_currentIndexIndicator < _indicators.Count - 1)
                    _currentIndexIndicator++;
                else
                    _currentIndexIndicator = 0;

                _indicators[_currentIndexIndicator].IsEnabledIndicator = true;

                if (_currentIndexIndicator == _startIndexIndicator)
                {
                    countPasses++;
                    _isReadyNewCycle = true;
                    _timer.Interval = TimeSpan.FromSeconds(3);
                }
                else
                    _timer.Interval = timeIntervalMilliseconds;
            }
            else
            {
                if (currentPresents < 30)
                {
                    StartNewQuestCycle();
                    _isReadyNewCycle = false;
                    _timer.Interval = timeIntervalMilliseconds;
                    if (Mode != TestMode.Manual)
                        ResetTimer?.Invoke(this, true);
                    currentPresents++;
                }
                else
                {
                    _timer.Stop();
                    ReturnResults();
                }
            }
        }

        private void ReturnResults()
        {
            _isComplete = true;
            var average = reactions.Count > 0? reactions.Average() / 1000 : 0.0;
            var middleSummReactions = reactions.Count > 0 ? (reactions.Sum(su => su) / reactions.Count) / 1000 : 0.0;
            var rms = reactions.Count > 0 ? Math.Sqrt(reactions.Sum(s => Math.Pow(s / 1000 - middleSummReactions, 2)) / reactions.Count) : 0.0;

            var reactionsBeforePoint = reactions.Where(s => s < 0);
            var reactionsAfterPoint = reactions.Where(s => s > 0);

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Cреднеарифметическое время реагирования"] = (float)average,
                ["Cреднеквадратическое отклонение времени реагирования"] = (float)rms,
                ["Количество точных нажатий"] = numberExactClicks,
                ["Количество опережающих нажатий"] = leadingReactions,
                ["Количество запаздывающих нажатий"] = delayedReactions,
                ["Количество пропусков"] = countPasses,
                ["Среднее время реагирования при опережающих нажатиях"] = (float)(reactionsBeforePoint.Count() > 0 ? reactionsBeforePoint.Average() / 1000 : 0.0),
                ["Среднее время реагирования при запаздывающих нажатиях"] = (float)(reactionsAfterPoint.Count() > 0 ? reactionsAfterPoint.Average() / 1000 : 0.0)
            });
        }

        public void Stop()
        {
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
        }

        private int countPasses = 0;
        private int numberExactClicks = 0;//количество точных нажатий
        private int delayedReactions = 0;//количество опережающих реакций(рано)
        private int leadingReactions = 0;//количество запаздывающих реакций(поздно)
        private List<double> reactions = new List<double>();
        int counter = 0;
        public void PressButton(int time)
        {
            if (!_isComplete)
            {
                if (!_isReadyNewCycle)
                {
                    _timer.Stop();
                    var curTime = TimeSpan.FromMilliseconds(time / 10.0).TotalMilliseconds;

                    if (_currentIndexIndicator <= _indicators.Count - 1 && _startIndexIndicator <= _currentIndexIndicator)
                    {
                        leadingReactions++;
                        reactions.Add(-(_indicators.Count - 1 - _currentIndexIndicator) * 20.0);
                    }
                    else if (_currentIndexIndicator > 0 && _startIndexIndicator > _currentIndexIndicator)
                    {
                        delayedReactions++;
                        reactions.Add(_currentIndexIndicator * 20);
                    }
                    else if (_currentIndexIndicator == _indexDestinationIndicator)
                        numberExactClicks++;

                    _isReadyNewCycle = true;
                    _timer.Interval = TimeSpan.FromSeconds(3);
                    if (Mode != TestMode.Manual)
                        _timer.Start();
                }
            }
        }

        private Indicator _destinationIndicator;
        private void generateCircles(Size canvasSize, int countCircles = 60)
        {
            var center = Canva.Height / 2.5;
            var angle = 360 / countCircles;
            Point centerPoint = new Point(center, 0);
            for (int i = 270; i < 360; i = i + angle)
            {
                var color = ColorsCircle.Green;
                var indicator = generateCircle(centerPoint, i, canvasSize, color);
                indicator.Color = color;
                Canva.Children.Add(indicator);
                _indicators.Add(indicator);
            }

            for (int i = 0; i < 270; i = i + angle)
            {
                var color = ColorsCircle.Green;
                var indicator = generateCircle(centerPoint, i, canvasSize, color);
                indicator.Color = color;
                Canva.Children.Add(indicator);
                _indicators.Add(indicator);
            }

            {
                var color = ColorsCircle.Green;
                _destinationIndicator = generateCircle(centerPoint, 270, canvasSize, color);
                _destinationIndicator.Color = color;
                Canva.Children.Add(_destinationIndicator);
            }
        }

        #region CalculatingCircles

        private Vector rotateVector(Point centerPoint, double angle)
        {
            double vX = (centerPoint.X * Math.Cos(toRadians(angle))) - (centerPoint.Y * Math.Sin(toRadians(angle)));
            double vY = (centerPoint.X * Math.Sin(toRadians(angle))) + (centerPoint.Y * Math.Cos(toRadians(angle)));
            return new Vector(vX, vY);
        }

        private double toRadians(double angle)
        {
            return (Math.PI * angle) / 180;
        }

        private Indicator generateCircle(Point centerpoint, double angle, Size canvasSize, ColorsCircle fill)
        {
            var v = rotateVector(centerpoint, angle);
            var elli = new Indicator() { Height = 10, Width = 10, Color = fill };

            //Сдвигаем точку, т. к. вектор строится от нуля
            v.X = (v.X + canvasSize.Width / 2);
            v.Y = (v.Y + canvasSize.Height / 2);

            elli.SetValue(Canvas.LeftProperty, v.X - elli.Width / 2);
            elli.SetValue(Canvas.TopProperty, v.Y - elli.Height / 2);
            return elli;
        }
        #endregion
    }

    public enum ColorsCircle
    {
        Red,
        Green,
        Yellow,
        Default
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReactionToAMovingObject\ReactionToAMovingObjectViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.ReactionToAMovingObject
{
    public class ReactionToAMovingObjectViewModel : TestBase
    {
        public override event EventHandler<Results> Results;

        private ReactionToAMovingObjectControl control;
        private Pult.PultButtons Buttons;
        public ReactionToAMovingObjectViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("reactionToAMovingObject");
            Manager.TraningTime = TimeSpan.FromSeconds(20);
        }

        public override FrameworkElement GetTestControl()
        {
            return new ReactionToAMovingObjectControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new ReactionToAMovingObjectControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }
        public override void TestStart()
        {
            control = new ReactionToAMovingObjectControl();
            TestCurrentView = control;

            Buttons = Pult as PultButtons;
            Buttons.UpdateInterval = TimeSpan.FromMilliseconds(10);
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;

            control.ResetTimer += Control_ResetTimer;
            control.Start();
        }

        public override void Start()
        {
            control = new ReactionToAMovingObjectControl();
            TestCurrentView = control;

            Buttons = Pult as PultButtons;
            Buttons.UpdateInterval = TimeSpan.FromMilliseconds(10);
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;

            control.Results += Control_Results;
            control.ResetTimer += Control_ResetTimer;
            control.Start();
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Control_ResetTimer(object sender, bool e)
        {
            Buttons.Start();
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Green)
                control.PressButton(e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.Results -= Control_Results;
                control.ResetTimer -= Control_ResetTimer;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReactionToAMovingObject\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.ReactionToAMovingObject"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:ReactionToAMovingObjectControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReactionToAMovingObjectControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox>

                                        <ContentControl Focusable="False"
                                                        Margin="5"
                                                        Content="{Binding Canva, 
                                                                  RelativeSource={RelativeSource FindAncestor, 
                                                                  AncestorType={x:Type local:ReactionToAMovingObjectControl}}}"/>
                                    </Viewbox>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:ReactionToAMovingObjectControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                    DataContext="{Binding}"
                                                                    Background="{Binding Background}"
                                                                    BorderBrush="{Binding BorderBrush}"
                                                                    BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ReactionToAMovingObjectViewModel">
        <Setter Property="Background" Value="White"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReactionToAMovingObjectViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:ReactionToAMovingObjectViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessAssessmentTesting\Indicator.cs


using System.Windows.Media;
using static Updk7.Tests.Wpf.Psychophysical.Common;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessAssessmentTesting
{
    public class Indicator : NotifyViewModelBase
    {
        private Brush _IndicationColor;
        public Brush IndicationColor
        {
            get { return _IndicationColor; }
            set
            {
                _IndicationColor = value;
                OnPropertyChanged();
            }
        }

        private ColorsCircle _color;
        public ColorsCircle Color
        {
            get { return _color; }
            set
            {
                _color = value;
                OnPropertyChanged();
            }
        }

        private bool _IsEnabledIndicator;
        public bool IsEnabledIndicator
        {
            get { return _IsEnabledIndicator; }
            set
            {
                _IsEnabledIndicator = value;
                OnPropertyChanged();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessAssessmentTesting\ReadinessAssessmentControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using static Updk7.Tests.Wpf.Psychophysical.Common;
using static Updk7.Tests.Wpf.Psychophysical.Common.Drawing;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessAssessmentTesting
{
    public class ReadinessAssessmentControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<bool> ResetTimer;
        public event EventHandler<Results> Results;

        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (IsLearningTask)
                {
                    if (_message != "")
                    {
                        _timer.Stop();
                        _messageTimer.Start();
                    }
                    OnPropertyChanged();
                }
            }
        }

        private bool _isLearningTask;

        public bool IsLearningTask
        {
            get { return _isLearningTask; }
            set 
            { 
                _isLearningTask = value;
                OnPropertyChanged();
            }
        }


        private DispatcherTimer _couldownTimer = new DispatcherTimer();
        private Indicator _currentIndicator = null;
        private Indicator _currentLongLightIndicator = null;
       
        private List<Indicator> _indicators = new List<Indicator>();

        //Текущий индикатор длинного сигнала
        private bool _IsCurrentCycleUsedLongLight = false;

        private int _iteration = 0;
       
        private DispatcherTimer _messageTimer = new DispatcherTimer();

        //время удлинённого сигнала
        private double _longLight = 1300;

        //время обычного сигнала
        private double _defaultLight = 800;
        private DispatcherTimer _timer = new DispatcherTimer();
        private int indexCurrentIndicator = 0;
        private int? indexIndicatorLongLight = null;
        //Флаг, ислользован ли в текущем цикле(круге) длинный сигнал
        private Random rnd = new Random();

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        public ReadinessAssessmentControl(bool isLearningTask = false, TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            IsLearningTask = isLearningTask;
            Initialize();
            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("changeIndicator_800ms_or_1200ms", () => changeIndicator_800ms_or_1200ms());
            }
        }

        private int indicatorIndex = 0;
        private void changeIndicator_800ms_or_1200ms()
        {
            _indicators[indicatorIndex].IsEnabledIndicator = false;
            if (indicatorIndex == 11)
            {
                indicatorIndex = 0;
            }
            else
            {
                indicatorIndex++;
            }
            _indicators[indicatorIndex].IsEnabledIndicator = true;
        }

        /// <summary>
        /// Проверка нажатия кнопки кнопки
        /// </summary>
        /// <param name="button"></param>
        public void PressedButton(Pult.PultButton button, int time)
        {
            if (_currentLongLightIndicator != null)
            {
                if (CheckCurrentCircle(button))
                {
                    AddResult(new RegisteredResult(time / 10000.0, false, false, false));
                    _couldownTimer.Stop();
                    _currentLongLightIndicator = null;
                }
                else
                {
                    AddResult(new RegisteredResult(time / 10000.0, true, false, false));
                    if(IsLearningTask)
                       Message = "Вы выбрали кнопку неправильного цвета";
                    _couldownTimer.Stop();
                    _currentLongLightIndicator = null;
                }
            }
            else
            {
                AddResult(new RegisteredResult(time / 10000.0, false, true, false));
                if (IsLearningTask)
                    Message = "Вы среагировали не на удлиненный сигнал";
            }
        }

        public void Start()
        {
            if (IsLearningTask)
            {
                _messageTimer.Tick += _messageTimer_Tick;
                _messageTimer.Interval = TimeSpan.FromSeconds(1.5);
            }
               
            _indicators[indexCurrentIndicator].IsEnabledIndicator = true;
            _currentIndicator = _indicators[indexCurrentIndicator];
            indexIndicatorLongLight = rnd.Next(6, _indicators.Count);
            _timer.Start();
        }

        public void Stop()
        {
            _messageTimer.Tick -= _messageTimer_Tick;
            _messageTimer.Stop();
           _couldownTimer.Tick -= _couldownTimer_Tick;
            _couldownTimer.Stop();
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
        }

        private void _couldownTimer_Tick(object sender, EventArgs e)
        {
            if (IsLearningTask)
                Message = "Вы пропустили удлиненный сигнал";
            AddResult(new RegisteredResult(2.0, false, false, true));
            _couldownTimer.Stop();
            _currentLongLightIndicator = null;
        }

        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            if (IsLearningTask)
                Message = "";
            _messageTimer.Stop();
            _timer.Start();
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            _currentIndicator.IsEnabledIndicator = false;
            indexCurrentIndicator++;

            if (indexCurrentIndicator > _indicators.Count - 1)
            {
                _IsCurrentCycleUsedLongLight = false;
                indexCurrentIndicator = 0;
                _iteration++;
            }

            if (_iteration > 0 && !_IsCurrentCycleUsedLongLight)
            {
                if (_iteration != 9)
                {
                    indexIndicatorLongLight = rnd.Next(0, _indicators.Count);
                }
                else
                {
                    //Для того чтобы не выпало на последние 2 сигнала
                    indexIndicatorLongLight = rnd.Next(0, _indicators.Count - 3);
                }
                _IsCurrentCycleUsedLongLight = true;
            }

            if (indexIndicatorLongLight == indexCurrentIndicator)
            {
                _timer.Interval = TimeSpan.FromMilliseconds(_longLight);
                _currentLongLightIndicator = _indicators[indexCurrentIndicator];
                _couldownTimer.Start();
                if (Mode != TestMode.Manual)
                    ResetTimer?.Invoke(this, true);
            }
            else
            {
                _timer.Interval = TimeSpan.FromMilliseconds(_defaultLight);
            }

            _currentIndicator = _indicators[indexCurrentIndicator];
            _currentIndicator.IsEnabledIndicator = true;

            if (_iteration > 9)//_iteration начинается с 0
            {
                _couldownTimer.Stop();
                _timer.Stop();
                CalculateResults();
            }
        }

        private bool CheckCurrentCircle(Pult.PultButton button)
        {
            if (_currentLongLightIndicator != null)
            {
                var x = _currentLongLightIndicator.Color.ToString();
                var y = button.ToString();
                if (x == y)
                    return true;
                else
                    return false;
            }
            return false;
        }

        private void generateCircles(Size canvasSize, int countCircles = 12)
        {
            var center = Canva.Height / 2.5;
            var angle = 360 / countCircles;
            Point centerPoint = new Point(center, 0);
            int index = 0;
            for (int i = 270; i < 360; i = i + angle)
            {
                var color = (ColorsCircle)index;
                var indicator = generateCircle(centerPoint, i, canvasSize, GetColor(color));
                indicator.Color = color;
                Canva.Children.Add(indicator);
                _indicators.Add(indicator);
                index++;
                if (index > 2)
                    index = 0;
            }

            for (int i = 0; i < 270; i = i + angle)
            {
                var color = (ColorsCircle)index;
                var indicator = generateCircle(centerPoint, i, canvasSize, GetColor(color));
                indicator.Color = color;
                Canva.Children.Add(indicator);
                _indicators.Add(indicator);
                index++;
                if (index > 2)
                    index = 0;
            }
        }

        private List<RegisteredResult> RegisteredResults = new List<RegisteredResult>();
        private void AddResult(RegisteredResult result)
        {
            RegisteredResults.Add(result);
        }
        private void CalculateResults()
        {
            int countErrors1 = RegisteredResults.Where(w => w.Error1 == true && w.Error2 == false && w.Error3 == false).Count();
            int countErrors2 = RegisteredResults.Where(w => w.Error1 == false && w.Error2 == true && w.Error3 == false).Count();
            int countErrors3 = RegisteredResults.Where(w => w.Error1 == false && w.Error2 == false && w.Error3 == true).Count();
            var resultsNotErrors = RegisteredResults.Where(w => w.Error1 == false && w.Error2 == false && w.Error3 == false);
            var average = resultsNotErrors.Count() > 0 ? resultsNotErrors.Select(s => s.Time).Average() : 0.0;
            Results?.Invoke(this, new Results(new Dictionary<string, object>()
            {
                ["Среднее время реагирования"] = (float)average,
                ["Количество неправильных нажатий"] = countErrors1,
                ["Количество реакций не на удлиненный сигнал"] = countErrors2,
                ["Количество пропусков удлиненного сигнала"] = countErrors3,
                ["Общее количество ошибок"] = countErrors1 + countErrors2 + countErrors3
            }));
        }

        private void Initialize()
        {
            Canva = new Canvas();
            Canva.Width = 500;
            Canva.Height = 500;
            generateCircles(new Size(Canva.Width, Canva.Height));
            _timer.Interval = TimeSpan.FromMilliseconds(_defaultLight);
            _timer.Tick += _timer_Tick;
            _couldownTimer.Interval = TimeSpan.FromSeconds(2);
            _couldownTimer.Tick += _couldownTimer_Tick;
        }

        #region CalculatingCircles

        private Indicator generateCircle(System.Windows.Point centerpoint, double angle, Size canvasSize, Brush fill)
        {
            var v = rotateVector(centerpoint, angle);
            var elli = new Indicator() { Height = 20, Width = 20, IndicationColor = fill };

            //Сдвигаем точку, т. к. вектор строится от нуля
            v.X = (v.X + canvasSize.Width / 2);
            v.Y = (v.Y + canvasSize.Height / 2);

            elli.SetValue(Canvas.LeftProperty, v.X - elli.Width / 2);
            elli.SetValue(Canvas.TopProperty, v.Y - elli.Height / 2);
            return elli;
        }

        private Vector rotateVector(System.Windows.Point centerPoint, double angle)
        {
            double vX = (centerPoint.X * Math.Cos(toRadians(angle))) - (centerPoint.Y * Math.Sin(toRadians(angle)));
            double vY = (centerPoint.X * Math.Sin(toRadians(angle))) + (centerPoint.Y * Math.Cos(toRadians(angle)));
            return new Vector(vX, vY);
        }

        private double toRadians(double angle)
        {
            return (Math.PI * angle) / 180;
        }
        #endregion
    }
    public class RegisteredResult
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="time"></param>
        /// <param name="error1">нажатие кнопки, не соответствующей цвету «длинного сигнала»</param>
        /// <param name="error2">нажатие не на «длинный сигнал»</param>
        /// <param name="error3">пропуск длинного сигнала</param>
        public RegisteredResult(double time, bool? error1, bool? error2, bool? error3)
        {
            Time = time;
            Error1 = error1;
            Error2 = error2;
            Error3 = error3;
        }

        public bool? Error1 { get; private set; }
        //нажатие кнопки, не соответствующей цвету «длинного сигнала»
        public bool? Error2 { get; private set; }

        //нажатие не на «длинный сигнал»
        public bool? Error3 { get; private set; }

        public double Time { get; private set; }
        //пропуск длинного сигнала
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessAssessmentTesting\ReadinessAssessmentViewModel.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessAssessmentTesting
{
    public class ReadinessAssessmentViewModel : TestBase
    {
        public override event EventHandler<Results> Results;
        
        private ReadinessAssessmentControl control;
        private PultButtons Buttons;
        public ReadinessAssessmentViewModel(EnumTests testType,
            PultButtons instructionPult,
            IPult pult = null,
            IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            TestType = testType;
            SetInstructions("readinessAssessmentControl");
            Manager.TraningTime = Common.GetSeconds(35);
        }
        public override FrameworkElement GetTestControl()
        {
            return new ReadinessAssessmentControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new ReadinessAssessmentControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override void TestStart()
        {
            control = new ReadinessAssessmentControl(isLearningTask: true);
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += TestCurrentView_ResetTimer;
            control.Start();
            Buttons.Start();
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }
        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        public override void Start()
        {
            control = new ReadinessAssessmentControl();
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += TestCurrentView_ResetTimer;
            control.Results += Control_Results;
            control.Start();
            Buttons.Start();
        }

        private void TestCurrentView_ResetTimer(object sender, bool e)
        {
            Buttons.Start();
        }

        private void Control_Results(object sender, Results e)
        {
            Results?.Invoke(this, e);
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
             control.PressedButton(e.Button, e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.ResetTimer -= TestCurrentView_ResetTimer;
                control.Results -= Control_Results;
                control.Stop();
            }
        }

      
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessAssessmentTesting\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.ReadinessAssessmentTesting"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:ReadinessAssessmentControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReadinessAssessmentControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox>
                                        <ContentControl Focusable="False" 
                                                        Margin="5"
                                                        Content="{Binding Canva,
                                                                  RelativeSource={RelativeSource FindAncestor,
                                                                  AncestorType={x:Type local:ReadinessAssessmentControl}}}"/>
                                    </Viewbox>
                                    <tests:MessageBoxControl Message="{Binding Message,
                                                                       RelativeSource={RelativeSource FindAncestor,
                                                                       AncestorType={x:Type local:ReadinessAssessmentControl}}}"/>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:ReadinessAssessmentControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <SolidColorBrush x:Key="DefaultBrushIndicator" Color="#FF969696"/>
    <Style TargetType="{x:Type local:Indicator}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Indicator}">
                    <ContentControl>
                        <Ellipse x:Name="el" Stroke="{x:Null}" StrokeThickness="1" Fill="{StaticResource DefaultBrushIndicator}"/>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsEnabledIndicator, RelativeSource={RelativeSource Self}}" Value="false">
                            <Setter TargetName="el" Property="Fill" Value="{StaticResource DefaultBrushIndicator}"/>
                            <Setter TargetName="el" Property="StrokeThickness" Value="1"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsEnabledIndicator, RelativeSource={RelativeSource Self}}" Value="true">
                            <Setter TargetName="el" Property="Fill" 
                                    Value="{Binding IndicationColor,
                                            RelativeSource={RelativeSource FindAncestor,
                                            AncestorType={x:Type local:Indicator}}}"/>
                            <Setter TargetName="el" Property="Stroke" Value="White"/>
                            <Setter TargetName="el" Property="Margin" Value="0"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ReadinessAssessmentViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReadinessAssessmentViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:ReadinessAssessmentViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction\Indicator.cs


using System.Windows.Media;
using static Updk7.Tests.Wpf.Psychophysical.Common;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction
{
    public class Indicator : NotifyViewModelBase
    {
        private Brush _IndicationColor;
        public Brush IndicationColor
        {
            get { return _IndicationColor; }
            set
            {
                _IndicationColor = value;
                OnPropertyChanged();
            }
        }

        private ColorsCircle _color;
        public ColorsCircle Color
        {
            get { return _color; }
            set
            {
                _color = value;
                OnPropertyChanged();
            }
        }

        public double Angle { get; set; }

        private bool _IsEnabledIndicator;
        public bool IsEnabledIndicator
        {
            get { return _IsEnabledIndicator; }
            set
            {
                _IsEnabledIndicator = value;
                OnPropertyChanged();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction\ReadinessForEmergencyActionControl.cs


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Media;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using static Updk7.Tests.Wpf.Psychophysical.Common;
using static Updk7.Tests.Wpf.Psychophysical.Common.Drawing;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction
{
    public class ReadinessForEmergencyActionControl : NotifyViewModelBase, ILearning, IDisposable
    {
        public event EventHandler ResetTimer;
        public event EventHandler<Dictionary<string, object>> Results;

        private Canvas _canva;
        private Indicator _centerCircle = null;
        private int _countLeftPressed = 0;
        private int _currentIndex = 0;
        private TypeSignals _currentSignal = TypeSignals.NoActive;
        private int _indexRow = 0;
        private List<Indicator> _indicators = new List<Indicator>();
        private double _offsetTime = 0;
        private SoundPlayer _player = new SoundPlayer();
        private List<double> _reactionsAlarm = new List<double>();
        private List<double> _reactionsSignalWithWarning = new List<double>();
        private int _signalAlarmPasses = 0;
        private List<RowSignal> _signalsTable = new List<RowSignal>()
        {
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,2,03)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,2,08)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,6,00)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,13,18)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,13,22)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,18,45)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,18,49)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,25,45)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,30,03)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,30,07)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,37,06)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,44,42)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,48,30)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,48,34)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,54,51)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,58,18)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,59,03)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,59,08))
        };

        private int _signalWithWarningPasses = 0;

        private List<ResultRow> _table = new List<ResultRow>();

        private int _time = 0;

        private DispatcherTimer _timeOutTimer = new DispatcherTimer();

        private NeuroTimer _timer = new NeuroTimer();

        private RowSignal rowSignal;
        public RowSignal RowSignal
        {
            get { return rowSignal; }
            set
            {
                rowSignal = value;
                OnPropertyChanged();
            }
        }

        int? rowSignalTime = null;


        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }
        public int CurrentIndex
        {
            get { return _currentIndex; }
            set
            {
                _currentIndex = value;
                OnPropertyChanged();
            }
        }
        public List<RowSignal> SignalsTable
        {
            get { return _signalsTable; }
            set
            {
                _signalsTable = value;
                OnPropertyChanged();
            }
        }

        public List<ResultRow> Table
        {
            get { return _table; }
            set
            {
                _table = value;
                OnPropertyChanged();
            }
        }

        public int Time
        {
            get { return _time; }
            set
            {
                _time = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }
        public ReadinessForEmergencyActionControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            Initialize();
            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("Tick_1sec", () => Tick_1sec());
                TestMethods.Add("Jump", () => Tick_1sec(true));
                TestMethods.Add("Attention", () => AttentionSignal_1sec(true));
                TestMethods.Add("AttentionHide", () => AttentionSignal_1sec());
            }
        }

        private int indicatorIndex = 0;
        private void Tick_1sec(bool jump = false)
        {
            _indicators[indicatorIndex].IsEnabledIndicator = false;
            if (indicatorIndex == 59)
            {
                if (jump)
                    indicatorIndex = 1;
                else
                    indicatorIndex = 0;
            }
            else
            {
                if (jump)
                    indicatorIndex = indicatorIndex + 2;
                else
                    indicatorIndex++;

            }
            _indicators[indicatorIndex].IsEnabledIndicator = true;
        }

        private void AttentionSignal_1sec(bool isEnabled = false)
        {
            if (isEnabled)
            {
                _centerCircle.IndicationColor = GetColor(ColorsCircle.Yellow);
                _centerCircle.IsEnabledIndicator = true;
            }
            else
                _centerCircle.IsEnabledIndicator = false;
        }

        public void Start(bool isTestStart = false)
        {
            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick += _timer_Tick;
            if (isTestStart)
            {
                SignalsTable = new List<RowSignal>()
                                {
                                     new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,30)),
                                     new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,35)),
                                     new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,45))
                                };
            }
            else
            {
                Random rnd = new Random();
                var variant = rnd.Next(1, 4);
                //variant = 1;
                if (variant == 1)
                {
                    _offsetTime = 0;
                }
                else if (variant == 2)
                {
                    for (int i = 0; i < 15; i++)
                        SignalsTable[i].Time = SignalsTable[i].Time + (int)new TimeSpan(0, 0, 55).TotalSeconds;
                    _offsetTime = 55;
                }
                else if (variant == 3)
                {
                    for (int i = 0; i < 15; i++)
                        SignalsTable[i].Time = SignalsTable[i].Time + (int)new TimeSpan(0, 1, 55).TotalSeconds;
                    _offsetTime = 115;
                }
            }
            _timeOutTimer.Tick += _timeOutTimer_Tick;


            OnPropertyChanged("SignalsTable");
            _timer.Start();
            _indicators[CurrentIndex].IsEnabledIndicator = true;
        }

        private MemoryStream _ms;
        private void Initialize()
        {
            var byteArray =
                 SoundResources.GetSoundArray("pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/beep.wav");
            _ms = new MemoryStream(byteArray);
            _player.Stream = _ms;

            Canva = new Canvas();
            Canva.Width = 500;
            Canva.Height = 500;
            generateCircles(new Size(Canva.Width, Canva.Height));
        }

        public void PressButtton(Buttons button, int time)
        {
            if (_currentSignal != TypeSignals.NoActive && _currentSignal != TypeSignals.AttentionSignal)
            {
                if (button == Buttons.Green)
                {
                    if (_currentSignal == TypeSignals.Alarm)
                    {
                        var curTime = TimeSpan.FromSeconds(time / 10000.0).TotalMilliseconds;
                        _reactionsAlarm.Add(curTime);
                        Table.Add(new ResultRow(_currentSignal, rowSignalTime.Value, Time, curTime));
                        RowSignal = null;

                        _indicators[CurrentIndex].IsEnabledIndicator = false;
                        CurrentIndex = CurrentIndex - 1;
                        if (CurrentIndex < 0)
                            CurrentIndex = _indicators.Count - 1;
                        _indicators[CurrentIndex].IsEnabledIndicator = true;
                        _timer.Interval = TimeSpan.FromSeconds(1);
                        _currentSignal = TypeSignals.NoActive;
                        _timeOutTimer.Stop();
                    }
                    else if (_currentSignal == TypeSignals.SignalWithWarning)
                    {
                        var curTime = TimeSpan.FromSeconds(time / 10000.0).TotalMilliseconds;
                        _reactionsSignalWithWarning.Add(curTime);
                        Table.Add(new ResultRow(_currentSignal, rowSignalTime.Value, Time, curTime));
                        RowSignal = null;

                        _indicators[CurrentIndex].IsEnabledIndicator = false;
                        CurrentIndex = CurrentIndex - 1;
                        if (CurrentIndex < 0)
                            CurrentIndex = _indicators.Count - 1;
                        _indicators[CurrentIndex].IsEnabledIndicator = true;
                        _timer.Interval = TimeSpan.FromSeconds(1);
                        _currentSignal = TypeSignals.NoActive;
                        _timeOutTimer.Stop();
                    }
                }
            }
            else if (_currentSignal == TypeSignals.NoActive)
            {
                _countLeftPressed++;
                if (_currentSignal == TypeSignals.NoActive)
                    Table.Add(new ResultRow(TypeSignals.NoActive, Time, 0, 0));
                RowSignal = null;
            }
            OnPropertyChanged("Table");
        }

        public void Stop()
        {
            _player.Stop();
            Dispose();
            _timeOutTimer.Stop();
            _timeOutTimer.Tick -= _timeOutTimer_Tick;
            _timer.Tick -= _timer_Tick;
        }
        private void _timeOutTimer_Tick(object sender, EventArgs e)
        {
            switch (_currentSignal)
            {
                case TypeSignals.Alarm:
                    _signalAlarmPasses++;
                    Table.Add(new ResultRow(_currentSignal, rowSignalTime.Value, Time, 0.0));
                    break;
                case TypeSignals.SignalWithWarning:
                    _signalWithWarningPasses++;
                    Table.Add(new ResultRow(_currentSignal, rowSignalTime.Value, Time, 0.0));
                    break;
                case TypeSignals.AttentionSignal:
                    _centerCircle.IsEnabledIndicator = false;
                    break;
            }
            OnPropertyChanged("Table");
            RowSignal = null;
            rowSignalTime = null;
            _currentSignal = TypeSignals.NoActive;
            _timeOutTimer.Stop();
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            RowSignal = SignalsTable.FirstOrDefault(f => f.Time == Time);
            if (rowSignal != null)
            {
                var signal = rowSignal.Type;
                rowSignalTime = rowSignal.Time;
                switch (signal)
                {
                    case TypeSignals.Alarm:
                        Jump();
                        _currentSignal = TypeSignals.Alarm;
                        _timeOutTimer.Interval = TimeSpan.FromSeconds(4);
                        _timeOutTimer.Start();
                        if (Mode != TestMode.Manual)
                            ResetTimer?.Invoke(this, new EventArgs());
                        break;
                    case TypeSignals.SignalWithWarning:
                        Jump();
                        _currentSignal = TypeSignals.SignalWithWarning;
                        _timeOutTimer.Interval = TimeSpan.FromSeconds(2);
                        _timeOutTimer.Start();
                        if (Mode != TestMode.Manual)
                            ResetTimer?.Invoke(this, new EventArgs());
                        break;
                    case TypeSignals.AttentionSignal:
                        YellowSignalActive();
                        _currentSignal = TypeSignals.AttentionSignal;
                        _indicators[CurrentIndex].IsEnabledIndicator = false;
                        CurrentIndex++;
                        if (CurrentIndex == _indicators.Count)
                            CurrentIndex = 0;
                        _indicators[CurrentIndex].IsEnabledIndicator = true;
                        _timer.Interval = TimeSpan.FromSeconds(1);
                        _timeOutTimer.Interval = TimeSpan.FromSeconds(2);
                        _timeOutTimer.Start();
                        Table.Add(new ResultRow(TypeSignals.AttentionSignal, rowSignalTime.Value, Time, float.NaN));
                        break;
                }

                _indexRow++;
            }
            else
            {
                _indicators[CurrentIndex].IsEnabledIndicator = false;
                CurrentIndex++;
                if (CurrentIndex == _indicators.Count)
                    CurrentIndex = 0;
                _indicators[CurrentIndex].IsEnabledIndicator = true;
                _timer.Interval = TimeSpan.FromSeconds(1);
            }
            PlaySound();
            //PlaySoundSync();

            if (Time >= 3600 && Time != 0)
            {
                _timer.Stop();
                if (Mode != TestMode.Manual)
                    ReturtResult();
            }
            Time++;
        }

        private void Jump()
        {
            _indicators[CurrentIndex].IsEnabledIndicator = false;
            CurrentIndex = CurrentIndex + 2;
            if (CurrentIndex == _indicators.Count)
                CurrentIndex = 0;
            else if (CurrentIndex > _indicators.Count)
                CurrentIndex = 1;
            _indicators[CurrentIndex].IsEnabledIndicator = true;
        }

        private void PlaySound()
        {
            _player.Play();
        }

        private void ReturtResult()
        {
            var AlarmAverageTime = _reactionsAlarm.Count > 0 ? _reactionsAlarm.Average() / 1000 : 0.0;
            var SignalWithWarningAverageTime = _reactionsSignalWithWarning.Count > 0 ? _reactionsSignalWithWarning.Average() / 1000 : 0.0;
            var CountSignalsWithWarnMore1Sec = _reactionsSignalWithWarning.Count > 0 ? _reactionsSignalWithWarning.Where(w => w > 1000).Count() : 0;

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Среднеарифметическое время реагирования на сигналы без предупреждения"] = (float)AlarmAverageTime,
                ["Среднеарифметическое время реагирования на сигналы с предупреждением"] = (float)SignalWithWarningAverageTime,
                ["Число пропущенных сигналов без предупреждения"] = _signalAlarmPasses,
                ["Готовность"] = (float)(AlarmAverageTime - SignalWithWarningAverageTime),
                ["Число пропущенных сигналов с предупреждением"] = _signalWithWarningPasses,

                ["Таблица_Действие"] = Table.Select(s => (int)s.CodeSignal).ToArray(),
                ["Таблица_Время"] = Table.Select(s => s.ActivationTime).ToArray(),

                ["Сдвиг"] = (float)_offsetTime,
                ["Число реагирований при отсутствии сигналов"] = _countLeftPressed,
                ["Кол-во реагирований на сигналы с предупреждением большие 1 с."] = CountSignalsWithWarnMore1Sec,

                ["Таблица_Реакция"] = Table.Select(s => (float)s.Reaction / 1000).ToArray()
            });
        }

        private void YellowSignalActive()
        {
            _centerCircle.IndicationColor = GetColor(ColorsCircle.Yellow);
            _centerCircle.IsEnabledIndicator = true;
        }
        #region generator

        private Indicator generateCircle(Point centerpoint, Size size, double angle, Size canvasSize, Brush fill)
        {
            var v = rotateVector(centerpoint, angle);
            var elli = new Indicator() { Height = size.Height, Width = size.Width, IndicationColor = fill };

            //Сдвигаем точку, т. к. вектор строится от нуля
            v.X = (v.X + canvasSize.Width / 2);
            v.Y = (v.Y + canvasSize.Height / 2);

            elli.SetValue(Canvas.LeftProperty, v.X - elli.Width / 2);
            elli.SetValue(Canvas.TopProperty, v.Y - elli.Height / 2);
            elli.Angle = angle;
            return elli;
        }

        private void generateCircles(Size canvasSize, int countCircles = 60)
        {
            var center = Canva.Height / 2;
            var angle = 360 / countCircles;
            Point centerPoint = new Point(center, 0);
            Size indicatorSize = new Size(15, 15);

            for (int i = 270; i < 360; i = i + angle)
                SetIndicator(canvasSize, centerPoint, indicatorSize, i);

            for (int i = 0; i < 270; i = i + angle)
                SetIndicator(canvasSize, centerPoint, indicatorSize, i);

            var cCircle = new Indicator();
            cCircle.Height = cCircle.Width = indicatorSize.Height * 2;
            cCircle.SetValue(Canvas.LeftProperty, (Canva.Width / 2) - cCircle.Width / 2);
            cCircle.SetValue(Canvas.TopProperty, (Canva.Height / 2) - cCircle.Height / 2);
            Canva.Children.Add(cCircle);
            _centerCircle = cCircle;
        }

        private void SetIndicator(Size canvasSize, Point centerPoint, Size indicatorSize, int i)
        {
            var color = ColorsCircle.Green;
            var indicator = generateCircle(centerPoint, indicatorSize, i, canvasSize, GetColor(color, true));
            indicator.Color = color;
            Canva.Children.Add(indicator);
            _indicators.Add(indicator);
        }

        private Vector rotateVector(Point centerPoint, double angle)
        {
            double vX = (centerPoint.X * Math.Cos(Common.Mathematic.ToRadians(angle))) - (centerPoint.Y * Math.Sin(Common.Mathematic.ToRadians(angle)));
            double vY = (centerPoint.X * Math.Sin(Common.Mathematic.ToRadians(angle))) + (centerPoint.Y * Math.Cos(Common.Mathematic.ToRadians(angle)));
            return new Vector(vX, vY);
        }

        public void Dispose()
        {
            if (_ms != null)
                _ms.Dispose();
            _player.Dispose();
            _timer.Dispose();
        }

        #endregion
    }
    public enum Buttons
    {
        Green
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction\ReadinessForEmergencyActionViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction
{
    public class ReadinessForEmergencyActionViewModel : TestBase
    {
        public override event EventHandler<Results> Results;
       
        private PultButtons Buttons;
        public ReadinessForEmergencyActionControl control;
        public ReadinessForEmergencyActionViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("readinessForEmergencyAction"); 
            Manager.TraningTime = Common.GetSeconds(75);
        }

        public override FrameworkElement GetTestControl()
        {
            return new ReadinessForEmergencyActionControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new ReadinessForEmergencyActionControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        private bool isTestStart = false;
        public override void TestStart()
        {
            isTestStart = true;
            control = new ReadinessForEmergencyActionControl();
            control.Loaded += Control_Loaded;
            TestCurrentView = control;
        }

        public override void Start()
        {
            isTestStart = false;
            control = new ReadinessForEmergencyActionControl();
            control.Loaded += Control_Loaded;
            TestCurrentView = control;
        }

        private void Control_Loaded(object sender, RoutedEventArgs e)
        {
            control.Loaded -= Control_Loaded;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            if (!isTestStart)
                control.Results += control_Results;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start(isTestStart);
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception=e.Exception});
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Green)
                control.PressButtton(ReadinessForEmergencyAction.Buttons.Green, e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.ResetTimer -= Control_ResetTimer;
                control.Results -= control_Results;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction\ResultRow.cs


namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction
{
    public class ResultRow
    {
        public ResultRow(TypeSignals codeSignal, int activationTime, double reactionTime, double reaction)
        {
            CodeSignal = codeSignal;
            ActivationTime = activationTime;
            ReactionTime = reactionTime;
            Reaction = reaction;
        }

        /// <summary>
        /// Время запуска сигнала
        /// </summary>
        public int ActivationTime { get; set; }

        public TypeSignals CodeSignal { get; set; }
        /// <summary>
        /// Реакция(сколько)
        /// </summary>
        public double Reaction { get; set; }

        /// <summary>
        /// Реакция(когда)
        /// </summary>
        public double ReactionTime { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction\RowSignal.cs


using System;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction
{
    public class RowSignal
    {
        public RowSignal(TypeSignals type, TimeSpan time)
        {
            Type = type;
            Time = (int)time.TotalSeconds;
        }

        public int Time { get; set; }
        public TypeSignals Type { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction\TypeSignals.cs


namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction
{
    public enum TypeSignals
    {
        /// <summary>
        /// Экстренный сигнал
        /// </summary>
        Alarm,

        /// <summary>
        /// Сигнал с предупреждением
        /// </summary>
        SignalWithWarning,

        /// <summary>
        /// Жёлтый предупреждающий сигнал (центральная точка в круге)
        /// </summary>
        AttentionSignal,

        /// <summary>
        /// Увеличение на 30 процентов ЭКС
        /// </summary>
        Percent30Plus,

        /// <summary>
        /// Нет активности (сигнала)
        /// </summary>
        NoActive
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:ReadinessForEmergencyActionControl">
        <Setter Property="Background" Value="#FF727171"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReadinessForEmergencyActionControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox Height="1000" Width="1000">
                                        <ContentControl Focusable="False"
                                                Margin="5"
                                                Content="{Binding Canva,
                                                          RelativeSource={RelativeSource FindAncestor,
                                                          AncestorType={x:Type local:ReadinessForEmergencyActionControl}}}"/>
                                    </Viewbox>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:ReadinessForEmergencyActionControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ReadinessForEmergencyActionViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReadinessForEmergencyActionViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:ReadinessForEmergencyActionViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <SolidColorBrush x:Key="DefaultBrushIndicator" Color="#FF535151"/>
    <Style TargetType="{x:Type local:Indicator}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Indicator}">
                    <ContentControl>
                        <Ellipse x:Name="el" StrokeThickness="1" Stroke="{x:Null}" Fill="{StaticResource DefaultBrushIndicator}"/>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsEnabledIndicator,RelativeSource={RelativeSource Self}}" Value="false">
                            <Setter TargetName="el" Property="Fill" Value="{StaticResource DefaultBrushIndicator}"/>
                            <Setter TargetName="el" Property="StrokeThickness" Value="1"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsEnabledIndicator, RelativeSource={RelativeSource Self}}" Value="true">
                            <Setter TargetName="el" Property="Fill" Value="{Binding IndicationColor, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Indicator}}}"/>
                            <Setter TargetName="el" Property="Margin" Value="-1"/>
                            <Setter TargetName="el" Property="Stroke" Value="White"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyActionM\BaseVariant.cs


using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyActionM
{
    public abstract class BaseVariant : INotifyPropertyChanged
    {
        private List<Signal> _signals;
        public List<Signal> Signals
        {
            get { return _signals; }
            set
            {
                _signals = value;
                OnPropertyChanged();
            }
        }

        public BaseVariant()
        {
            GetModdedSignals();
            for (int i = 0; i < _signals.Count; i++)
            {
                if (_signals[i].Type == TypeSignals.SignalWithWarning)
                {
                    var prevSignal = _signals[i - 1];
                    _signals[i].SetSignalTime(prevSignal.Time + 2);
                }
            }
            OnPropertyChanged(nameof(Signals));
        }

        /// <summary>
        /// Вставить сигнал
        /// </summary>
        /// <param name="signal"></param>
        /// <param name="insertionIndex"></param>
        public void InsertSignal(Signal signal,int insertionIndex)
        {
            Signals.Insert(insertionIndex, signal);
            OnPropertyChanged(nameof(Signals));
        }

        public abstract void GetModdedSignals();
        
        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged([CallerMemberName]string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyActionM\ISignals.cs


namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyActionM
{
    public interface ISignals
    {
        BaseVariant Variant { get;}
        void GenerateSignals();
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyActionM\ReadinessForEmergencyActionMControl.cs


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Media;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction;
using static Updk7.Tests.Wpf.Psychophysical.Common;
using static Updk7.Tests.Wpf.Psychophysical.Common.Drawing;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyActionM
{
    public class ReadinessForEmergencyActionMControl : NotifyViewModelBase, ILearning,IDisposable
    {
        public event EventHandler ResetTimer;
        public event EventHandler<Dictionary<string, object>> Results;

        private Canvas _canva;
        private Indicator _centerCircle = null;
        private int _countLeftPressed = 0;
        private int _currentIndex = 0;
        private TypeSignals _currentSignal = TypeSignals.NoActive;
        public TypeSignals CurrentSignal
        {
            get { return _currentSignal; }
            set
            {
                _currentSignal = value;
                OnPropertyChanged();
            }
        }
       
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }
        public int CurrentIndex
        {
            get { return _currentIndex; }
            set
            {
                _currentIndex = value;
                OnPropertyChanged();
            }
        }

        private ISignals _signals;
        public ISignals Signals
        {
            get { return _signals; }
            set
            {
                _signals = value;
                OnPropertyChanged();
            }
        }

        public List<ResultRow> Table
        {
            get { return _table; }
            set
            {
                _table = value;
                OnPropertyChanged();
            }
        }

        public int Time
        {
            get { return _time; }
            set
            {
                _time = value;
                OnPropertyChanged();
            }
        }

        private int countInARowPassedSignals = 0;
        public int CountInARowPassedSignals
        {
            get { return countInARowPassedSignals; }
            set
            {
                countInARowPassedSignals = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private int _indexRow = 0;
        private List<Indicator> _indicators = new List<Indicator>();
        private SoundPlayer _player = new SoundPlayer();
        private List<double> _reactionsAlarm = new List<double>();
        private List<double> _reactionsSignalWithWarning = new List<double>();
        private int _signalAlarmPasses = 0;
        private int _signalWithWarningPasses = 0;
        private List<ResultRow> _table = new List<ResultRow>();
        private int _time = 0;
        private DispatcherTimer _soundTimer = new DispatcherTimer();
        private DispatcherTimer _timeOutTimer = new DispatcherTimer();
        private NeuroTimer _timer = new NeuroTimer();
        Signal signal;
        int? rowSignalTime = null;
        public ReadinessForEmergencyActionMControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            Initialize();
            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("Tick_1sec", () => Tick_1sec());
                TestMethods.Add("Jump", () => Tick_1sec(true));
                TestMethods.Add("Attention", () => AttentionSignal_1sec(true));
                TestMethods.Add("AttentionHide", () => AttentionSignal_1sec());
            }
        }

        private int indicatorIndex = 0;
        private void Tick_1sec(bool jump = false)
        {
            _indicators[indicatorIndex].IsEnabledIndicator = false;
            if (indicatorIndex == 59)
            {
                if (jump)
                    indicatorIndex = 1;
                else
                    indicatorIndex = 0;
            }
            else
            {
                if (jump)
                    indicatorIndex = indicatorIndex + 2;
                else
                    indicatorIndex++;

            }
            _indicators[indicatorIndex].IsEnabledIndicator = true;
        }
        private void AttentionSignal_1sec(bool isEnabled = false)
        {
            if (isEnabled)
            {
                _centerCircle.IndicationColor = GetColor(ColorsCircle.Yellow);
                _centerCircle.IsEnabledIndicator = true;
            }
            else
                _centerCircle.IsEnabledIndicator = false;
        }
        public void Start(bool isTestStart = false)
        {
            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick += _timer_Tick;
            _soundTimer.Interval = TimeSpan.FromSeconds(1.7);
            _soundTimer.Tick += _soundTimer_Tick;
            if (isTestStart)
                Signals = new Signals(StartType.TestStart);
            else
                Signals = new Signals(StartType.Normal);

            _timeOutTimer.Tick += _timeOutTimer_Tick;
           
            OnPropertyChanged("SignalsTable");
            if (Mode != TestMode.Manual)
            {
                _timer.Start();
                _soundTimer.Start();
            }
            _indicators[CurrentIndex].IsEnabledIndicator = true;
        }

        private MemoryStream _ms;
        private void Initialize()
        {
            var byteArray =
               SoundResources.GetSoundArray("pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/metronom.wav");
            _ms = new MemoryStream(byteArray);
            _player.Stream = _ms;

            Canva = new Canvas();
            Canva.Width = 500;
            Canva.Height = 500;
            generateCircles(new Size(Canva.Width, Canva.Height));
        }

        private void _soundTimer_Tick(object sender, EventArgs e)
        {
            PlaySound();
        }

        public void Stop()
        {
            _soundTimer.Tick -= _soundTimer_Tick;
            _soundTimer.Stop();

            _ms.Dispose();

            _player.Stop();
            _player.Dispose();
            Dispose();
            _timeOutTimer.Tick -= _timeOutTimer_Tick;
            _timeOutTimer.Stop();
          
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
            _timer.Dispose();
        }

        private void _timeOutTimer_Tick(object sender, EventArgs e)
        {
            switch (_currentSignal)
            {
                case TypeSignals.Alarm:
                    _signalAlarmPasses++;
                    Table.Add(new ResultRow(_currentSignal, rowSignalTime.Value, Time, 0.0));
                    CountInARowPassedSignals++;
                    break;
                case TypeSignals.SignalWithWarning:
                    _signalWithWarningPasses++;
                    Table.Add(new ResultRow(_currentSignal, rowSignalTime.Value, Time, 0.0));
                    CountInARowPassedSignals++;
                    break;
                case TypeSignals.AttentionSignal:
                    _centerCircle.IsEnabledIndicator = false;
                    break;
            }

            if (CountInARowPassedSignals == 4)
            {
                ReturtResults();
            }

            OnPropertyChanged("Table");
            signal = null;
            rowSignalTime = null;
            CurrentSignal = TypeSignals.NoActive;
            _timeOutTimer.Stop();
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            signal = Signals.Variant.Signals.FirstOrDefault(f => f.Time == Time);
            if (signal != null)
            {
                var curSignal = signal.Type;
                rowSignalTime = signal.Time;
                switch (curSignal)
                {
                    case TypeSignals.Alarm:
                        Jump();
                        CurrentSignal = TypeSignals.Alarm;
                        _timeOutTimer.Interval = TimeSpan.FromSeconds(4);
                        if (Mode != TestMode.Manual)
                            _timeOutTimer.Start();
                        if (Mode != TestMode.Manual)
                            ResetTimer?.Invoke(this, new EventArgs());
                        break;
                    case TypeSignals.SignalWithWarning:
                        Jump();
                        CurrentSignal = TypeSignals.SignalWithWarning;
                        _timeOutTimer.Interval = TimeSpan.FromSeconds(4);
                        if (Mode != TestMode.Manual)
                            _timeOutTimer.Start();
                        if (Mode != TestMode.Manual)
                            ResetTimer?.Invoke(this, new EventArgs());
                        break;
                    case TypeSignals.AttentionSignal:
                        YellowSignalActive();
                        CurrentSignal = TypeSignals.AttentionSignal;
                        _indicators[CurrentIndex].IsEnabledIndicator = false;
                        CurrentIndex++;
                        if (CurrentIndex == _indicators.Count)
                            CurrentIndex = 0;
                        _indicators[CurrentIndex].IsEnabledIndicator = true;
                        _timeOutTimer.Interval = TimeSpan.FromSeconds(2);
                        Table.Add(new ResultRow(TypeSignals.AttentionSignal, rowSignalTime.Value, Time, float.NaN));
                        if (Mode != TestMode.Manual)
                            _timeOutTimer.Start();
                        break;
                }

                _indexRow++;
            }
            else
            {
                _indicators[CurrentIndex].IsEnabledIndicator = false;
                CurrentIndex++;
                if (CurrentIndex == _indicators.Count)
                    CurrentIndex = 0;
                _indicators[CurrentIndex].IsEnabledIndicator = true;
            }
           

            if (Time >= 3600 && Time != 0)
            {
                _timer.Stop();
                _soundTimer.Stop();
                ReturtResults();
            }
            Time++;
        }

        public void PressButtton(Buttons button, int time)
        {
            if (_currentSignal != TypeSignals.NoActive && _currentSignal != TypeSignals.AttentionSignal)
            {
                if (button == Buttons.Green)
                {
                    if (_currentSignal == TypeSignals.Alarm)
                    {
                        var curTime = TimeSpan.FromSeconds(time / 10000.0).TotalMilliseconds;
                        _reactionsAlarm.Add(curTime);
                        Table.Add(new ResultRow(_currentSignal, rowSignalTime.Value, Time, curTime));
                        signal = null;
                        CurrentSignal = TypeSignals.NoActive;
                        CountInARowPassedSignals = 0;
                        _timeOutTimer.Stop();
                    }
                    else if (_currentSignal == TypeSignals.SignalWithWarning)
                    {
                        var curTime = TimeSpan.FromSeconds(time / 10000.0).TotalMilliseconds;
                        _reactionsSignalWithWarning.Add(curTime);
                        Table.Add(new ResultRow(_currentSignal, rowSignalTime.Value, Time, curTime));
                        signal = null;
                        CurrentSignal = TypeSignals.NoActive;
                        CountInARowPassedSignals = 0;
                        _timeOutTimer.Stop();
                    }
                }
            }
            else if (_currentSignal == TypeSignals.NoActive)
            {
                _countLeftPressed++;
                if (_currentSignal == TypeSignals.NoActive)
                    Table.Add(new ResultRow(TypeSignals.NoActive, Time, 0, 0));
                signal = null;
            }
            OnPropertyChanged("Table");
        }

        private void Jump()
        {
            _indicators[CurrentIndex].IsEnabledIndicator = false;
            CurrentIndex = CurrentIndex + 2;
            if (CurrentIndex == _indicators.Count)
                CurrentIndex = 0;
            else if (CurrentIndex > _indicators.Count)
                CurrentIndex = 1;
            _indicators[CurrentIndex].IsEnabledIndicator = true;
        }

        private void PlaySound()
        {
            _player.Play();
        }

        private void ReturtResults()
        {
            var AlarmAverageTime = _reactionsAlarm.Count > 0 ? _reactionsAlarm.Average() / 1000 : 0.0;
            var SignalWithWarningAverageTime = _reactionsSignalWithWarning.Count > 0 ? _reactionsSignalWithWarning.Average() / 1000 : 0.0;
            var CountSignalsWithWarnMore1Sec = _reactionsSignalWithWarning.Count > 0 ? _reactionsSignalWithWarning.Where(w => w > 1000).Count() : 0;

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Среднеарифметическое время реагирования на сигналы без предупреждения"] = (float)AlarmAverageTime,
                ["Среднеарифметическое время реагирования на сигналы с предупреждением"] = (float)SignalWithWarningAverageTime,
                ["Число пропущенных сигналов без предупреждения"] = _signalAlarmPasses,
                ["Готовность"] = (float)(AlarmAverageTime - SignalWithWarningAverageTime),
                ["Число пропущенных сигналов с предупреждением"] = _signalWithWarningPasses,

                ["Таблица_Действие"] = Table.Select(s => (int)s.CodeSignal).ToArray(),
                ["Таблица_Время"] = Table.Select(s => s.ActivationTime).ToArray(),
                
                ["Число реагирований при отсутствии сигналов"] = _countLeftPressed,
                ["Кол-во реагирований на сигналы с предупреждением большие 1 с."] = CountSignalsWithWarnMore1Sec,

                ["Таблица_Реакция"] = Table.Select(s => (float)s.Reaction / 1000).ToArray()
            });
        }

        private void YellowSignalActive()
        {
            _centerCircle.IndicationColor = GetColor(ColorsCircle.Yellow);
            _centerCircle.IsEnabledIndicator = true;
        }
        #region generator

        private Indicator generateCircle(Point centerpoint, Size size, double angle, Size canvasSize, Brush fill)
        {
            var v = rotateVector(centerpoint, angle);
            var elli = new Indicator() { Height = size.Height, Width = size.Width, IndicationColor = fill };

            //Сдвигаем точку, т. к. вектор строится от нуля
            v.X = (v.X + canvasSize.Width / 2);
            v.Y = (v.Y + canvasSize.Height / 2);

            elli.SetValue(Canvas.LeftProperty, v.X - elli.Width / 2);
            elli.SetValue(Canvas.TopProperty, v.Y - elli.Height / 2);
            elli.Angle = angle;
            return elli;
        }

        private void generateCircles(Size canvasSize, int countCircles = 60)
        {
            var center = Canva.Height / 2;
            var angle = 360 / countCircles;
            Point centerPoint = new Point(center, 0);
            Size indicatorSize = new Size(15, 15);

            for (int i = 270; i < 360; i = i + angle)
                SetIndicator(canvasSize, centerPoint, indicatorSize, i);

            for (int i = 0; i < 270; i = i + angle)
                SetIndicator(canvasSize, centerPoint, indicatorSize, i);

            var cCircle = new Indicator();
            cCircle.Height = cCircle.Width = indicatorSize.Height * 2;
            cCircle.SetValue(Canvas.LeftProperty, (Canva.Width / 2) - cCircle.Width / 2);
            cCircle.SetValue(Canvas.TopProperty, (Canva.Height / 2) - cCircle.Height / 2);
            Canva.Children.Add(cCircle);
            _centerCircle = cCircle;
        }

        private void SetIndicator(Size canvasSize, Point centerPoint, Size indicatorSize, int i)
        {
            var color = ColorsCircle.Green;
            var indicator = generateCircle(centerPoint, indicatorSize, i, canvasSize, GetColor(color, true));
            indicator.Color = color;
            Canva.Children.Add(indicator);
            _indicators.Add(indicator);
        }

        private Vector rotateVector(Point centerPoint, double angle)
        {
            double vX = (centerPoint.X * Math.Cos(Common.Mathematic.ToRadians(angle))) - (centerPoint.Y * Math.Sin(Common.Mathematic.ToRadians(angle)));
            double vY = (centerPoint.X * Math.Sin(Common.Mathematic.ToRadians(angle))) + (centerPoint.Y * Math.Cos(Common.Mathematic.ToRadians(angle)));
            return new Vector(vX, vY);
        }

        public void Dispose()
        {
            if (_ms != null)
                _ms.Dispose();
        }

        #endregion
    }
    public enum Buttons
    {
        Green
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyActionM\ReadinessForEmergencyActionMViewModel.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyActionM
{
    public class ReadinessForEmergencyActionMViewModel : TestBase
    {
        public override event EventHandler<Results> Results;

        private PultButtons Buttons;

        private string message;
        public string Message
        {
            get { return message; }
            set
            {
                message = value;
                if (!string.IsNullOrEmpty(message))
                    _messageTimer.Start();
                else
                    _messageTimer.Stop();
                OnPropertyChanged();
            }
        }

        private DispatcherTimer _messageTimer = new DispatcherTimer();

        public ReadinessForEmergencyActionMControl control;
        public ReadinessForEmergencyActionMViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("readinessForEmergencyAction");
            Manager.TraningTime = Common.GetSeconds(75);
        }
        public override FrameworkElement GetTestControl()
        {
            return new ReadinessForEmergencyActionMControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new ReadinessForEmergencyActionMControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }
        public override void TestStart()
        {
            control = new ReadinessForEmergencyActionMControl();
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;

            control.ResetTimer += Control_ResetTimer;
            _messageTimer.Interval = TimeSpan.FromSeconds(5);
            _messageTimer.Tick += _messageTimer_Tick;
            Buttons.Start();
            control.Start(true);
            TestCurrentView = control;
        }

        public override void Start()
        {
            control = new ReadinessForEmergencyActionMControl();
           
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;

            control.Results += TestCurrentView_Results;
            control.ResetTimer += Control_ResetTimer;
            _messageTimer.Interval = TimeSpan.FromSeconds(5);
            _messageTimer.Tick += _messageTimer_Tick;
            Buttons.Start();
            control.Start(false);
            TestCurrentView = control;
        }

        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            Results?.Invoke(this, new Results(new Dictionary<string, object>() { [testInterrupt.Key]=testInterrupt.Value }));
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception=e.Exception});
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private KeyValuePair<string, object> testInterrupt;
        private void TestCurrentView_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Green)
                control.PressButtton(ReadinessForEmergencyActionM.Buttons.Green, e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Stop();
            }
            if (control != null)
            {
                _messageTimer.Tick -= _messageTimer_Tick;
                _messageTimer.Stop();
                control.ResetTimer -= Control_ResetTimer;
                control.Results -= TestCurrentView_Results;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyActionM\Signal.cs


using System;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyActionM
{
    public class Signal
    {
        public int Time { get; set; }
        public TypeSignals Type { get; set; }
        TimeSpan RandomFrom { get; set; }
        TimeSpan RandomTo { get; set; }
        public Signal(TypeSignals type, TimeSpan randomFrom, TimeSpan randomTo)
        {
            Type = type;
            RandomFrom = randomFrom;
            RandomTo = randomTo;
            if(type!= TypeSignals.SignalWithWarning)
            Time = Common._rnd.Next((int)randomFrom.TotalSeconds, (int)randomTo.TotalSeconds);
        }

        public Signal(TypeSignals type)
        {
            Type = type;
        }

        public Signal(TypeSignals type, TimeSpan time)
        {
            Type = type;
            Time = (int)time.TotalSeconds;
        }

        public void SetSignalTime(int currentTimeInTest)
        {
            Time = currentTimeInTest + Common._rnd.Next(4, 7);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyActionM\Signals.cs


namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyActionM
{
    public class Signals : ISignals
    {
        public BaseVariant Variant { get; private set; }
        public StartType StartType { get; set; }
        public Signals(StartType type)
        {
            if (type == StartType.Normal)
                GenerateSignals();
            else if (type == StartType.TestStart)
                Variant = new TestVariant();
        }

        public void GenerateSignals()
        {
            var variant = (Variants)Common._rnd.Next(0, 7);
            switch (variant)
            {
                case Variants.Variant_1:
                    Variant = new VariantSignals_1();
                    break;
                case Variants.Variant_2:
                    Variant = new VariantSignals_2();
                    break;
                case Variants.Variant_3:
                    Variant = new VariantSignals_3();
                    break;
                case Variants.Variant_4:
                    Variant = new VariantSignals_4();
                    break;
                case Variants.Variant_5:
                    Variant = new VariantSignals_5();
                    break;
                case Variants.Variant_6:
                    Variant = new VariantSignals_6();
                    break;
                case Variants.Variant_7:
                    Variant = new VariantSignals_7();
                    break;
            }
        }
    }
    public enum StartType
    {
        Normal,
        TestStart
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyActionM\VariantsSignals.cs


using System;
using System.Collections.Generic;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyActionM
{
    public class VariantSignals_1 : BaseVariant
    {
        public override void GetModdedSignals()
        {
            var signals = new List<Signal>()
            {
                new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,2,30), new TimeSpan(0,3,30)),
                new Signal(TypeSignals.SignalWithWarning),
                new Signal(TypeSignals.Alarm, new TimeSpan(0,7,15), new TimeSpan(0,8,15)),
                new Signal(TypeSignals.Alarm, new TimeSpan(0,15,00), new TimeSpan(0,15,45)),
                new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,20,15), new TimeSpan(0,21,45)),
                new Signal(TypeSignals.SignalWithWarning),
                new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,25,15), new TimeSpan(0,26,45)),
                new Signal(TypeSignals.SignalWithWarning),
                new Signal(TypeSignals.Alarm, new TimeSpan(0,32,00), new TimeSpan(0,33,55)),
                new Signal(TypeSignals.Alarm, new TimeSpan(0,38,30), new TimeSpan(0,40,15)),
                new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,43,15), new TimeSpan(0,44,55)),
                new Signal(TypeSignals.SignalWithWarning),
                new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,47,30), new TimeSpan(0,48,55)),
                new Signal(TypeSignals.SignalWithWarning),
                new Signal(TypeSignals.Alarm, new TimeSpan(0,52,30), new TimeSpan(0,53,55)),
                new Signal(TypeSignals.Alarm, new TimeSpan(0,55,15), new TimeSpan(0,57,00)),
                new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,58,15), new TimeSpan(0,59,30)),
                new Signal(TypeSignals.SignalWithWarning)
            };

            Signals = signals;
        }
    }
    public class VariantSignals_2 : BaseVariant
    {
        public override void GetModdedSignals()
        {
            var signals = new List<Signal>()
                {
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,2,30), new TimeSpan(0,3,30)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,7,15), new TimeSpan(0,8,15)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,13,00), new TimeSpan(0,14,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,20,10), new TimeSpan(0,21,55)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,26,00), new TimeSpan(0,27,55)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,32,30), new TimeSpan(0,33,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,38,30), new TimeSpan(0,40,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,45,15), new TimeSpan(0,46,55)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,50,30), new TimeSpan(0,51,55)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,53,30), new TimeSpan(0,54,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,57,15), new TimeSpan(0,58,00)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,59,05), new TimeSpan(0,59,40)),
                       new Signal(TypeSignals.SignalWithWarning),
                };

            Signals = signals;
        }
    }
    public class VariantSignals_3 : BaseVariant
    {
        public override void GetModdedSignals()
        {
            var signals = new List<Signal>()
                {
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,2,30), new TimeSpan(0,3,30)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,7,15), new TimeSpan(0,8,15)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,14,30), new TimeSpan(0,15,45)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,20,10), new TimeSpan(0,21,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,27,00), new TimeSpan(0,28,15)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,33,30), new TimeSpan(0,34,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,39,30), new TimeSpan(0,40,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,45,15), new TimeSpan(0,46,55)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,50,30), new TimeSpan(0,51,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,53,30), new TimeSpan(0,54,00)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,57,15), new TimeSpan(0,58,15)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,59,15), new TimeSpan(0,59,45)),
                       new Signal(TypeSignals.SignalWithWarning),
                };

            Signals = signals;
        }
    }
    public class VariantSignals_4 : BaseVariant
    {
        public override void GetModdedSignals()
        {
            var signals = new List<Signal>()
                {
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,2,30), new TimeSpan(0,3,30)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,7,15), new TimeSpan(0,8,15)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,14,30), new TimeSpan(0,15,45)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,20,10), new TimeSpan(0,21,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,26,00), new TimeSpan(0,27,15)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,33,30), new TimeSpan(0,34,55)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,39,30), new TimeSpan(0,40,55)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,44,15), new TimeSpan(0,45,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,49,30), new TimeSpan(0,50,55)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,53,30), new TimeSpan(0,54,00)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,57,15), new TimeSpan(0,58,15)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,59,10), new TimeSpan(0,59,45)),
                       new Signal(TypeSignals.SignalWithWarning)
                };

            Signals = signals;
        }
    }
    public class VariantSignals_5 : BaseVariant
    {
        public override void GetModdedSignals()
        {
            var signals = new List<Signal>()
                {
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,2,30), new TimeSpan(0,3,30)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,7,15), new TimeSpan(0,8,15)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,14,30), new TimeSpan(0,15,45)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,20,10), new TimeSpan(0,21,55)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,27,00), new TimeSpan(0,28,15)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,33,30), new TimeSpan(0,34,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,39,30), new TimeSpan(0,40,55)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,45,15), new TimeSpan(0,46,55)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,50,30), new TimeSpan(0,51,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,53,30), new TimeSpan(0,54,00)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,57,15), new TimeSpan(0,58,15)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,59,15), new TimeSpan(0,59,45)),
                       new Signal(TypeSignals.SignalWithWarning),
                };

            Signals = signals;
        }
    }
    public class VariantSignals_6 : BaseVariant
    {
        public override void GetModdedSignals()
        {
            var signals = new List<Signal>()
                {
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,2,30), new TimeSpan(0,3,30)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,7,15), new TimeSpan(0,8,15)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,14,30), new TimeSpan(0,15,45)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,20,10), new TimeSpan(0,21,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,26,00), new TimeSpan(0,27,15)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,33,00), new TimeSpan(0,34,55)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,39,30), new TimeSpan(0,40,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,44,15), new TimeSpan(0,45,55)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,49,30), new TimeSpan(0,50,55)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,53,30), new TimeSpan(0,54,00)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,57,15), new TimeSpan(0,58,15)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,59,10), new TimeSpan(0,59,45)),
                       new Signal(TypeSignals.SignalWithWarning),
                };

            Signals = signals;
        }
    }
    public class VariantSignals_7 : BaseVariant
    {
        public override void GetModdedSignals()
        {
            var signals = new List<Signal>()
                {
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,2,30), new TimeSpan(0,3,30)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,7,15), new TimeSpan(0,8,15)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,14,30), new TimeSpan(0,15,45)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,20,10), new TimeSpan(0,21,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,27,00), new TimeSpan(0,28,15)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,33,30), new TimeSpan(0,34,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,39,30), new TimeSpan(0,40,55)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,45,15), new TimeSpan(0,46,55)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,50,30), new TimeSpan(0,51,55)),
                       new Signal(TypeSignals.SignalWithWarning),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,53,30), new TimeSpan(0,54,00)),
                       new Signal(TypeSignals.Alarm, new TimeSpan(0,57,15), new TimeSpan(0,58,15)),
                       new Signal(TypeSignals.AttentionSignal, new TimeSpan(0,59,15), new TimeSpan(0,59,45)),
                       new Signal(TypeSignals.SignalWithWarning),
                };

            Signals = signals;
        }
    }
    public class TestVariant : BaseVariant
    {
        public override void GetModdedSignals()
        {
            var signals = new List<Signal>()
                {
                        new Signal(TypeSignals.AttentionSignal,new TimeSpan(0,0,30)),
                        new Signal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,35)),
                        new Signal(TypeSignals.Alarm,new TimeSpan(0,0,45))
                };

            Signals = signals;
        }
    }
    public enum Variants
    {
        Variant_1,
        Variant_2,
        Variant_3,
        Variant_4,
        Variant_5,
        Variant_6,
        Variant_7
    }
}


*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyActionM\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyActionM"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels"
                    xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Converters">
    <Style TargetType="local:ReadinessForEmergencyActionMControl">
        <Setter Property="Background" Value="#FF727171"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReadinessForEmergencyActionMControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox Height="1000" Width="1000">
                                        <ContentControl Focusable="False" Margin="5"
                                                        Content="{Binding Canva,
                                                                  RelativeSource={RelativeSource FindAncestor,
                                                                  AncestorType={x:Type local:ReadinessForEmergencyActionMControl}}}"/>
                                    </Viewbox>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:ReadinessForEmergencyActionMControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ReadinessForEmergencyActionMViewModel">
        <Style.Resources>
            <converters:StringOrEmptyConverter x:Key="StringOrEmptyConverter"/>
        </Style.Resources>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReadinessForEmergencyActionMViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <tests:MessageBoxControl x:Name="mBox"
                                                     Message="{Binding Message,
                                                               RelativeSource={RelativeSource FindAncestor,
                                                               AncestorType={x:Type local:ReadinessForEmergencyActionMViewModel}}}"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:ReadinessForEmergencyActionMViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Message,
                                                   RelativeSource={RelativeSource Self},
                                                   Converter={StaticResource StringOrEmptyConverter}}" Value="true">
                            <Setter TargetName="mBox" Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\GED1_Quest.cs


using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public class GED1_Quest : IQuest
    {
        public int CountLeftPresses { get; set; }
        public int OffsetTime { get; set; } = 0;
        public Stage Quest { get; } = Stage.One;
        public List<double> ReactionsAlarm { get; private set; } = new List<double>();
        public List<double> ReactionsSignalWithWarning { get; private set; } = new List<double>();
        private List<RowResult> results = new List<RowResult>();
        public List<RowResult> Results
        {
            get { return results; }
            set
            {
                results = value;
                OnPropertyChanged();
            }
        }
        public int SignalAlarmPasses { get; set; }
        public int SignalWithWarningPasses { get; set; }
        public void SetResult(RowResult result)
        {
            Results.Add(result);
            switch (result.TypeSignal)
            {
                case ReadinessForEmergencyAction.TypeSignals.Alarm:
                    ReactionsAlarm.Add(result.TimeReaction);
                    break;
                case ReadinessForEmergencyAction.TypeSignals.SignalWithWarning:
                    ReactionsSignalWithWarning.Add(result.TimeReaction);
                    break;
                case ReadinessForEmergencyAction.TypeSignals.AttentionSignal:
                    break;
                case ReadinessForEmergencyAction.TypeSignals.Percent30Plus:
                    break;
                case ReadinessForEmergencyAction.TypeSignals.NoActive:
                    break;
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged([CallerMemberName]string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\GED2_Quest.cs


using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public class GED2_Quest : IQuest
    {
        public int CountAddAdditionalSignals { get; set; } = 0;
        public int CountLeftPresses { get; set; } = 0;
        public int CountPassesAdditionalSignals { get; set; } = 0;
        public int CountPassesInRow { get; set; } = 0;
        public int CountUp30Percent { get; set; } = 0;
        public Stage Quest { get; } = Stage.Two;
        public List<double> ReactionsAlarm { get; private set; } = new List<double>();
        public List<double> ReactionsSignalWithWarning { get; private set; } = new List<double>();
        private List<RowResult> results = new List<RowResult>();
        public List<RowResult> Results
        {
            get { return results; }
            set
            {
                results = value;
                OnPropertyChanged();
            }
        }
        /// <summary>
        /// Пропущено табличных экстренных сигналов
        /// </summary>
        public int SignalAlarmPasses { get; set; } = 0;

        public int SignalWithWarningPasses { get; set; } = 0;
        public void SetResult(RowResult result)
        {
            Results.Add(result);
            switch (result.TypeSignal)
            {
                case ReadinessForEmergencyAction.TypeSignals.Alarm:
                    ReactionsAlarm.Add(result.TimeReaction);
                    break;
                case ReadinessForEmergencyAction.TypeSignals.SignalWithWarning:
                    ReactionsSignalWithWarning.Add(result.TimeReaction);
                    break;
                case ReadinessForEmergencyAction.TypeSignals.AttentionSignal:
                    break;
                case ReadinessForEmergencyAction.TypeSignals.Percent30Plus:
                    break;
                case ReadinessForEmergencyAction.TypeSignals.NoActive:
                    break;
            }
        }
        
        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged([CallerMemberName]string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\GSRState.cs


namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public enum GSRState
    {
        Off,
        On
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\Indicator.cs


using System.Windows.Media;
using static Updk7.Tests.Wpf.Psychophysical.Common;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public class Indicator : NotifyViewModelBase
    {
        private Brush _IndicationColor;
        public Brush IndicationColor
        {
            get { return _IndicationColor; }
            set
            {
                _IndicationColor = value;
                OnPropertyChanged();
            }
        }

        private ColorsCircle _color;
        public ColorsCircle Color
        {
            get { return _color; }
            set
            {
                _color = value;
                OnPropertyChanged();
            }
        }

        public double Angle { get; set; }

        private bool _IsEnabledIndicator;
        public bool IsEnabledIndicator
        {
            get { return _IsEnabledIndicator; }
            set
            {
                _IsEnabledIndicator = value;
                OnPropertyChanged();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\IQuest.cs


using System.Collections.Generic;
using System.ComponentModel;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public interface IQuest:INotifyPropertyChanged
    {
        /// <summary>
        /// Количество пустых нажатий
        /// </summary>
        int CountLeftPresses { get; set; }

        Stage Quest { get; }

        List<double> ReactionsAlarm { get; }
        List<double> ReactionsSignalWithWarning { get; }
        List<RowResult> Results { get; }
        /// <summary>
        /// Количство пропусков (экстренный сигнал)
        /// </summary>
        int SignalAlarmPasses { get; set; }

        /// <summary>
        /// Количество пропусков (сигнал с предупреждением)
        /// </summary>
        int SignalWithWarningPasses { get; set; }
        void SetResult(RowResult result);
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\IQuestContext.cs


using System.Collections.Generic;
using System.ComponentModel;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public interface IQuestContext:INotifyPropertyChanged
    {
        IQuest CurrentQuest { get; }
        List<IQuest> Quests { get; set; }
        void ChangeQuest(Stage stage);
        Dictionary<string, object> ReturnResults();
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\ISignalsTable.cs


using System.Collections.Generic;
using System.ComponentModel;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public interface ISignalsTable:INotifyPropertyChanged
    {
        List<RowSignal> Signals { get; }
        /// <summary>
        /// Модифицирует сигналы базовой таблицы, возвращает cдвиг времени от базовой таблицы
        /// </summary>
        /// <param name="isTestStart"></param>
        /// <returns>Сдвиг времени от базовой таблицы</returns>
        int SetSignals(bool isTestStart = false);
        void AddSignal(RowSignal signal);
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\QuestContext.cs


using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public class QuestContext : IQuestContext
    {
        private IQuest currentQuest = null;
        public IQuest CurrentQuest
        {
            get { return currentQuest; }
            set
            {
                currentQuest = value;
                OnPropertyChanged();
            }
        }

        public List<IQuest> Quests { get; set; } = new List<IQuest>();
        public void ChangeQuest(Stage stage)
        {
            switch (stage)
            {
                case Stage.One:
                    {
                        var quest = Quests.FirstOrDefault(f => f.Quest == Stage.One);
                        if (quest == null)
                        {
                            quest = new GED1_Quest();
                            Quests.Add(quest);
                            CurrentQuest = quest;
                            break;
                        }
                        else
                            CurrentQuest = quest;
                        break;
                    }
                case Stage.Two:
                    {
                        var quest = Quests.FirstOrDefault(f => f.Quest == Stage.Two);
                        if (quest == null)
                        {
                            quest = new GED2_Quest();
                            Quests.Add(quest);
                            CurrentQuest = quest;
                            break;
                        }
                        else
                            CurrentQuest = quest;
                        break;
                    }
            }
        }

        public Dictionary<string, object> ReturnResults()
        {
            var Ged1Results = Quests.FirstOrDefault(f => f.Quest == Stage.One);
            var Ged2Results = Quests.FirstOrDefault(f => f.Quest == Stage.Two);

            if (Ged2Results == null)
            {
                ChangeQuest(Stage.Two);
                Ged2Results = Quests.FirstOrDefault(f => f.Quest == Stage.Two);
            }

            return Results.GetResults(Ged1Results, Ged2Results);
        }


        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged([CallerMemberName]string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\ReadinessForEmergencyActionControl_2.cs


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Media;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction;
using static Updk7.Tests.Wpf.Psychophysical.Common;
using static Updk7.Tests.Wpf.Psychophysical.Common.Drawing;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public class ReadinessForEmergencyActionControl_2 : NotifyViewModelBase, ILearning, IDisposable
    {
        public event EventHandler<bool> GsrOnOff;
        public event EventHandler ResetTimer;
        public event EventHandler<ResultsEventArgs> Results;

        private ISignalsTable _signals;
        public ISignalsTable Signals
        {
            get { return _signals; }
            set
            {
                _signals = value;
                OnPropertyChanged();
            }
        }

        private GSRState gSR_ON_OFF;
        public GSRState GSR_ON_OFF
        {
            get { return gSR_ON_OFF; }
            set
            {
                gSR_ON_OFF = value;
                OnPropertyChanged();
            }
        }

        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public int CurrentIndex
        {
            get { return _currentIndex; }
            set
            {
                _currentIndex = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// Текущий базовый ЭСК
        /// </summary>
        public double GSR
        {
            get { return _gsr; }
            set
            {
                _gsr = value;
                OnPropertyChanged();
            }
        }

        public bool IsGsrLockEnabled
        {
            get { return _isGsrLockEnabled; }
            set
            {
                _isGsrLockEnabled = value;
                OnPropertyChanged();
            }
        }

        public int Time
        {
            get { return _time; }
            set
            {
                _time = value;
                OnPropertyChanged();
            }
        }

        private TypeSignals _currentSignal = TypeSignals.NoActive;
        public TypeSignals CurrentSignal
        {
            get { return _currentSignal; }
            set
            {
                _currentSignal = value;
                OnPropertyChanged();
            }
        }

        private IQuestContext resultContext = null;
        public IQuestContext ResultsContext
        {
            get { return resultContext; }
            set
            {
                resultContext = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private int _currentIndex = 0;
        private double _gsr;
        private bool _isGsrLockEnabled;
        private int _time = 0;
        private const int _intervalGetGSR = 10;
        private const int _timeGsrDisabling = 6960;
        private const int _timeGsrFirstEnabling = 4080;
        //интервал получения ЭСК
        private const double valueOverGSRPercents = 30;

        private double? _backgroundValueGSR = null;
        private Indicator _centerCircle = null;
        private List<double> _currentValuesGsr = new List<double>();
        private DispatcherTimer _gsrValueTimer = new DispatcherTimer();
        private int _indexRow = 0;
        private List<Indicator> _indicators = new List<Indicator>();
        private SceneGenerator scene = new SceneGenerator();

        private SoundPlayer _player = new SoundPlayer();
        private NeuroTimer _timer = new NeuroTimer();

        private int countSecondsToCheckGSR = 0;
        private bool _is30PercentActive = false;
        public ReadinessForEmergencyActionControl_2(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            Initialize();
            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("Tick_1sec", () => Tick_1sec());
                TestMethods.Add("Jump", () => Tick_1sec(true));
                TestMethods.Add("Attention", () => AttentionSignal_1sec(true));
                TestMethods.Add("AttentionHide", () => AttentionSignal_1sec());
            }
        }

        private int indicatorIndex = 0;
        private void Tick_1sec(bool jump = false)
        {
            _indicators[indicatorIndex].IsEnabledIndicator = false;
            if (indicatorIndex == 59)
            {
                if (jump)
                    indicatorIndex = 1;
                else
                    indicatorIndex = 0;
            }
            else
            {
                if (jump)
                    indicatorIndex = indicatorIndex + 2;
                else
                    indicatorIndex++;

            }
            _indicators[indicatorIndex].IsEnabledIndicator = true;
        }

        private void AttentionSignal_1sec(bool isEnabled = false)
        {
            if (isEnabled)
            {
                _centerCircle.IndicationColor = GetColor(ColorsCircle.Yellow);
                _centerCircle.IsEnabledIndicator = true;
            }
            else
                _centerCircle.IsEnabledIndicator = false;
        }


        public void Start(bool isTestStart = false)
        {
            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick += _timer_Tick;
            _gsrValueTimer.Tick += _gsrValueTimer_Tick;
            _gsrValueTimer.Interval = TimeSpan.FromSeconds(_intervalGetGSR);

            ResultsContext = new QuestContext();
            ResultsContext.ChangeQuest(Stage.One);

            PrepareTableSignals(isTestStart);

            //#if DEBUG
            //            Time = 3597;
            //#endif

            if (Mode != TestMode.Manual)
                _timer.Start();
            _indicators[CurrentIndex].IsEnabledIndicator = true;
        }

        private void Initialize()
        {
            GenerateScene();
        }

        public void Dispose()
        {
            _ms?.Dispose();
            _player.Dispose();
            _timer.Stop();
            _timer.Dispose();
        }

        public void GSRValue(double value)
        {
            _currentValuesGsr.Add(value);
        }

        public void PressButtton(int time)
        {
            if (CurrentSignal != TypeSignals.NoActive && CurrentSignal != TypeSignals.AttentionSignal)
            {
                _timer.Tick -= _timer_Tick;
                if (CurrentSignal == TypeSignals.Alarm)
                {
                    var curTime = TimeSpan.FromSeconds(time / 10000.0).TotalMilliseconds;
                    if (ResultsContext.CurrentQuest.Quest == Stage.One)
                    {
                        //ResultsContext.CurrentQuest.ReactionsAlarm.Add(curTime);
                        if (currentRowSignal != null)
                            ResultsContext.CurrentQuest.SetResult(new RowResult(curTime, currentRowSignal.Time, CurrentSignal, 0));
                    }
                    else if (ResultsContext.CurrentQuest.Quest == Stage.Two)
                    {
                        if (currentRowSignal != null)
                            ResultsContext.CurrentQuest.SetResult(new RowResult(curTime, currentRowSignal.Time, CurrentSignal, _currentValuesGsr.Count > 0 ? _currentValuesGsr.Average() : 0.0));
                        if (ResultsContext.CurrentQuest is GED2_Quest ged2)
                            ged2.CountPassesInRow = 0;
                        if (_is30PercentActive)
                            _is30PercentActive = false;
                        GsrControlling(GSRState.On);
                    }
                    _indicators[CurrentIndex].IsEnabledIndicator = false;
                    CurrentIndex = CurrentIndex - 1;
                    if (CurrentIndex < 0)
                        CurrentIndex = _indicators.Count - 1;
                    _indicators[CurrentIndex].IsEnabledIndicator = true;
                    CurrentSignal = TypeSignals.NoActive;
                    disabledChecksReactionToTimeout();
                }
                else if (CurrentSignal == TypeSignals.SignalWithWarning)
                {
                    var curTime = TimeSpan.FromSeconds(time / 10000.0).TotalMilliseconds;
                    _indicators[CurrentIndex].IsEnabledIndicator = false;
                    CurrentIndex = CurrentIndex - 1;
                    if (CurrentIndex < 0)
                        CurrentIndex = _indicators.Count - 1;
                    _indicators[CurrentIndex].IsEnabledIndicator = true;
                    if (currentRowSignal != null)
                        ResultsContext.CurrentQuest.SetResult(new RowResult(curTime, currentRowSignal.Time, CurrentSignal, 0));
                    CurrentSignal = TypeSignals.NoActive;
                    disabledChecksReactionToTimeout();

                    if (ResultsContext.CurrentQuest is GED2_Quest ged2)
                        ged2.CountPassesInRow = 0;
                }
                if (Mode != TestMode.Manual)
                    _timer.Tick += _timer_Tick;
            }
            else if (CurrentSignal == TypeSignals.NoActive)
            {
                ResultsContext.CurrentQuest.SetResult(new RowResult(0, _time, CurrentSignal, 0));
                ResultsContext.CurrentQuest.CountLeftPresses++;
            }
        }

        private double _secondsToTimeout = -1;
        private double _currentSecondsToTimeout = 0;
        private void enabledChecksReactionTimeout(double seconds)
        {
            _currentSecondsToTimeout = 0;
            _secondsToTimeout = seconds;
        }

        private void disabledChecksReactionToTimeout()
        {
            _secondsToTimeout = -1;
            _currentSecondsToTimeout = 0;
        }

        public void Stop()
        {
            _player.Stop();
            Dispose();
            _gsrValueTimer.Stop();
            _timer.Stop();

            _gsrValueTimer.Tick -= _gsrValueTimer_Tick;
            _timer.Tick -= _timer_Tick;
        }

        private void _gsrValueTimer_Tick(object sender, EventArgs e)
        {
            if (_backgroundValueGSR == null)
            {
                _backgroundValueGSR = _currentValuesGsr.Count > 0 ? _currentValuesGsr.Average() : 0.0;
                GSR = _backgroundValueGSR.Value;
            }
            else
                CheckGsr();
        }

        private void ChecksReactionTimeout()
        {
            var ged2 = ResultsContext.CurrentQuest as GED2_Quest;

            switch (CurrentSignal)
            {
                case TypeSignals.Alarm:
                    if (ResultsContext.CurrentQuest.Quest == Stage.One)
                    {
                        ResultsContext.CurrentQuest.SignalAlarmPasses++;
                        if (currentRowSignal != null)
                            ResultsContext.CurrentQuest.SetResult(new RowResult(-1, currentRowSignal.Time, TypeSignals.Alarm, 0));
                    }
                    else if (ResultsContext.CurrentQuest.Quest == Stage.Two)
                    {
                        if (ged2 != null)
                            ged2.CountPassesInRow++;
                        if (currentRowSignal != null)
                            ResultsContext.CurrentQuest.SetResult(new RowResult(-1, currentRowSignal.Time, TypeSignals.Alarm, GSR));

                        if (_is30PercentActive)
                        {
                            (ResultsContext.CurrentQuest as GED2_Quest).CountPassesAdditionalSignals++;
                            if (ged2.CountPassesInRow < 4)//если не реагировали на сигнал превышения запустить еще один через 30 секунд
                            {
                                (ResultsContext.CurrentQuest as GED2_Quest).CountAddAdditionalSignals++;
                                var NearRowSignalByTime = Signals.Signals.Where(s => s.Time < Time).OrderBy(o => o.Time).Last();//ближний максимальный со стороны меньше
                                Signals.AddSignal(new RowSignal(TypeSignals.Alarm, TimeSpan.FromSeconds(NearRowSignalByTime.Time + 30)));
                            }
                        }
                        else
                            (ResultsContext.CurrentQuest as GED2_Quest).SignalAlarmPasses++;
                    }
                    break;
                case TypeSignals.SignalWithWarning:
                    ResultsContext.CurrentQuest.SignalWithWarningPasses++;
                    if (ged2 != null)
                    {
                        ged2.CountPassesInRow++;
                        if (currentRowSignal != null)
                            ResultsContext.CurrentQuest.SetResult(new RowResult(-1, currentRowSignal.Time, TypeSignals.SignalWithWarning, GSR));
                        Stop();
                        ReturnResult(_passesSignalWithWarning: true);
                    }
                    else
                    {
                        if (currentRowSignal != null)
                            ResultsContext.CurrentQuest.SetResult(new RowResult(-1, currentRowSignal.Time, TypeSignals.SignalWithWarning, 0));
                    }
                    break;
                case TypeSignals.AttentionSignal:
                    _centerCircle.IsEnabledIndicator = false;
                    break;
            }

            if (ResultsContext.CurrentQuest.Quest == Stage.Two)
                if (Mode != TestMode.Manual)
                    GsrOnOff?.Invoke(this, true);

            CurrentSignal = TypeSignals.NoActive;
            disabledChecksReactionToTimeout();

            if (ged2 != null && ged2.CountPassesInRow > 3)
            {
                Stop();
                ReturnResult(_isFourPasses: true);
            }
        }

        private RowSignal currentRowSignal = null;
        private void _timer_Tick(object sender, EventArgs e)
        {
            var rowSignal = Signals.Signals.FirstOrDefault(f => f.Time == Time);

            if (rowSignal != null)
            {
                currentRowSignal = rowSignal;
                var signal = rowSignal.Type;
                switch (signal)
                {
                    case TypeSignals.Alarm:
                        Jump();
                        CurrentSignal = TypeSignals.Alarm;

                        if (Mode != TestMode.Manual)
                            enabledChecksReactionTimeout(4);
                        if (ResultsContext.CurrentQuest.Quest == Stage.Two)
                            if (Mode != TestMode.Manual)
                                GsrOnOff?.Invoke(this, false);
                        if (Mode != TestMode.Manual)
                            ResetTimer?.Invoke(this, new EventArgs());
                        break;
                    case TypeSignals.SignalWithWarning:
                        Jump();
                        CurrentSignal = TypeSignals.SignalWithWarning;
                        if (Mode != TestMode.Manual)
                            enabledChecksReactionTimeout(2);
                        if (ResultsContext.CurrentQuest.Quest == Stage.Two)
                            if (Mode != TestMode.Manual)
                                GsrOnOff?.Invoke(this, false);
                        if (Mode != TestMode.Manual)
                            ResetTimer?.Invoke(this, new EventArgs());
                        break;
                    case TypeSignals.AttentionSignal:
                        YellowSignalActive();
                        CurrentSignal = TypeSignals.AttentionSignal;
                        _indicators[CurrentIndex].IsEnabledIndicator = false;
                        CurrentIndex++;
                        if (CurrentIndex == _indicators.Count)
                            CurrentIndex = 0;
                        _indicators[CurrentIndex].IsEnabledIndicator = true;
                        ResultsContext.CurrentQuest.SetResult(new RowResult(float.NaN, _time, CurrentSignal, float.NaN));
                        if (Mode != TestMode.Manual)
                            enabledChecksReactionTimeout(2);
                        break;
                }
                _indexRow++;
            }
            else
            {
                _indicators[CurrentIndex].IsEnabledIndicator = false;
                CurrentIndex++;
                if (CurrentIndex == _indicators.Count)
                    CurrentIndex = 0;
                _indicators[CurrentIndex].IsEnabledIndicator = true;
            }
            PlaySound();
            //PlaySoundSync();

            // Запуск второго часа
            if (Time >= 3600 && ResultsContext.CurrentQuest.Quest != Stage.Two)
            {
                ResultsContext.ChangeQuest(Stage.Two);

                //Проверка результатов первого часа
                _isNormalResultOneHour = CheckForNormalResults();
            }

            // 3860 - время проверки результатов первого часа 
            if (Time == 3860)
            {
                if (!_isNormalResultOneHour)
                {
                    _timer.Stop();
                    ReturnResult(_isNotNormalResults: true);
                }
            }

            if (ResultsContext.CurrentQuest.Quest == Stage.Two)
            {
                if (Time == 4080 && gSR_ON_OFF != GSRState.On)
                    GsrControlling(GSRState.On);

                if (Time >= 6960 && gSR_ON_OFF != GSRState.Off)
                {
                    GsrControlling(GSRState.Off);
                    _is30PercentActive = false;
                }

                if (Time >= 7200 && Time != 0)
                {
                    _timer.Stop();
                    ReturnResult();
                }
            }
            Time++;

            if (_secondsToTimeout != -1 && _currentSecondsToTimeout == _secondsToTimeout)
            {
                ChecksReactionTimeout();
                disabledChecksReactionToTimeout();
            }
            else
                _currentSecondsToTimeout++;
        }

        private bool _isNormalResultOneHour;
        private bool CheckForNormalResults()
        {
            var questOne = ResultsContext.Quests[0].Quest == Stage.One ? ResultsContext.Quests[0] : null;
            var alarmAverage = questOne.ReactionsAlarm.Count > 0 ? questOne.ReactionsAlarm.Average(a => TimeSpan.FromMilliseconds(a).TotalSeconds) : 0.0;
            var withWarningAverage = questOne.ReactionsSignalWithWarning.Count > 0 ? questOne.ReactionsSignalWithWarning.Average(a => TimeSpan.FromMilliseconds(a).TotalSeconds) : 0.0;

            var countWithWarnMore1Sec = questOne.ReactionsSignalWithWarning.Count > 0 ? questOne.ReactionsSignalWithWarning.Where(w => w >= 1000.0).Count() : 0.0;

            var vigilance = TimeSpan.FromSeconds(alarmAverage - withWarningAverage);

            if (questOne.SignalAlarmPasses >= 4 ||
                Math.Round(vigilance.TotalSeconds, 2) > 0.250 ||
                countWithWarnMore1Sec > 3 ||
                questOne.SignalWithWarningPasses > 0)
                return false;
            return true;
        }

        private void CheckGsr()
        {
            var percent30 = _backgroundValueGSR * 0.3;
            var currentAverageGSR = _currentValuesGsr.Count > 0 ? _currentValuesGsr.Average() : _backgroundValueGSR;
            if ((currentAverageGSR - _backgroundValueGSR) > percent30)
            {
                var moreThanTimeMin = Signals.Signals.Where(s => s.Time > Time).OrderBy(o => o.Time).First();
                var time = moreThanTimeMin.Time - Time;
                if (time >= 180)
                {
                    _backgroundValueGSR = currentAverageGSR;
                    (ResultsContext.CurrentQuest as GED2_Quest).CountUp30Percent++;
                    Signals.AddSignal(new RowSignal(TypeSignals.Alarm, TimeSpan.FromSeconds(Time + 30)));
                    (ResultsContext.CurrentQuest as GED2_Quest).CountAddAdditionalSignals++;
                    GsrControlling(GSRState.Off);
                    _is30PercentActive = true;
                    if (_backgroundValueGSR != null)
                        GSR = _backgroundValueGSR.Value;
                }
            }
        }

        private void GsrControlling(GSRState state)
        {
            switch (state)
            {
                case GSRState.Off:
                    if (Mode != TestMode.Manual)
                        GsrOnOff?.Invoke(this, false);
                    _gsrValueTimer.Stop();
                    break;
                case GSRState.On:
                    if (Mode != TestMode.Manual)
                    {
                        GsrOnOff?.Invoke(this, true);
                        _gsrValueTimer.Start();
                    }
                    _currentValuesGsr.Clear();
                    break;
            }
            GSR_ON_OFF = state;
        }

        private void Jump()
        {
            _indicators[CurrentIndex].IsEnabledIndicator = false;
            CurrentIndex = CurrentIndex + 2;
            if (CurrentIndex == _indicators.Count)
                CurrentIndex = 0;
            else if (CurrentIndex > _indicators.Count)
                CurrentIndex = 1;
            _indicators[CurrentIndex].IsEnabledIndicator = true;
        }

        private void PlaySound()
        {
            _player.Play();
        }

        private void YellowSignalActive()
        {
            _centerCircle.IndicationColor = GetColor(ColorsCircle.Yellow, true);
            _centerCircle.IsEnabledIndicator = true;
        }

        private void PrepareTableSignals(bool isTestStart)
        {
            var signals = new SignalsTable();
            var offset = signals.SetSignals(isTestStart);
            Signals = signals;
            (ResultsContext.CurrentQuest as GED1_Quest).OffsetTime = offset;
        }

        private void ReturnResult(bool _passesSignalWithWarning = false, bool _isNotNormalResults = false, bool _isFourPasses = false)
        {
            if (Mode != TestMode.Manual)
            {
                if (_isNotNormalResults || _isFourPasses || _passesSignalWithWarning)
                {
                    var res = ResultsContext.ReturnResults();
                    if (_isNotNormalResults)
                    {
                        Results?.Invoke(this, new ResultsEventArgs(res, false)
                        {
                            Message = "Тест ГЭД-2 остановлен по результатам первого часа!"
                        });
                    }
                    else if (_passesSignalWithWarning)
                    {
                        Results?.Invoke(this, new ResultsEventArgs(res, false)
                        {
                            Message = "Тест ГЭД-2 остановлен!\r\n Пропущен сигнал с предупреждением!"
                        });
                    }
                    else if (_isFourPasses)
                    {
                        Results?.Invoke(this, new ResultsEventArgs(res, false)
                        {
                            Message = "Тест ГЭД-2 остановлен!\r\n Пропущено 4 сигнала подряд!"
                        });
                    }
                }
                else
                    Results?.Invoke(this, new ResultsEventArgs(ResultsContext.ReturnResults(), true));
            }
        }
        private MemoryStream _ms;
        private void GenerateScene()
        {
            var byteArray =
               SoundResources.GetSoundArray("pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/beep.wav");
            _ms = new MemoryStream(byteArray);
            _player.Stream = _ms;

            Canva = scene.GetScene();
            _indicators = scene.GetIndicators();
            _centerCircle = scene.GetCenterIndicator();
        }
    }

    public class ResultsEventArgs : EventArgs
    {
        public Dictionary<string, object> Results { get; private set; }
        public string Message { get; set; }
        public bool IsDone { get; private set; }

        public ResultsEventArgs(Dictionary<string, object> results, bool isDone)
        {
            Results = results;
            IsDone = isDone;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\ReadinessForEmergencyActionViewModel_2.cs


using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public class ReadinessForEmergencyActionViewModel_2 : TestBase
    {
        public override event EventHandler<Psychophysical.Results> Results;

        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                OnPropertyChanged();
            }
        }

        private PultButtons Buttons;
        private PultGsr GSR;
        public ReadinessForEmergencyActionControl_2 control;
        private DispatcherTimer _messageTimer = new DispatcherTimer();

        public ReadinessForEmergencyActionViewModel_2(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("readinessForEmergencyAction_2");
            Manager.TraningTime = Common.GetSeconds(75);
        }

        public override FrameworkElement GetTestControl()
        {
            return new ReadinessForEmergencyActionControl_2(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new ReadinessForEmergencyActionControl_2(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Psychophysical.Results(new Dictionary<string, object>()) { Exception = e });
        }
        private void Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Psychophysical.Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }
        
        public override void TestStart()
        {
            control = new ReadinessForEmergencyActionControl_2();
            Buttons = Pult as PultButtons;
            GSR = AdditionalPult as PultGsr;
            Buttons.Disconnected += Disconnected;
            GSR.Disconnected += Disconnected;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            control.ResetTimer += Control_ResetTimer;
            GSR.GsrValueChanged += GSR_GsrValueChanged;
            _messageTimer.Interval = TimeSpan.FromSeconds(5);
            _messageTimer.Tick += _messageTimer_Tick;
            control.GsrOnOff += Control_GsrOnOff;
            Buttons.Start();
            control.Start(false);
            TestCurrentView = control;
        }

        public override void Start()
        {
            control = new ReadinessForEmergencyActionControl_2();
            Buttons = Pult as PultButtons;
            GSR = AdditionalPult as PultGsr;
            Buttons.Disconnected += Disconnected;
            GSR.Disconnected += Disconnected;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            control.Results += control_Results;
            control.ResetTimer += Control_ResetTimer;
            GSR.GsrValueChanged += GSR_GsrValueChanged;
            _messageTimer.Interval = TimeSpan.FromSeconds(5);
            _messageTimer.Tick += _messageTimer_Tick;
            control.GsrOnOff += Control_GsrOnOff;
            Buttons.Start();
            control.Start(false);
            TestCurrentView = control;
        }

        private void _messageTimer_Tick(object sender, EventArgs e)//завершаем тест по причине ошибки испытуемого
        {
            _messageTimer.Stop();
            Message = "";
            Results?.Invoke(this, new Psychophysical.Results(_results));
            Stop();
        }

        private void Control_GsrOnOff(object sender, bool e)
        {
            if (e)
                GSR.Start();
            else
                GSR.Stop();
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void GSR_GsrValueChanged(object sender, GsrValueCgangedEventArgs e)
        {
            control.GSRValue(e.NewValue);
        }

        private Dictionary<string, object> _results;
        private void control_Results(object sender, ResultsEventArgs e)
        {
            if (e.IsDone)//IsDone==true значит все хорошо, тест закончился
            {
                Results?.Invoke(this, new Psychophysical.Results(e.Results));
                Stop();
            }
            else//тест завершился по причине какой то из ошибок испытуемого, запускаем таймер и показываем сообщение испытуемому
            {
                _results = e.Results;
                Message = e.Message;
                _messageTimer.Start();
            }
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Green)
                control.PressButtton(e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (GSR != null)
            {
                GSR.Disconnected -= Disconnected;
                GSR.GsrValueChanged -= GSR_GsrValueChanged;
                GSR.Stop();
            }
            if (Buttons != null)
            {
                Buttons.Disconnected -= Disconnected;
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.GsrOnOff -= Control_GsrOnOff;
                control.ResetTimer -= Control_ResetTimer;
                control.Results -= control_Results;
                control.Stop();
                control?.Dispose();
            }
            _messageTimer.Tick -= _messageTimer_Tick;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\Results.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public static class Results
    {
        public static Dictionary<string, object> GetResults(IQuest Ged1Results, IQuest Ged2Results)
        {
            var alarms1 = Ged1Results.ReactionsAlarm.Count > 0? Ged1Results.ReactionsAlarm.Where(w => w > 0): new List<double>();
            var AlarmsAverage1 = alarms1.Count() > 0 ? alarms1.Average() : 0.0;

            var signalsWithWarningOverZero1 = Ged1Results.ReactionsSignalWithWarning.Count > 0 ? Ged1Results.ReactionsSignalWithWarning.Where(w => w > 0) : new List<double>();
            var SignalsWithWarningAverage1 = signalsWithWarningOverZero1.Count() > 0 ? signalsWithWarningOverZero1.Average() : 0.0;
            
            var alarms2 = Ged2Results.ReactionsAlarm.Count > 0 ? Ged2Results.ReactionsAlarm.Where(w => w > 0) : new List<double>();
            var AlarmsAverage2 = alarms2.Count() > 0 ? alarms2.Average() : 0.0;

            var signalsWithWarningOverZero2 = Ged2Results.ReactionsSignalWithWarning.Count > 0 ? Ged2Results.ReactionsSignalWithWarning.Where(w => w > 0) : new List<double>();
            var SignalsWithWarningAverage2 = signalsWithWarningOverZero2.Count() > 0 ? signalsWithWarningOverZero2.Average() : 0.0;

            var CountSignalsWithWarnMore1Sec = Ged1Results.ReactionsSignalWithWarning.Count > 0 ? Ged1Results.ReactionsSignalWithWarning.Where(w => w > 1000).Count() : 0;

            double indicatorReliadility = AlarmsAverage2 - SignalsWithWarningAverage2;

            var CountUp30Percent = (Ged2Results as GED2_Quest).CountUp30Percent;

            return new Dictionary<string, object>()
            {
                ["ГЭД-1 Среднеарифметическое время реагирования на сигналы без предупреждения"] = (float)AlarmsAverage1 / 1000,
                ["ГЭД-1 Среднеарифметическое время реагирования на сигналы с предупреждением"] = (float)SignalsWithWarningAverage1 / 1000,
                ["ГЭД-1 Число пропущенных сигналов без предупреждения"] = Ged1Results.SignalAlarmPasses,
                ["ГЭД-1 Готовность"] = (float)(AlarmsAverage1 - SignalsWithWarningAverage1) / 1000,
                ["ГЭД-1 Число пропущенных сигналов с предупреждением"] = Ged1Results.SignalWithWarningPasses,
                //["ГЭД-1 Сдвиг"] = (Ged1Results as GED1_Quest).OffsetTime,
                ["ГЭД-1 Число реагирований при отсутствии сигналов"] = Ged1Results.CountLeftPresses,
                ["ГЭД-1 Кол-во реагирований на сигналы с предупреждением большие 1 с"] = CountSignalsWithWarnMore1Sec,

                ["ГЭД-1 Таблица_Действие"] = Ged1Results.Results.Select(s => (int)s.TypeSignal).ToArray(),
                ["ГЭД-1 Таблица_Время"] = Ged1Results.Results.Select(s => (float)s.TimePresent).ToArray(),
                ["ГЭД-1 Таблица_Реакция"] = Ged1Results.Results.Select(s => (float)s.TimeReaction / 1000).ToArray(),


                ["ГЭД-2 Ср. арифм. времён реагирования на все перескоки без предупреждения"] = (float)AlarmsAverage2 / 1000,
                ["ГЭД-2 Ср. арифм. времён реагирования на перескоки c предупреждением"] = (float)SignalsWithWarningAverage2 / 1000,
                ["ГЭД-2 Число перескоков превышений сопротивления"] = CountUp30Percent,
                ["ГЭД-2 Число пропусков перескоков без предупреждения"] = Ged2Results.SignalAlarmPasses,//Все пропуски экстренных сигналов
                ["ГЭД-2 Отношение пропущенных скачков к поданным"] = (float)(Ged2Results.SignalAlarmPasses / (4.0 + CountUp30Percent)),//количество пропущенных экстренных сигналов к сигналам превышения сопротивления плюс 4 табличных экстренных сигнала
                ["ГЭД-2 Показатель  надёжности  работы в состоянии утомления"] = (float)indicatorReliadility / 1000,

                ["ГЭД-2 Таблица_Действие"] = Ged2Results.Results.Select(s => (int)s.TypeSignal).ToArray(),
                ["ГЭД-2 Таблица_Время"] = Ged2Results.Results.Select(s => (float)s.TimePresent).ToArray(),
                ["ГЭД-2 Таблица_Реакция"] = Ged2Results.Results.Select(s => (float)s.TimeReaction / 1000).ToArray(),
                ["ГЭД-2 Таблица_Сопротивление"] = Ged2Results.Results.Select(s => (int)s.GSR).ToArray(),

                ["ГЭД-2 Количество пропусков скачков подряд"] = (Ged2Results as GED2_Quest).CountPassesInRow,
                ["ГЭД-2 Число реагирований при отсутствии сигналов"] = Ged2Results.CountLeftPresses,
                ["ГЭД-2 Число пропущенных сигналов с предупреждением"] = Ged2Results.SignalWithWarningPasses
            };
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\RowResult.cs


using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public class RowResult
    {
        public RowResult(double timeReaction, int timePresent, TypeSignals typeSignal, double gSR)
        {
            TimeReaction = timeReaction;
            TimePresent = timePresent;
            TypeSignal = typeSignal;
            GSR = gSR;
        }

        public double GSR { get; set; }
        public int TimePresent { get; private set; }
        public double TimeReaction { get; private set; }
        public TypeSignals TypeSignal { get; private set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\RowSignal.cs


using System;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public class RowSignal
    {
        public RowSignal(TypeSignals type, TimeSpan time)
        {
            Type = type;
            Time = (int)time.TotalSeconds;
        }

        public int Time { get; set; }
        public TypeSignals Type { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\SceneGenerator.cs


using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using static Updk7.Tests.Wpf.Psychophysical.Common;
using static Updk7.Tests.Wpf.Psychophysical.Common.Drawing;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public class SceneGenerator
    {
        public SceneGenerator()
        {
            canvas = new Canvas();
            canvas.Width = 500;
            canvas.Height = 500;
        }

        public Canvas GetScene()
        {
            generateCircles(new Size(canvas.Width, canvas.Height));
            return canvas;
        }

        private Indicator centerCircle;
        private Canvas canvas;
        private List<Indicator> _indicators = new List<Indicator>();

        public List<Indicator> GetIndicators()
        {
            return _indicators;
        }

        public Indicator GetCenterIndicator()
        {
            return centerCircle;
        }

        private void generateCircles(Size canvasSize, int countCircles = 60)
        {
            var center = canvas.Height / 2;
            var angle = 360 / countCircles;
            Point centerPoint = new Point(center, 0);
            Size indicatorSize = new Size(15, 15);

            for (int i = 270; i < 360; i = i + angle)
                SetIndicator(canvasSize, centerPoint, indicatorSize, i);

            for (int i = 0; i < 270; i = i + angle)
                SetIndicator(canvasSize, centerPoint, indicatorSize, i);

            var cCircle = new Indicator();
            cCircle.Height = cCircle.Width = indicatorSize.Height * 2;
            cCircle.SetValue(Canvas.LeftProperty, (canvas.Width / 2) - cCircle.Width / 2);
            cCircle.SetValue(Canvas.TopProperty, (canvas.Height / 2) - cCircle.Height / 2);
            canvas.Children.Add(cCircle);
            centerCircle = cCircle;
        }

        private Indicator generateCircle(Point centerpoint, Size size, double angle, Size canvasSize, Brush fill)
        {
            var v = rotateVector(centerpoint, angle);
            var elli = new Indicator() { Height = size.Height, Width = size.Width, IndicationColor = fill };

            //Сдвигаем точку, т. к. вектор строится от нуля
            v.X = (v.X + canvasSize.Width / 2);
            v.Y = (v.Y + canvasSize.Height / 2);

            elli.SetValue(Canvas.LeftProperty, v.X - elli.Width / 2);
            elli.SetValue(Canvas.TopProperty, v.Y - elli.Height / 2);
            elli.Angle = angle;
            return elli;
        }

        private Vector rotateVector(Point centerPoint, double angle)
        {
            double vX = (centerPoint.X * Math.Cos(Mathematic.ToRadians(angle))) - (centerPoint.Y * Math.Sin(Mathematic.ToRadians(angle)));
            double vY = (centerPoint.X * Math.Sin(Mathematic.ToRadians(angle))) + (centerPoint.Y * Math.Cos(Mathematic.ToRadians(angle)));
            return new Vector(vX, vY);
        }

        private void SetIndicator(Size canvasSize, Point centerPoint, Size indicatorSize, int i)
        {
            var color = ColorsCircle.Green;
            var indicator = generateCircle(centerPoint, indicatorSize, i, canvasSize, GetColor(color, true));
            indicator.Color = color;
            canvas.Children.Add(indicator);
            _indicators.Add(indicator);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\SignalsTable.cs


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public class SignalsTable : ISignalsTable
    {
        private List<RowSignal> _signals = new List<RowSignal>()
        {
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,2,03)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,2,08)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,6,00)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,13,18)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,13,21)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,18,45)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,18,48)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,25,45)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,30,03)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,30,07)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,37,06)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,44,42)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,48,30)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,48,33)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,54,51)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,58,18)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,59,03)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,59,08))
        };

        public List<RowSignal> Signals
        {
            get { return _signals; }
            set
            {
                _signals = value;
                OnPropertyChanged();
            }
        }
        
        public int SetSignals(bool isTestStart = false)
        {
            int offset = 0;
            if (isTestStart)
            {
                _signals = new List<RowSignal>()
                           {
                                new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,30)),
                                new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,35)),
                                new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,45))
                           };
            }
            else
            {
                Random rnd = new Random();
                var variant = rnd.Next(1, 4);
                if (variant == 1)
                {

                }
                else if (variant == 2)
                {
                    for (int i = 0; i < 15; i++)
                        _signals[i].Time = _signals[i].Time + (int)new TimeSpan(0, 0, 55).TotalSeconds;
                    offset = 55;
                }
                else if (variant == 3)
                {
                    for (int i = 0; i < 15; i++)
                        _signals[i].Time = _signals[i].Time + (int)new TimeSpan(0, 1, 55).TotalSeconds;
                    offset = 115;
                }
            }

            //Для второго часа
            _signals.AddRange(
                new List<RowSignal>()
                {
                 new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(1,4,03)),
                 new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(1,4,09)),
                 new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(1,7,05)),
                 new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(1,7,10)),
                 new RowSignal(TypeSignals.Alarm,new TimeSpan(1,10,10)),
                 new RowSignal(TypeSignals.Alarm,new TimeSpan(1,20,04)),
                 new RowSignal(TypeSignals.Alarm,new TimeSpan(1,30,16)),
                 new RowSignal(TypeSignals.Alarm,new TimeSpan(1,40,12)),
                 new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(1,56,45)),
                 new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(1,56,54)),
                 new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(1,59,33)),
                 new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(1,59,48))
                 });

            OnPropertyChanged("Signals");
            return offset;
        }

        public void AddSignal(RowSignal signal)
        {
            _signals.Add(signal);
            _signals = _signals.OrderBy(o => o.Time).ToList();
            OnPropertyChanged("Signals");
        }

        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged([CallerMemberName]string prop = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\Stage.cs


namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2
{
    public enum Stage
    {
        /// <summary>
        /// Ged-1
        /// </summary>
        One,
        /// <summary>
        /// Ged-2
        /// </summary>
        Two
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels"
                    xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Converters">
    <Style TargetType="local:ReadinessForEmergencyActionControl_2">
        <Setter Property="Background" Value="#FF727171"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReadinessForEmergencyActionControl_2">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox Height="1000" Width="1000">
                                        <ContentControl Focusable="False" Margin="5" Content="{Binding Canva, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ReadinessForEmergencyActionControl_2}}}"/>
                                    </Viewbox>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:ReadinessForEmergencyActionControl_2}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ReadinessForEmergencyActionViewModel_2">
        <Style.Resources>
            <converters:StringOrEmptyConverter x:Key="StringOrEmptyConverter"/>
        </Style.Resources>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReadinessForEmergencyActionViewModel_2">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <tests:MessageBoxControl x:Name="mBox" Message="{Binding Message,
                                                               RelativeSource={RelativeSource FindAncestor,
                                                               AncestorType={x:Type local:ReadinessForEmergencyActionViewModel_2}}}"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:ReadinessForEmergencyActionViewModel_2}}}"/>
                        </Grid>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Message,
                                                   RelativeSource={RelativeSource Self},
                                                   Converter={StaticResource StringOrEmptyConverter}}" Value="true">
                            <Setter TargetName="mBox" Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <SolidColorBrush x:Key="DefaultBrushIndicator" Color="#FF535151"/>
    <Style TargetType="{x:Type local:Indicator}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Indicator}">
                    <ContentControl>
                        <Ellipse x:Name="el" StrokeThickness="1" Stroke="{x:Null}" Fill="{StaticResource DefaultBrushIndicator}"/>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsEnabledIndicator,RelativeSource={RelativeSource Self}}" Value="false">
                            <Setter TargetName="el" Property="Fill" Value="{StaticResource DefaultBrushIndicator}"/>
                            <Setter TargetName="el" Property="StrokeThickness" Value="1"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsEnabledIndicator, RelativeSource={RelativeSource Self}}" Value="true">
                            <Setter TargetName="el" Property="Fill" Value="{Binding IndicationColor, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Indicator}}}"/>
                            <Setter TargetName="el" Property="Margin" Value="-1"/>
                            <Setter TargetName="el" Property="Stroke" Value="White"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2M\GED_2_Signals.cs


using System;
using System.Collections.Generic;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyActionM;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2M
{
    public class GED_2_Signals : ISignals
    {
        public BaseVariant Variant { get; private set; }
        public StartType StartType { get; set; }
        public GED_2_Signals(StartType type)
        {
            if (type == StartType.Normal)
                GenerateSignals();
            else if (type == StartType.TestStart)
                Variant = new TestVariant();
        }

        public void GenerateSignals()
        {
            var variant = (Variants)Common._rnd.Next(0, 7);
            switch (variant)
            {
                case Variants.Variant_1:
                    Variant = new VariantSignals_1();
                    break;
                case Variants.Variant_2:
                    Variant = new VariantSignals_2();
                    break;
                case Variants.Variant_3:
                    Variant = new VariantSignals_3();
                    break;
                case Variants.Variant_4:
                    Variant = new VariantSignals_4();
                    break;
                case Variants.Variant_5:
                    Variant = new VariantSignals_5();
                    break;
                case Variants.Variant_6:
                    Variant = new VariantSignals_6();
                    break;
                case Variants.Variant_7:
                    Variant = new VariantSignals_7();
                    break;
            }

            //Для второго часа

            Variant.Signals.AddRange(new List<Signal>()
            {
                 new Signal(TypeSignals.AttentionSignal, new TimeSpan(1, 4, 03)),
                 new Signal(TypeSignals.SignalWithWarning, new TimeSpan(1, 4, 09)),
                 new Signal(TypeSignals.AttentionSignal, new TimeSpan(1, 7, 05)),
                 new Signal(TypeSignals.SignalWithWarning, new TimeSpan(1, 7, 10)),
                 new Signal(TypeSignals.Alarm, new TimeSpan(1, 10, 10)),
                 new Signal(TypeSignals.Alarm, new TimeSpan(1, 20, 04)),
                 new Signal(TypeSignals.Alarm, new TimeSpan(1, 30, 16)),
                 new Signal(TypeSignals.Alarm, new TimeSpan(1, 40, 12)),
                 new Signal(TypeSignals.AttentionSignal, new TimeSpan(1, 56, 45)),
                 new Signal(TypeSignals.SignalWithWarning, new TimeSpan(1, 56, 54)),
                 new Signal(TypeSignals.AttentionSignal, new TimeSpan(1, 59, 33)),
                 new Signal(TypeSignals.SignalWithWarning, new TimeSpan(1, 59, 48))
            });

            Variant.OnPropertyChanged(nameof(Variant.Signals));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2M\ReadinessForEmergencyAction_2MControl.cs


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Media;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyActionM;
using static Updk7.Tests.Wpf.Psychophysical.Common;
using static Updk7.Tests.Wpf.Psychophysical.Common.Drawing;
using Indicator = Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2.Indicator;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2M
{
    public class ReadinessForEmergencyAction_2MControl : NotifyViewModelBase, ILearning, IDisposable
    {
        public event EventHandler<bool> GsrOnOff;
        public event EventHandler ResetTimer;
        public event EventHandler<ResultsEventArgs> Results;

        private Canvas _canva;
        private int _currentIndex = 0;
        private GED_2_Signals _signals;
        public GED_2_Signals Signals
        {
            get { return _signals; }
            set
            {
                _signals = value;
                OnPropertyChanged();
            }
        }

        private GSRState gSR_ON_OFF;
        public GSRState GSR_ON_OFF
        {
            get { return gSR_ON_OFF; }
            set
            {
                gSR_ON_OFF = value;
                OnPropertyChanged();
            }
        }


        private double _gsr;

        private bool _isGsrLockEnabled;

        private int _time = 0;

        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public int CurrentIndex
        {
            get { return _currentIndex; }
            set
            {
                _currentIndex = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// Текущий базовый ЭСК
        /// </summary>
        public double GSR
        {
            get { return _gsr; }
            set
            {
                _gsr = value;
                OnPropertyChanged();
            }
        }

        public bool IsGsrLockEnabled
        {
            get { return _isGsrLockEnabled; }
            set
            {
                _isGsrLockEnabled = value;
                OnPropertyChanged();
            }
        }

        public int Time
        {
            get { return _time; }
            set
            {
                _time = value;
                OnPropertyChanged();
            }
        }

        private const int _intervalGetGSR = 10;
        private const int _timeGsrDisabling = 6960;
        private const int _timeGsrFirstEnabling = 4080;
        //интервал получения ЭСК
        private const double valueOverGSRPercents = 30;

        private double? _backgroundValueGSR = null;
        private Indicator _centerCircle = null;

        private TypeSignals _currentSignal = TypeSignals.NoActive;

        public TypeSignals CurrentSignal
        {
            get { return _currentSignal; }
            set
            {
                _currentSignal = value;
                OnPropertyChanged();
            }
        }

        private List<double> _currentValuesGsr = new List<double>();

        private int _indexRow = 0;
        private List<Indicator> _indicators = new List<Indicator>();
        private SceneGenerator scene = new SceneGenerator();

        private SoundPlayer _player = new SoundPlayer();

        private DispatcherTimer _gsrValueTimer = new DispatcherTimer();
        private DispatcherTimer _soundTimer = new DispatcherTimer();
        private DispatcherTimer _timeOutTimer = new DispatcherTimer();
        private NeuroTimer _timer = new NeuroTimer();

        private int countSecondsToCheckGSR = 0;

        private IQuestContext resultContext = null;
        public IQuestContext ResultsContext
        {
            get { return resultContext; }
            set
            {
                resultContext = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private bool _is30PercentActive = false;
        private int countPassesInARowInGed1 = 0;

        public ReadinessForEmergencyAction_2MControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            Initialize();
            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("Tick_1sec", () => Tick_1sec());
                TestMethods.Add("Jump", () => Tick_1sec(true));
                TestMethods.Add("Attention", () => AttentionSignal_1sec(true));
                TestMethods.Add("AttentionHide", () => AttentionSignal_1sec());
            }
        }
        private int indicatorIndex = 0;
        private void Tick_1sec(bool jump = false)
        {
            _indicators[indicatorIndex].IsEnabledIndicator = false;
            if (indicatorIndex == 59)
            {
                if (jump)
                    indicatorIndex = 1;
                else
                    indicatorIndex = 0;
            }
            else
            {
                if (jump)
                    indicatorIndex = indicatorIndex + 2;
                else
                    indicatorIndex++;

            }
            _indicators[indicatorIndex].IsEnabledIndicator = true;
        }
        private void AttentionSignal_1sec(bool isEnabled = false)
        {
            if (isEnabled)
            {
                _centerCircle.IndicationColor = GetColor(ColorsCircle.Yellow);
                _centerCircle.IsEnabledIndicator = true;
            }
            else
                _centerCircle.IsEnabledIndicator = false;
        }

        public void Start(bool isTestStart = false)
        {
            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick += _timer_Tick;
            _soundTimer.Tick += _soundTimer_Tick;
            _soundTimer.Interval = TimeSpan.FromSeconds(1.7);
            _timeOutTimer.Tick += _timeOutTimer_Tick;
            _gsrValueTimer.Tick += _gsrValueTimer_Tick;
            _gsrValueTimer.Interval = TimeSpan.FromSeconds(_intervalGetGSR);

            ResultsContext = new QuestContext();
            ResultsContext.ChangeQuest(Stage.One);

            PrepareTable(isTestStart);

            //#if DEBUG
            //            Time = 3597;
            //#endif
            if (Mode != TestMode.Manual)
                _soundTimer.Start();
            if (Mode != TestMode.Manual)
                _timer.Start();
            _indicators[CurrentIndex].IsEnabledIndicator = true;
        }

        private void Initialize()
        {
            GenerateScene();
        }

        private void _soundTimer_Tick(object sender, EventArgs e)
        {
            PlaySound();
            //PlaySoundSync();
        }

        public void Dispose()
        {
            _player.Dispose();
            _timer.Stop();
            _timer.Dispose();
            if (_ms != null)
                _ms.Dispose();
        }

        public void GSRValue(double value)
        {
            _currentValuesGsr.Add(value);
        }

        public void PressButtton(int time)
        {
            if (_currentSignal != TypeSignals.NoActive && _currentSignal != TypeSignals.AttentionSignal)
            {
                _timer.Tick -= _timer_Tick;
                if (_currentSignal == TypeSignals.Alarm)
                {
                    var curTime = TimeSpan.FromSeconds(time / 10000.0).TotalMilliseconds;
                    if (ResultsContext.CurrentQuest.Quest == Stage.One)
                    {
                        countPassesInARowInGed1 = 0;
                        if (currentRowSignal != null)
                            ResultsContext.CurrentQuest.SetResult(new RowResult(curTime, currentRowSignal.Time, _currentSignal, 0));
                    }
                    else if (ResultsContext.CurrentQuest.Quest == Stage.Two)
                    {
                        if (currentRowSignal != null)
                            ResultsContext.CurrentQuest.SetResult(new RowResult(curTime, currentRowSignal.Time, _currentSignal, _currentValuesGsr.Count > 0 ? _currentValuesGsr.Average() : 0.0));
                        if (ResultsContext.CurrentQuest is GED2_Quest ged2)
                            ged2.CountPassesInRow = 0;
                        if (_is30PercentActive)
                            _is30PercentActive = false;
                        GsrControlling(GSRState.On);
                    }
                    CurrentSignal = TypeSignals.NoActive;
                    _timeOutTimer.Stop();
                }
                else if (_currentSignal == TypeSignals.SignalWithWarning)
                {
                    if (ResultsContext.CurrentQuest.Quest == Stage.One)
                    {
                        countPassesInARowInGed1 = 0;
                    }
                    var curTime = TimeSpan.FromSeconds(time / 10000.0).TotalMilliseconds;
                    if (currentRowSignal != null)
                        ResultsContext.CurrentQuest.SetResult(new RowResult(curTime, currentRowSignal.Time, _currentSignal, 0));
                    CurrentSignal = TypeSignals.NoActive;
                    _timeOutTimer.Stop();

                    if (ResultsContext.CurrentQuest is GED2_Quest ged2)
                        ged2.CountPassesInRow = 0;
                }
                if (Mode != TestMode.Manual)
                    _timer.Tick += _timer_Tick;
            }
            else if (_currentSignal == TypeSignals.NoActive)
            {
                ResultsContext.CurrentQuest.SetResult(new RowResult(0, _time, _currentSignal, 0));
                ResultsContext.CurrentQuest.CountLeftPresses++;
            }
        }

        public void Stop()
        {
            _player.Stop();
            Dispose();
            _timeOutTimer.Stop();
            _gsrValueTimer.Stop();

            _soundTimer.Stop();
            _timer.Stop();
            _soundTimer.Tick -= _soundTimer_Tick;

            _gsrValueTimer.Tick -= _gsrValueTimer_Tick;
            _timeOutTimer.Tick -= _timeOutTimer_Tick;
            _timer.Tick -= _timer_Tick;
        }

        private void _gsrValueTimer_Tick(object sender, EventArgs e)
        {
            if (_backgroundValueGSR == null)
            {
                _backgroundValueGSR = _currentValuesGsr.Count > 0 ? _currentValuesGsr.Average() : 0.0;
                GSR = _backgroundValueGSR.Value;
            }
            else
                CheckGsr();
        }

        private void _timeOutTimer_Tick(object sender, EventArgs e)
        {
            var ged2 = ResultsContext.CurrentQuest as GED2_Quest;

            switch (_currentSignal)
            {
                case TypeSignals.Alarm:
                    if (ResultsContext.CurrentQuest.Quest == Stage.One)
                    {
                        countPassesInARowInGed1++;
                        ResultsContext.CurrentQuest.SignalAlarmPasses++;
                        if (currentRowSignal != null)
                            ResultsContext.CurrentQuest.SetResult(new RowResult(-1, currentRowSignal.Time, TypeSignals.Alarm, 0));
                    }
                    else if (ResultsContext.CurrentQuest.Quest == Stage.Two)
                    {
                        if (ged2 != null)
                            ged2.CountPassesInRow++;

                        if (currentRowSignal != null)
                            ResultsContext.CurrentQuest.SetResult(new RowResult(-1, currentRowSignal.Time, TypeSignals.Alarm, GSR));

                        if (_is30PercentActive)
                        {
                            (ResultsContext.CurrentQuest as GED2_Quest).CountPassesAdditionalSignals++;
                            if (ged2.CountPassesInRow < 4)//если не реагировали на сигнал превышения запустить еще один через 30 секунд
                            {
                                (ResultsContext.CurrentQuest as GED2_Quest).CountAddAdditionalSignals++;
                                var NearRowSignalByTime = Signals.Variant.Signals.Where(s => s.Time < Time).OrderBy(o => o.Time).Last();//ближний максимальный со стороны меньше
                                var index = Signals.Variant.Signals.IndexOf(NearRowSignalByTime);
                                Signals.Variant.InsertSignal(new Signal(TypeSignals.Alarm, TimeSpan.FromSeconds(NearRowSignalByTime.Time + 30)), index);
                            }
                        }
                        else
                            (ResultsContext.CurrentQuest as GED2_Quest).SignalAlarmPasses++;
                    }
                    break;
                case TypeSignals.SignalWithWarning:
                    ResultsContext.CurrentQuest.SignalWithWarningPasses++;
                    if (ResultsContext.CurrentQuest.Quest == Stage.One)
                    {
                        countPassesInARowInGed1++;
                    }
                    if (ged2 != null)
                    {
                        ged2.CountPassesInRow++;
                        if (currentRowSignal != null)
                            ResultsContext.CurrentQuest.SetResult(new RowResult(-1, currentRowSignal.Time, TypeSignals.SignalWithWarning, GSR));
                        Stop();
                        ReturtResult(_passesSignalWithWarning: true);
                    }
                    else
                    {
                        if (currentRowSignal != null)
                            ResultsContext.CurrentQuest.SetResult(new RowResult(-1, currentRowSignal.Time, TypeSignals.SignalWithWarning, 0));
                    }
                    break;
                case TypeSignals.AttentionSignal:
                    _centerCircle.IsEnabledIndicator = false;
                    break;
            }

            if (ResultsContext.CurrentQuest.Quest == Stage.Two)
                if (Mode != TestMode.Manual)
                    GsrOnOff?.Invoke(this, true);

            CurrentSignal = TypeSignals.NoActive;
            _timeOutTimer.Stop();

            if (ResultsContext.CurrentQuest is GED1_Quest ged1 && countPassesInARowInGed1 == 4)
            {
                Stop();
                ReturtResult(_isFourPasses: true);
            }

            if (ged2 != null && ged2.CountPassesInRow > 3)
            {
                Stop();
                ReturtResult(_isFourPasses: true);
            }
        }
        private Signal currentRowSignal = null;
        private void _timer_Tick(object sender, EventArgs e)
        {
            var rowSignal = Signals.Variant.Signals.FirstOrDefault(f => f.Time == Time);

            if (rowSignal != null)
            {
                var signal = rowSignal.Type;
                currentRowSignal = rowSignal;
                switch (signal)
                {
                    case TypeSignals.Alarm:
                        Jump();
                        CurrentSignal = TypeSignals.Alarm;
                        _timeOutTimer.Interval = TimeSpan.FromSeconds(4);
                        if (Mode != TestMode.Manual)
                            _timeOutTimer.Start();
                        if (ResultsContext.CurrentQuest.Quest == Stage.Two)
                            if (Mode != TestMode.Manual)
                                GsrOnOff?.Invoke(this, false);
                        if (Mode != TestMode.Manual)
                            ResetTimer?.Invoke(this, new EventArgs());
                        break;
                    case TypeSignals.SignalWithWarning:
                        Jump();
                        CurrentSignal = TypeSignals.SignalWithWarning;
                        _timeOutTimer.Interval = TimeSpan.FromSeconds(4);
                        if (Mode != TestMode.Manual)
                            _timeOutTimer.Start();
                        if (ResultsContext.CurrentQuest.Quest == Stage.Two)
                            if (Mode != TestMode.Manual)
                                GsrOnOff?.Invoke(this, false);
                        if (Mode != TestMode.Manual)
                            ResetTimer?.Invoke(this, new EventArgs());
                        break;
                    case TypeSignals.AttentionSignal:
                        YellowSignalActive();
                        CurrentSignal = TypeSignals.AttentionSignal;
                        _indicators[CurrentIndex].IsEnabledIndicator = false;
                        CurrentIndex++;
                        if (CurrentIndex == _indicators.Count)
                            CurrentIndex = 0;
                        _indicators[CurrentIndex].IsEnabledIndicator = true;
                        _timeOutTimer.Interval = TimeSpan.FromSeconds(2);
                        ResultsContext.CurrentQuest.SetResult(new RowResult(float.NaN, _time, _currentSignal, float.NaN));
                        if (Mode != TestMode.Manual)
                            _timeOutTimer.Start();
                        break;
                }
                _indexRow++;
            }
            else
            {
                _indicators[CurrentIndex].IsEnabledIndicator = false;
                CurrentIndex++;
                if (CurrentIndex == _indicators.Count)
                    CurrentIndex = 0;
                _indicators[CurrentIndex].IsEnabledIndicator = true;
            }

            // Запуск второго часа
            if (Time >= 3600 && ResultsContext.CurrentQuest.Quest != Stage.Two)
            {
                ResultsContext.ChangeQuest(Stage.Two);

                //Проверка результатов первого часа
                _isNormalResultOneHour = CheckForNormalResults();
            }

            // 3860 - время проверки результатов первого часа 
            if (Time == 3860)
            {
                if (!_isNormalResultOneHour)
                {
                    _timer.Stop();
                    ReturtResult(_isNotNormalResults: true);
                }
            }

            if (ResultsContext.CurrentQuest.Quest == Stage.Two)
            {
                if (Time == 4080 && gSR_ON_OFF != GSRState.On)
                    GsrControlling(GSRState.On);

                if (Time >= 6960 && gSR_ON_OFF != GSRState.Off)
                {
                    GsrControlling(GSRState.Off);
                    _is30PercentActive = false;
                }

                if (Time >= 7200 && Time != 0)
                {
                    _timer.Stop();
                    ReturtResult();
                }
            }
            Time++;
        }

        private bool _isNormalResultOneHour;
        private bool CheckForNormalResults()
        {
            var questOne = ResultsContext.Quests[0].Quest == Stage.One ? ResultsContext.Quests[0] : null;
            var alarmAverage = questOne.ReactionsAlarm.Count > 0 ? questOne.ReactionsAlarm.Average(a => TimeSpan.FromMilliseconds(a).TotalSeconds) : 0.0;
            var withWarningAverage = questOne.ReactionsSignalWithWarning.Count > 0 ? questOne.ReactionsSignalWithWarning.Average(a => TimeSpan.FromMilliseconds(a).TotalSeconds) : 0.0;

            var countWithWarnMore1Sec = questOne.ReactionsSignalWithWarning.Count > 0 ? questOne.ReactionsSignalWithWarning.Where(w => w >= 1000.0).Count() : 0.0;

            var vigilance = TimeSpan.FromSeconds(alarmAverage - withWarningAverage);

            if (questOne.SignalAlarmPasses >= 4 ||
                Math.Round(vigilance.TotalSeconds, 2) > 0.250 ||
                countWithWarnMore1Sec > 3 ||
                questOne.SignalWithWarningPasses > 0)
                return false;
            return true;
        }

        private void CheckGsr()
        {
            var percent30 = _backgroundValueGSR * 0.3;
            var currentAverageGSR = _currentValuesGsr.Count > 0 ? _currentValuesGsr.Average() : _backgroundValueGSR;
            if ((currentAverageGSR - _backgroundValueGSR) > percent30)
            {
                var moreThanTimeMin = Signals.Variant.Signals.Where(s => s.Time > Time).OrderBy(o => o.Time).First();
                var time = moreThanTimeMin.Time - Time;
                if (time >= 180)
                {
                    var ged2Quest = ResultsContext.CurrentQuest as GED2_Quest;
                    _backgroundValueGSR = currentAverageGSR;
                    ged2Quest.CountUp30Percent++;
                    Signals.Variant.InsertSignal(new Signal(TypeSignals.Alarm, TimeSpan.FromSeconds(Time + 30)), Signals.Variant.Signals.IndexOf(moreThanTimeMin));
                    ged2Quest.CountAddAdditionalSignals++;
                    GsrControlling(GSRState.Off);
                    _is30PercentActive = true;
                    if (_backgroundValueGSR != null)
                        GSR = _backgroundValueGSR.Value;
                }
            }
        }

        private void GsrControlling(GSRState state)
        {
            switch (state)
            {
                case GSRState.Off:
                    if (Mode != TestMode.Manual)
                        GsrOnOff?.Invoke(this, false);
                    _gsrValueTimer.Stop();
                    break;
                case GSRState.On:
                    if (Mode != TestMode.Manual)
                        GsrOnOff?.Invoke(this, true);
                    if (Mode != TestMode.Manual)
                        _gsrValueTimer.Start();
                    _currentValuesGsr.Clear();
                    break;
            }
            GSR_ON_OFF = state;
        }

        private void Jump()
        {
            _indicators[CurrentIndex].IsEnabledIndicator = false;
            CurrentIndex = CurrentIndex + 2;
            if (CurrentIndex == _indicators.Count)
                CurrentIndex = 0;
            else if (CurrentIndex > _indicators.Count)
                CurrentIndex = 1;
            _indicators[CurrentIndex].IsEnabledIndicator = true;
        }

        private void PlaySound()
        {
            _player.Play();
        }

        private void YellowSignalActive()
        {
            _centerCircle.IndicationColor = GetColor(ColorsCircle.Yellow, true);
            _centerCircle.IsEnabledIndicator = true;
        }

        private void PrepareTable(bool isTestStart)
        {
            GED_2_Signals signals;
            if (!isTestStart)
                signals = new GED_2_Signals(StartType.Normal);
            else
                signals = new GED_2_Signals(StartType.TestStart);
            Signals = signals;
        }

        private void ReturtResult(bool _passesSignalWithWarning = false, bool _isNotNormalResults = false, bool _isFourPasses = false)
        {
            if (Mode != TestMode.Manual)
            {
                if (_isNotNormalResults || _isFourPasses || _passesSignalWithWarning)
                {
                    var res = ResultsContext.ReturnResults();
                    if (_isNotNormalResults)
                    {
                        Results?.Invoke(this, new ResultsEventArgs(res, false)
                        {
                            Message = "Тест ГЭД-2 остановлен по результатам первого часа!"
                        });
                    }
                    else if (_passesSignalWithWarning)
                    {
                        Results?.Invoke(this, new ResultsEventArgs(res, false)
                        {
                            Message = "Тест ГЭД-2 остановлен!\r\n Пропущен сигнал с предупреждением!"
                        });
                    }
                    else if (_isFourPasses)
                    {
                        Results?.Invoke(this, new ResultsEventArgs(res, false)
                        {
                            Message = "Тест ГЭД-2 остановлен!\r\n Пропущено 4 сигнала подряд!"
                        });
                    }
                }
                else
                    Results?.Invoke(this, new ResultsEventArgs(ResultsContext.ReturnResults(), true));
            }
        }

        private MemoryStream _ms;
        private void GenerateScene()
        {
            var byteArray =
               SoundResources.GetSoundArray("pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/metronom.wav");
            _ms = new MemoryStream(byteArray);
            _player.Stream = _ms;

            Canva = scene.GetScene();
            _indicators = scene.GetIndicators();
            _centerCircle = scene.GetCenterIndicator();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2M\ReadinessForEmergencyAction_2MViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Pult;
using Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2;

namespace Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2M
{
    public class ReadinessForEmergencyAction_2MViewModel : TestBase
    {
        public override event EventHandler<Results> Results;

        private string message;
        public string Message
        {
            get { return message; }
            set
            {
                message = value;
                OnPropertyChanged();
            }
        }

        private DispatcherTimer _messageTimer = new DispatcherTimer();

        private PultButtons Buttons;
        private PultGsr GSR;
        public ReadinessForEmergencyAction_2MControl control;
        public ReadinessForEmergencyAction_2MViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("readinessForEmergencyAction_2");
            Manager.TraningTime = Common.GetSeconds(75);
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override FrameworkElement GetTestControl()
        {
            return new ReadinessForEmergencyAction_2MControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new ReadinessForEmergencyAction_2MControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }
        public override void TestStart()
        {
            control = new ReadinessForEmergencyAction_2MControl();
            Buttons = Pult as PultButtons;
            GSR = AdditionalPult as PultGsr;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Disconnected;
            GSR.Disconnected += Disconnected;
            control.ResetTimer += Control_ResetTimer;
            GSR.GsrValueChanged += GSR_GsrValueChanged;
            _messageTimer.Interval = TimeSpan.FromSeconds(5);
            _messageTimer.Tick += _messageTimer_Tick;
            control.GsrOnOff += Control_GsrOnOff;
            Buttons.Start();
            control.Start(true);
            TestCurrentView = control;
        }
        public override void Start()
        {
            control = new ReadinessForEmergencyAction_2MControl();
            Buttons = Pult as PultButtons;
            GSR = AdditionalPult as PultGsr;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Disconnected;
            GSR.Disconnected += Disconnected;
            control.Results += TestCurrentView_Results;
            control.ResetTimer += Control_ResetTimer;
            GSR.GsrValueChanged += GSR_GsrValueChanged;
            _messageTimer.Interval = TimeSpan.FromSeconds(5);
            _messageTimer.Tick += _messageTimer_Tick;
            control.GsrOnOff += Control_GsrOnOff;
            Buttons.Start();
            control.Start(false);
            TestCurrentView = control;
        }


        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) {Exception=e.Exception });
        }

        private Dictionary<string, object> _results;
        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            _messageTimer.Stop();
            Message = "";
            Results?.Invoke(this, new Results(_results));
            Stop();
        }

        private void Control_SetMessage(object sender, string e)
        {
            Message = e;
        }

        private void Control_GsrOnOff(object sender, bool e)
        {
            if (e)
                GSR.Start();
            else
                GSR.Stop();
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void GSR_GsrValueChanged(object sender, Pult.GsrValueCgangedEventArgs e)
        {
            control.GSRValue(e.NewValue);
        }

        private void TestCurrentView_Results(object sender, ResultsEventArgs e)
        {
            if (e.IsDone)//IsDone==true значит все хорошо, тест закончился
            {
                Results?.Invoke(this, new Results(e.Results));
                Stop();
            }
            else//тест завершился по причине какой то из ошибок испытуемого, запускаем таймер и показываем сообщение испытуемому
            {
                _results = e.Results;
                Message = e.Message;
                _messageTimer.Start();
            }
        }

        private void Buttons_ButtonPressed(object sender, Pult.ButtonPressedEventArgs e)
        {
            if (e.Button == Tests.Pult.PultButton.Green)
                control.PressButtton(e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (GSR != null)
            {
                GSR.Disconnected -= Disconnected;
                GSR.GsrValueChanged -= GSR_GsrValueChanged;
                GSR.Stop();
            }
            if (Buttons != null)
            {
                Buttons.Disconnected -= Disconnected;
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Stop();
            }
            if (control != null)
            {
                _messageTimer.Tick -= _messageTimer_Tick;
                _messageTimer.Stop();
                control.GsrOnOff -= Control_GsrOnOff;
                control.ResetTimer -= Control_ResetTimer;
                control.Results -= TestCurrentView_Results;
                control.Stop();
                control?.Dispose();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\ReadinessForEmergencyAction_2M\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.ReadinessForEmergencyAction_2M"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels"
                    xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Converters">
    <Style TargetType="local:ReadinessForEmergencyAction_2MControl">
        <Setter Property="Background" Value="#FF727171"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReadinessForEmergencyAction_2MControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox Height="1000" Width="1000">
                                        <ContentControl Focusable="False" Margin="5" Content="{Binding Canva, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ReadinessForEmergencyAction_2MControl}}}"/>
                                    </Viewbox>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:ReadinessForEmergencyAction_2MControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ReadinessForEmergencyAction_2MViewModel">
        <Style.Resources>
            <converters:StringOrEmptyConverter x:Key="StringOrEmptyConverter"/>
        </Style.Resources>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReadinessForEmergencyAction_2MViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <tests:MessageBoxControl x:Name="mBox" Message="{Binding Message,
                                                               RelativeSource={RelativeSource FindAncestor,
                                                               AncestorType={x:Type local:ReadinessForEmergencyAction_2MViewModel}}}"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:ReadinessForEmergencyAction_2MViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Message,
                                                   RelativeSource={RelativeSource Self},
                                                   Converter={StaticResource StringOrEmptyConverter}}" Value="true">
                            <Setter TargetName="mBox" Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SimpleMotorableReaction\SimpleMotorableReactionControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.SimpleMotorableReaction
{
    public class SimpleMotorableReactionControl : NotifyViewModelBase, ILearning
	{
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler<bool> ResetTimer;
        
        public Brush EllipseColor
        {
            get { return (Brush)GetValue(EllipseColorProperty); }
            set { SetValue(EllipseColorProperty, value); }
        }

        public static readonly DependencyProperty EllipseColorProperty =
          DependencyProperty.Register("EllipseColor", typeof(Brush), typeof(SimpleMotorableReactionControl), new PropertyMetadata(Brushes.Gray));

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private DispatcherTimer _timer = new DispatcherTimer();
        private Signals _currentSignal = Signals.NoneForYellow;
        private int countPresentRedSignals = 30;
        private int currentCountPresentSignals = 0;
        private List<TimeSpan> reactions = new List<TimeSpan>();
        public SimpleMotorableReactionControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("ShowAttention", () => ShowAttention());
                TestMethods.Add("ShowSignal", () => ShowSignal());
                TestMethods.Add("HideSignal", () => HideSignal());
            }
        }

        private void ShowAttention()
        {
            EllipseColor = Common.Drawing.GetColor(Common.ColorsCircle.Yellow);
        }

        private void ShowSignal()
        {
            EllipseColor = Common.Drawing.GetColor(Common.ColorsCircle.Red);
        }

        private void HideSignal()
        {
            EllipseColor = Brushes.Gray;
        }

        public void Start()
        {
            _timer.Interval = TimeSpan.FromSeconds(2);
            _timer.Tick += _timer_Tick;
            if (Mode != TestMode.Manual)
                _timer.Start();
        }
       
        private void _timer_Tick(object sender, EventArgs e)
        {
            switch (_currentSignal)
            {
                case Signals.Yellow:
                    EllipseColor = Brushes.Gray;
                    _timer.Interval = TimeSpan.FromSeconds(Common.GetRandomNumber(1.5, 4));
                    _currentSignal = Signals.NoneForRed;
                    break;
                case Signals.NoneForRed:
                    EllipseColor = Common.Drawing.GetColor(Common.ColorsCircle.Red);
                    _timer.Interval = TimeSpan.FromSeconds(2);
                    _currentSignal = Signals.Red;
                    if (Mode != TestMode.Manual)
                        ResetTimer?.Invoke(this, true);
                    currentCountPresentSignals++;
                    break;
                case Signals.Red:
                    countPassesRedSignals++;
                    EllipseColor = Brushes.Gray;
                    _timer.Interval = TimeSpan.FromSeconds(2);
                    _currentSignal = Signals.NoneForYellow;
                    if (currentCountPresentSignals == countPresentRedSignals)
                    {
                        ReturnResults();
                        _timer.Stop();
                    }
                    break;
                case Signals.NoneForYellow:
                    EllipseColor = Common.Drawing.GetColor(Common.ColorsCircle.Yellow);
                    _timer.Interval = TimeSpan.FromSeconds(2);
                    _currentSignal = Signals.Yellow;
                    break;
            }
        }

        private void ReturnResults()
        {
            var middleSummReactions = reactions.Count > 0 ? reactions.Sum(su => su.TotalSeconds) / (reactions.Count) : 0.0;
            var rms = reactions.Count > 0 ? Math.Sqrt(reactions.Sum(s => Math.Pow(s.TotalSeconds - middleSummReactions, 2)) / (reactions.Count)) : 0.0;
            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Cреднеарифметическое время реагирования"] = (float)middleSummReactions,
                ["Cреднеквадратическое отклонение времени реагирования"] = (float)rms,
                ["Количество пропусков"] = countPassesRedSignals,
                ["Количество нажатий на жёлтый сигнал"] = countPressedYellowSignal,
                ["Все значения времён реагирования на сигналы"] = reactions.Select(s => (float)s.TotalSeconds).ToArray()
            });
        }

        private int countPassesRedSignals = 0;
        private int countPressedYellowSignal = 0;
        public void PressButton(int timePult)
        {
            switch (_currentSignal)
            {
                case Signals.Yellow:
                    countPressedYellowSignal++;
                    break;
                case Signals.Red:
                    reactions.Add(TimeSpan.FromSeconds(timePult / 10000.0));
                    EllipseColor = Brushes.Gray;
                    _timer.Interval = TimeSpan.FromSeconds(2);
                    _currentSignal = Signals.NoneForYellow;
                    if (currentCountPresentSignals == countPresentRedSignals)
                    {
                        ReturnResults();
                        _timer.Stop();
                    }
                    break;
            }
        }

        public void Stop()
        {
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
        }
	}

    public enum Signals
    {
        Yellow,
        Red,
        NoneForRed,
        NoneForYellow
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SimpleMotorableReaction\SimpleMotorableReactionViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.SimpleMotorableReaction
{
    public class SimpleMotorableReactionViewModel : TestBase
    {
        public override event EventHandler<Results> Results;
        
        private SimpleMotorableReactionControl control;
        private PultButtons Buttons;
        public SimpleMotorableReactionViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            Manager.TraningTime = Common.GetSeconds(30);
            SetInstructions("simpleMotorableReaction");
        }

        public override FrameworkElement GetTestControl()
        {
            return new SimpleMotorableReactionControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new SimpleMotorableReactionControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            control = new SimpleMotorableReactionControl();
            Buttons = Pult as Pult.PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start();
            TestCurrentView = control;
        }

        public override void Start()
        {
            control = new SimpleMotorableReactionControl();
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            control.Results += Control_Results;
            Buttons.Start();
            control.Start();
            TestCurrentView = control;
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception=e.Exception});
        }

        private void Control_ResetTimer(object sender, bool e)
        {
            Buttons.Start();
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Red)
                control.PressButton(e.Time);
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.ResetTimer -= Control_ResetTimer;
                control.Results -= Control_Results;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SimpleMotorableReaction\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.SimpleMotorableReaction"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:SimpleMotorableReactionControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SimpleMotorableReactionControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox Height="100"
                                             Width="100">
                                         <Ellipse
                                                 Height="1.5cm"
                                                 Width="1.5cm" 
                                                 Stroke="White"
                                                 HorizontalAlignment="Center"
                                                 VerticalAlignment="Center"
                                                 Fill="{TemplateBinding EllipseColor}"/>
                                    </Viewbox>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:SimpleMotorableReactionControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:SimpleMotorableReactionViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SimpleMotorableReactionViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:SimpleMotorableReactionViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SpeedAlterationSkills\ColorConverter.cs


using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Psychophysical.SpeedAlterationSkills
{
    public class ColorConverter : MarkupExtension, IValueConverter
    {
        private ColorConverter _converter;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var color = (Common.ColorsCircle)value;
            return Common.Drawing.GetColor(color);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new ColorConverter();
            return _converter;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SpeedAlterationSkills\SpeedAlterationSkillsControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.SpeedAlterationSkills
{
    public class SpeedAlterationSkillsControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler ResetTimer;

        public event EventHandler<Dictionary<string, object>> Results;

        public static readonly DependencyProperty IsVisibleRectsProperty =
            DependencyProperty.Register("IsVisibleRects", typeof(bool), typeof(SpeedAlterationSkillsControl), new PropertyMetadata(false, IsVisibleRectsChanged));

        
        public bool IsVisibleRects
        {
            get { return (bool)GetValue(IsVisibleRectsProperty); }
            set { SetValue(IsVisibleRectsProperty, value); }
        }

        public Common.ColorsCircle LeftSquareColor
        {
            get { return _leftSquareColor; }
            set
            {
                _leftSquareColor = value;
                OnPropertyChanged();
            }
        }

        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (_isShowedMessages)
                {
                    if (_message != "")
                    {
                        _isButtonsEnabled = false;
                        _timer.Stop();
                        if (Mode != TestMode.Manual)
                            _messageTimer.Start();
                    }
                    OnPropertyChanged();
                }
            }
        }

        public Common.ColorsCircle RightSquareColor
        {
            get { return _rightSquareColor; }
            set
            {
                _rightSquareColor = value;
                OnPropertyChanged();
            }
        }

        public List<Signal> Signals
        {
            get { return _signals; }
            set
            {
                _signals = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private readonly int countCycles = 7;
        private Buttons _currentButton = Buttons.Green;
        private bool _isButtonsEnabled = true;
        private bool _isPresentedSquares = false;
        private bool _isShowedMessages = false;
        private Common.ColorsCircle _leftSquareColor;
        private string _message;
        private DispatcherTimer _messageTimer = new DispatcherTimer();
        private Common.ColorsCircle _rightSquareColor;
        private List<Signal> _signals = new List<Signal>();
        private DispatcherTimer _timer = new DispatcherTimer();
        private int countErrors = 0;
        private int countWrongPressed = 0;
        private int currentCountCycles = 0;
        int indexCurrentSignal = 0;
        private List<DataRow> reactions = new List<DataRow>();

        public SpeedAlterationSkillsControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
            {
                GreenRects();
                TestMethods.Add("GreenRects", () => GreenRects());
                TestMethods.Add("GreenRedRects", () => GreenRedRects());
                TestMethods.Add("HideRects", () => HideRects());
            }
        }
        private void GreenRects()
        {
            LeftSquareColor = Common.ColorsCircle.Green;
            RightSquareColor = Common.ColorsCircle.Green;
            IsVisibleRects = true;
        }

        private void GreenRedRects()
        {
            LeftSquareColor = Common.ColorsCircle.Green;
            RightSquareColor = Common.ColorsCircle.Red;
            IsVisibleRects = true;
        }

        private void HideRects()
        {
            IsVisibleRects = false;
        }

        public void Start(bool isTestQuest = false)
        {
            _isShowedMessages = isTestQuest;
            if (_isShowedMessages)
            {
                _messageTimer.Tick += _messageTimer_Tick;
                _messageTimer.Interval = TimeSpan.FromSeconds(1.5);
            }
            IsVisibleRects = false;
            GenerateSignals();
            _timer.Interval = TimeSpan.FromSeconds(2);
            _timer.Tick += _timer_Tick;
            if (Mode != TestMode.Manual)
                _timer.Start();
        }

        public void PressedButton(Buttons button, int time)
        {
            if (_isButtonsEnabled)
            {
                if (_currentButton == button && LeftSquareColor == RightSquareColor)
                {
                    var curTime = TimeSpan.FromSeconds(time / 10000.0);
                    reactions.Add(new DataRow(curTime, currentCountCycles + 1));
                }
                else
                {
                    if (_currentButton != button && !(LeftSquareColor != RightSquareColor))
                    {
                        countWrongPressed++;
                        if (Mode != TestMode.Manual)
                            Message = "Вы нажали неправильную кнопку!";
                    }
                    else if (LeftSquareColor != RightSquareColor)
                    {
                        countErrors++;
                        if (Mode != TestMode.Manual)
                            Message = "Вы среагировали на сигнал смены кнопок!";
                    }
                }
                if (_isButtonsEnabled && _isPresentedSquares)
                    GoNextIteration();
            }
        }

        public void Stop()
        {
            _messageTimer.Stop();
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
        }

        private static void IsVisibleRectsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var control = d as SpeedAlterationSkillsControl;
            if (control != null)
                if ((bool)e.NewValue)
                    control._isPresentedSquares = true;
                else
                    control._isPresentedSquares = false;
        }
        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _messageTimer.Stop();
            if (Mode != TestMode.Manual)
                _timer.Start();
            _isButtonsEnabled = true;
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            GoNextIteration();
        }

        private void ChangeButton()
        {
            _currentButton = _currentButton == Buttons.Green ? Buttons.Red : Buttons.Green;
        }

        private void GenerateSignals()
        {
            int count = 0;//Общее количество
            for (int i = 0; i < countCycles - 1; i++)
            {
                var countInCycle = Common._rnd.Next(10, 13);

                for (int j = 0; j < countInCycle; j++)
                    Signals.Add(Signal.Green_Green);

                if (Common._rnd.Next(0, 2) == 0)
                    Signals.Add(Signal.Green_Red);
                else
                    Signals.Add(Signal.Red_Green);
                count = count + countInCycle;
            }

            for (int i = 0; i < 78 - count; i++)
                Signals.Add(Signal.Green_Green);

            if (Common._rnd.Next(0, 2) == 0)
                Signals.Add(Signal.Green_Red);
            else
                Signals.Add(Signal.Red_Green);

            OnPropertyChanged("Signals");
        }
        private void GoNextIteration()
        {
            if (indexCurrentSignal < Signals.Count)
            {
                if (!IsVisibleRects)
                {
                    switch (Signals[indexCurrentSignal])
                    {
                        case Signal.Green_Green:
                            LeftSquareColor = Common.ColorsCircle.Green;
                            RightSquareColor =Common.ColorsCircle.Green;
                            break;
                        case Signal.Red_Green:
                            LeftSquareColor = Common.ColorsCircle.Red;
                            RightSquareColor = Common.ColorsCircle.Green;
                            ChangeButton();
                            currentCountCycles++;
                            break;
                        case Signal.Green_Red:
                            LeftSquareColor = Common.ColorsCircle.Green;
                            RightSquareColor = Common.ColorsCircle.Red;
                            ChangeButton();
                            currentCountCycles++;
                            break;
                    }
                    if (Mode != TestMode.Manual)
                        ResetTimer?.Invoke(this, new EventArgs());
                    IsVisibleRects = true;
                }
                else if (IsVisibleRects)
                {
                    IsVisibleRects = false;
                    indexCurrentSignal++;
                }
            }
            else
            {
                ReturnResult();
                _timer.Stop();
            }
        }

        private void ReturnResult()
        {
            var middleSummReactions = reactions.Count > 0 ? reactions.Sum(su => su.Time.TotalSeconds) / (reactions.Count - 1) : 0.0;
            var rms = reactions.Count > 0 ? Math.Sqrt(reactions.Sum(s => Math.Pow(s.Time.TotalSeconds - middleSummReactions, 2)) / (reactions.Count - 1)) : 0.0;
            for (int i = 1; i < 8; i++)
            {
                if (!reactions.Any(a => a.NumberCycle == i))
                    reactions.Add(new DataRow(new TimeSpan(0, 0, 0), i));
            }
            var groupByCycle = reactions.Count > 0 ? reactions.GroupBy(g => g.NumberCycle) : null;
            List<double> averagesReaction = new List<double>();
            if (groupByCycle != null)
            {
                foreach (var valuesInCycle in groupByCycle)
                    averagesReaction.Add(valuesInCycle.Select(s => s.Time).Average(a => a.TotalSeconds));
            }

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Среднее время реагирования на зелёные сигналы"] = (float)middleSummReactions,
                ["Среднее квадратичное отклонение реагирования на зелёные сигналы"] = (float)rms,
                ["Количество неправильных нажатий (нажатие не на ту кнопку)"] = countWrongPressed,
                ["Количество ошибок (нажатие на красно – зелёный сигнал)"] = countErrors,
                ["Средние времена реагирования"] = averagesReaction.Count > 0 ? averagesReaction.Select(s => (float)s).ToArray() : new float[0]
            });
        }
    }

    public enum Buttons { Green, Red }

    public enum Signal
    {
        Green_Green,
        Red_Green,
        Green_Red
    }

    public class DataRow
    {
        public DataRow(TimeSpan time, int numberCycle)
        {
            Time = time;
            NumberCycle = numberCycle;
        }

        public int NumberCycle { get; private set; }
        public TimeSpan Time { get; private set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SpeedAlterationSkills\SpeedAlternationSkillsViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.SpeedAlterationSkills
{
    public class SpeedAlternationSkillsViewModel : TestBase
    {
        public override event EventHandler<Results> Results;

        private PultButtons Buttons;
        private SpeedAlterationSkillsControl control;
        public SpeedAlternationSkillsViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("speedAlternationSkills");
            Manager.TraningTime = Common.GetSeconds(45);
        }

        public override FrameworkElement GetTestControl()
        {
            return new SpeedAlterationSkillsControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new SpeedAlterationSkillsControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            control = new SpeedAlterationSkillsControl();
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;

            control.ResetTimer += Control_ResetTimer;
            control.Start(true);
            TestCurrentView = control;
        }

        public override void Start()
        {
            control = new SpeedAlterationSkillsControl();
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;

            control.Results += Control_Results;
            control.ResetTimer += Control_ResetTimer;
            control.Start(false);
            TestCurrentView = control;
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) {Exception=e.Exception });
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Green)
                control.PressedButton(SpeedAlterationSkills.Buttons.Green, e.Time);
            else if (e.Button == PultButton.Red)
                control.PressedButton(SpeedAlterationSkills.Buttons.Red, e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.ResetTimer -= Control_ResetTimer;
                control.Results -= Control_Results;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SpeedAlterationSkills\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.SpeedAlterationSkills"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:SpeedAlterationSkillsControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SpeedAlterationSkillsControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox Width="640" Height="270">
                                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition/>
                                            <ColumnDefinition Width="1.5cm"/>
                                            <ColumnDefinition/>
                                        </Grid.ColumnDefinitions>
                                        <Rectangle x:Name="leftSquare"
                                       Grid.Column="0"
                                       HorizontalAlignment="Right"
                                       Height="4cm" 
                                       Width="4cm" 
                                       Fill="{Binding LeftSquareColor,
                                              RelativeSource={RelativeSource FindAncestor,
                                              AncestorType=local:SpeedAlterationSkillsControl},
                                              Converter={local:ColorConverter}}"
                                       Stroke="Black"
                                       Opacity="0.0"/>
                                        <Rectangle x:Name="rightSquare" Grid.Column="2" 
                                       HorizontalAlignment="Left"
                                       Height="4cm"
                                       Width="4cm" 
                                       Fill="{Binding RightSquareColor,
                                              RelativeSource={RelativeSource FindAncestor,
                                              AncestorType=local:SpeedAlterationSkillsControl},
                                              Converter={local:ColorConverter}}"
                                       Stroke="Black"
                                       Opacity="0.0"/>
                                        <tests:MessageBoxControl Grid.ColumnSpan="3"
                                                     Message="{Binding Message,
                                                               RelativeSource={RelativeSource FindAncestor,
                                                               AncestorType={x:Type local:SpeedAlterationSkillsControl}}}"/>
                                    </Grid>
                                    </Viewbox>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:SpeedAlterationSkillsControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsVisibleRects" Value="true">
                            <Setter TargetName="leftSquare" Property="Opacity" Value="1.0"/>
                            <Setter TargetName="rightSquare" Property="Opacity" Value="1.0"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:SpeedAlternationSkillsViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SpeedAlternationSkillsViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:SpeedAlternationSkillsViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StaticTremor\StaticTremorControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Pult;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.StaticTremor
{
    public class StaticTremorControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler<bool> TestStart;
        public event EventHandler<bool> LedEnabled;
        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                OnPropertyChanged();
            }
        }

        private DateTime _startTime;
        private DispatcherTimer _timer = new DispatcherTimer();
        public bool StartMessageShow { get; set; }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private DispatcherTimer _errorTimer = new DispatcherTimer();
        public StaticTremorControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            _errorTimer.Interval = TimeSpan.FromSeconds(3);
            _errorTimer.Tick += _errorTimer_Tick;
        }

        public void Start()
        {
            _timer.Interval = TimeSpan.FromSeconds(32);
            _timer.Tick += _timer_Tick;
            _startTime = DateTime.Now;
            Message = "Опустите щуп в отверстие на пульте";
            StartMessageShow = true;
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            ReturnResult();
        }

        public void ReturnResult()
        {
            LedEnabled?.Invoke(this, false);
            _timer.Stop();
            ReturnResults();
        }

        private void ReturnResults()
        {
            //Удаляем первые две секунды данных
            var removeCountFirstValues = (Values.Count / 32) * 2;
            Values.RemoveRange(0, removeCountFirstValues);

            var Amplitudes = new List<double>();
            double CoorRange = 10.0; //разброс координат
            double oldAmplitude = 0;
            bool raiseAmplitude = true;
            List<int> tremor = new List<int>();
            double overdraftOneInterval = Values.Count > 0 ? 30000.0 / Values.Count : 0.01;
            int overdraftCount = 0;
            double overdraftTime = 0;
            int amplitudeCritLevel = 5;
            bool overdrafted = false;
            double siloDiameter = 10;
            double mmInCoor = siloDiameter / CoorRange;
            var averagesAmplitude = new List<double>();
            int curTremor = 0;

            var countValuesInterval = (int)Math.Ceiling(Values.Count / 300.0);
            var countValuesIntervalForTremor = Values.Count / 30;

            for (int i = 0; i < Values.Count; i++)
            {

                var amplitude = Math.Sqrt(Math.Pow(Values[i].X - 2 - CoorRange / 2.0, 2) + Math.Pow(Values[i].Y - 2 - CoorRange / 2.0, 2));
                if (amplitude > 6)
                    amplitude = 6;
                Amplitudes.Add(amplitude);
                if ((amplitude > oldAmplitude && !raiseAmplitude) ||
                             (amplitude < oldAmplitude && raiseAmplitude))
                {
                    curTremor++;
                    raiseAmplitude = !raiseAmplitude;
                }

                if (amplitude > amplitudeCritLevel)
                {
                    overdraftTime = overdraftTime + overdraftOneInterval;
                    if (!overdrafted)
                    {
                        overdrafted = true;
                        overdraftCount++;
                    }
                }
                else
                    overdrafted = false;

                if (Amplitudes.Count > 0)
                {
                    if (Amplitudes.Count % countValuesInterval == 0)
                    {
                        var index = i - (countValuesInterval - 1);
                        if (index < 0)
                            index = 0;
                        averagesAmplitude.Add(Amplitudes.GetRange(index, countValuesInterval).Average());
                    }

                    if (Amplitudes.Count % countValuesIntervalForTremor == 0)
                    {
                        tremor.Add(curTremor / 2);
                        curTremor = 0;
                    }

                    if (Amplitudes.Count == Values.Count)
                    {
                        var lastAmplitudeAverageCount = Amplitudes.Count % countValuesInterval;
                        if (lastAmplitudeAverageCount > 0)
                            averagesAmplitude.Add(Amplitudes.GetRange(i - lastAmplitudeAverageCount - 1, lastAmplitudeAverageCount).Average());
                        tremor.Add(curTremor / 2);
                    }
                }

                oldAmplitude = amplitude;
            }

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["График амплитуды отклонения"] = averagesAmplitude.Select(s => (float)s).ToArray(),
                ["Тремор"] = tremor.ToArray(),
                ["Количество выходов щупа за уровень допустимого отклонения"] = overdraftCount,
                ["Суммарное время пребывания щупа за уровнем допустимого отклонения"] = (float)overdraftTime
            });
        }

        private Dictionary<string, object> GetEmptyResults()
        {
            return new Dictionary<string, object>
            {
                ["График амплитуды отклонения"] = new float[1],
                ["Тремор"] = new int[1],
                ["Количество выходов щупа за уровень допустимого отклонения"] = -1,
                ["Суммарное время пребывания щупа за уровнем допустимого отклонения"] = (float)0.0
            };
        }

        private List<System.Windows.Point> Values = new List<System.Windows.Point>();
        public void ValueChanged(System.Windows.Point value)
        {
            if (StartMessageShow)
            {
                Message = "Удерживайте щуп в этом положении до окончания теста";
                StartMessageShow = false;
                LedEnabled?.Invoke(this, true);
                _timer.Start();
            }
            else
            {
                var point = new System.Windows.Point(value.X, value.Y);
                if (Values.Count > 0)
                {
                    if (point.X < 2 || point.X > 12)
                        point.X = Values[Values.Count - 1].X;
                    if (point.Y < 2 || point.Y > 12)
                        point.Y = Values[Values.Count - 1].Y;
                    Values.Add(point);
                }
                else
                    Values.Add(point);
            }
        }

        private bool IsStarted = false;
        public void TremorChanged(TremorChangedEventArgs e)
        {
            if (IsStarted)
            {
                if (!e.Tepping && e.InSilo)
                {
                    ValueChanged(new System.Windows.Point(e.NewPosDirty.X, e.NewPosDirty.Y));
                }
                else
                {
                    Stop();
                    _errorTimer.Start();
                    if (e.Tepping)
                        Message = "Тест прерван!\r\nВы нарушили инструкцию!\r\nВы коснулись дна";
                    else if (!e.InSilo)
                        Message = "Тест прерван!\r\nВы нарушили инструкцию!\r\nВы вытащили щуп";
                }
            }
            else
            {
                if (e.InSilo)
                    IsStarted = true;
            }
        }

        private void _errorTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _errorTimer.Stop();
            Results?.Invoke(this, GetEmptyResults());
        }

        public void Stop()
        {
            LedEnabled?.Invoke(this, false);
            Message = "";
            _timer.Stop();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StaticTremor\StaticTremorViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.StaticTremor
{
    public class StaticTremorViewModel : TestBase
    {
        public override event EventHandler<Results> Results;
       
        private PultTremor Tremor;
        private PultLed Led;
        private StaticTremorControl control;
        
        public StaticTremorViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            Manager.TraningTime = Common.GetSeconds(15);
            SetInstructions("staticTremor");
        }

        public override FrameworkElement GetTestControl()
        {
            return new StaticTremorControl(mode: LearningTasksExtension.TestMode.Manual);
        }

        public override void TestManual()
        {
            control = new StaticTremorControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            control = new StaticTremorControl();
            Led = AdditionalPult as PultLed;
            Led.Disconnected += Disconnected;
            Tremor = Pult as PultTremor;
            Tremor.UpdateInterval = TimeSpan.FromMilliseconds(10);
            Tremor.Start();
            Tremor.TremorChanged += Tremor_TremorChanged;
            Tremor.Disconnected += Disconnected;
            control.LedEnabled += Control_LedEnabled;
            TestCurrentView = control;
            control.Start();
        }

        public override void Start()
        {
            control = new StaticTremorControl();
            Led = AdditionalPult as PultLed;
            Led.Disconnected += Disconnected;
            Tremor = Pult as PultTremor;
            Tremor.UpdateInterval = TimeSpan.FromMilliseconds(10);
            Tremor.Start();
            Tremor.TremorChanged += Tremor_TremorChanged;
            Tremor.Disconnected += Disconnected;
            control.LedEnabled += Control_LedEnabled;
            control.Results += Control_Results;
            TestCurrentView = control;
            control.Start();
        }

        private void Control_LedEnabled(object sender, bool e)
        {
            if (Led.Transport.IsOpen)
                Led.LedState = e;
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Exception = e;
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Disconnected(object sender, DisconnectedEventArgs e)
        {
            Exception = e.Exception;
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        private void Tremor_TremorChanged(object sender, TremorChangedEventArgs e)
        {
            control.TremorChanged(e);
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        public override void Stop()
        {
            if (Led != null)
            {
                if (Exception == null)
                    Led.LedState = false;
                Led.Disconnected -= Disconnected;
            }
            if (Tremor != null)
            {
                Tremor.Disconnected -= Disconnected;
                Tremor.TremorChanged -= Tremor_TremorChanged;
                Tremor.Stop();
            }
            if (control != null)
            {
                control?.Stop();
                control.LedEnabled -= Control_LedEnabled;
                control.Results -= Control_Results;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StaticTremor\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.StaticTremor"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:StaticTremorControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:StaticTremorControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox>
                                        <TextBlock Foreground="White"
                                                   Background="#CC5493E0" 
                                                   TextAlignment="Center"
                                                   Text="{Binding Message,
                                                          RelativeSource={RelativeSource FindAncestor,
                                                          AncestorType={x:Type local:StaticTremorControl}}}"/>
                                    </Viewbox>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:StaticTremorControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:StaticTremorViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:StaticTremorViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:StaticTremorViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StressEvaluationM\IQuestStrategy.cs


namespace Updk7.Tests.Wpf.Psychophysical.StressEvaluationM
{
    public interface IQuestStrategy
    {
        string Quest { get; set; }

        BallColor? GetBallColor();

        BallColor? GetNextBallColor();

        BallColor? GetPrevBallColor();

        BallColor? GetCurrentBallColor();

        void SetPairBalls();

        void ToDefault();
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StressEvaluationM\IStrategy4.cs


namespace Updk7.Tests.Wpf.Psychophysical.StressEvaluationM
{
    public interface IStrategy4
    {
        TableSignalsRow GetRow();
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StressEvaluationM\QuestStrategyContext.cs


using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.StressEvaluationM
{
    public class QuestStrategyContext
    {
        public int NumberQuest { get; private set; }

        public IQuestStrategy Strategy { get; private set; }

        private List<IQuestStrategy> Strategies;

        public QuestStrategyContext(List<IQuestStrategy> strategies)
        {
            Strategies = strategies;
        }

        public BallColor? NextBallColor()
        {
            var nextBallColor = Strategy.GetNextBallColor();
            if (nextBallColor != null)
                return Strategy.GetNextBallColor().Value;
            else
                return null;
        }

        public BallColor? GetCurrentBallColor()
        {
            var nextBallColor = Strategy.GetCurrentBallColor();
            if (nextBallColor != null)
                return Strategy.GetCurrentBallColor().Value;
            else
                return null;
        }

        public void SetPairBalls()
        {
            Strategy.SetPairBalls();
        }

        public BallColor? GetPrevBallColor()
        {
            var prev = Strategy.GetPrevBallColor();
            if (prev == null)
                return null;
            return prev.Value;
        }

        public void StartQuest(int numberQuest)
        {
            NumberQuest = numberQuest;
            switch (numberQuest)
            {
                case 1:
                    Strategy = Strategies[0];
                    break;

                case 2:
                    Strategy = Strategies[1];
                    break;

                case 3:
                    Strategy = Strategies[2];
                    break;

                case 4:
                    Strategy = Strategies[3];
                    break;

                default:
                    NumberQuest = 0;
                    break;
            }
        }

        public BallColor? GetBallColor()
        {
            var color = Strategy.GetBallColor();
            if (color != null)
                return color;
            else
                return null;//если null
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StressEvaluationM\Strategies.cs


using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.StressEvaluationM
{
    public class Strategy1 : IQuestStrategy
    {
        public string Quest { get; set; } = "Задание 1";
        private int countPresents = 12;
        private int currentCountPresents = 0;

        public BallColor? GetBallColor()
        {
            if (countPresents > currentCountPresents)
            {
                currentCountPresents++;
                return BallColor.Green;
            }
            else
                return null;
        }

        public BallColor? GetCurrentBallColor()
        {
            return BallColor.Green;
        }

        public BallColor? GetNextBallColor()
        {
            return BallColor.Green;
        }

        public BallColor? GetPrevBallColor()
        {
            if (currentCountPresents != 0)
                return BallColor.Green;
            else
                return null;
        }

        public void SetPairBalls()
        {
        }

        public void ToDefault()
        {
            currentCountPresents = 0;
        }
    }

    public class Strategy2 : IQuestStrategy
    {
        public string Quest { get; set; } = "Задание 2";
        private int countPresents = 12;
        private int currentCountPresents = 0;

        public BallColor? GetBallColor()
        {
            if (countPresents > currentCountPresents)
            {
                currentCountPresents++;
                return BallColor.Red;
            }
            else
                return null;
        }

        public BallColor? GetCurrentBallColor()
        {
            return BallColor.Red;
        }

        public BallColor? GetNextBallColor()
        {
            return BallColor.Red;
        }

        public void SetPairBalls()
        {
        }

        public BallColor? GetPrevBallColor()
        {
            if (currentCountPresents != 0)
                return BallColor.Green;
            else
                return null;
        }

        public void ToDefault()
        {
            currentCountPresents = 0;
        }
    }

    public class Strategy3 : IQuestStrategy
    {
        public string Quest { get; set; } = "Задание 3";
        private int currentIndexPresent = -1;

        private List<BallColor> tableSignals = new List<BallColor>()
        {
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green
        };

        public Strategy3()
        {
            GenerateTableModification();
        }

        private void GenerateTableModification()
        {
            for (int i = 0; i < tableSignals.Count; i++)
            {
                if (tableSignals[i] == BallColor.Red)
                {
                    var position = Common._rnd.Next(0, 3);
                    switch (position)
                    {
                        case 0:
                            if (i - 1 > 0)
                            {
                                var leftSignal = tableSignals[i - 1];
                                tableSignals[i - 1] = tableSignals[i];
                                tableSignals[i] = leftSignal;
                            }
                            break;

                        case 2:
                            if (i + 1 < tableSignals.Count)
                            {
                                var rightSignal = tableSignals[i + 1];
                                tableSignals[i + 1] = tableSignals[i];
                                tableSignals[i] = rightSignal;
                            }
                            break;
                    }
                }
            }
        }

        public BallColor? GetBallColor()
        {
            if (currentIndexPresent < tableSignals.Count - 1)
            {
                currentIndexPresent++;
                var signal = tableSignals[currentIndexPresent];
                return signal;
            }
            else
                return null;
        }

        public BallColor? GetNextBallColor()
        {
            if (currentIndexPresent == tableSignals.Count - 1 || currentIndexPresent < 0)
                return null;
            return tableSignals[currentIndexPresent + 1];
        }

        public BallColor? GetCurrentBallColor()
        {
            if (currentIndexPresent == tableSignals.Count - 1 || currentIndexPresent < 0)
                return null;
            return tableSignals[currentIndexPresent];
        }

        public void SetPairBalls()
        {
        }

        public BallColor? GetPrevBallColor()
        {
            if (currentIndexPresent <= 0)
                return null;
            else
                return tableSignals[currentIndexPresent - 1];
        }

        public void ToDefault()
        {
            currentIndexPresent = -1;
        }
    }

    public class Strategy4 : IQuestStrategy, IStrategy4
    {
        public string Quest { get; set; } = "Задание 4";
        private int currentIndexPresent = -1;

        private List<TableSignalsRow> tableSignals = new List<TableSignalsRow>()
        {
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Red),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Red),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Red),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Red),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Red),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Red),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green),
         new TableSignalsRow(BallColor.Green)
        };

        public Strategy4()
        {
            GenerateTableModification();
        }

        private void GenerateTableModification()
        {
            for (int i = 0; i < tableSignals.Count; i++)
            {
                if (tableSignals[i].Color == BallColor.Red)
                {
                    var position = Common._rnd.Next(0, 3);
                    switch (position)
                    {
                        case 0:
                            if (i - 1 > 0)
                            {
                                var leftSignal = tableSignals[i - 1];
                                tableSignals[i - 1] = tableSignals[i];
                                tableSignals[i] = leftSignal;
                            }
                            break;

                        case 2:
                            if (i + 1 < tableSignals.Count)
                            {
                                var rightSignal = tableSignals[i + 1];
                                tableSignals[i + 1] = tableSignals[i];
                                tableSignals[i] = rightSignal;
                            }
                            break;
                    }
                }
            }
        }

        public BallColor? GetBallColor()
        {
            if (currentIndexPresent < tableSignals.Count - 1)
            {
                currentIndexPresent++;
                var signal = tableSignals[currentIndexPresent].Color;
                return signal;
            }
            else
                return null;
        }

        public BallColor? GetNextBallColor()
        {
            if (currentIndexPresent == tableSignals.Count - 1 || currentIndexPresent < 0)
                return null;
            return tableSignals[currentIndexPresent + 1].Color;
        }

        public BallColor? GetCurrentBallColor()
        {
            if (currentIndexPresent == tableSignals.Count - 1 || currentIndexPresent < 0)
                return null;
            return tableSignals[currentIndexPresent].Color;
        }

        public void SetPairBalls()
        {
            tableSignals.Insert(currentIndexPresent + 1, new TableSignalsRow(BallColor.Green, true));
            tableSignals.Insert(currentIndexPresent + 1, new TableSignalsRow(BallColor.Red, true));
        }

        public TableSignalsRow GetRow()
        {
            return tableSignals[currentIndexPresent];
        }

        public BallColor? GetPrevBallColor()
        {
            if (currentIndexPresent <= 0)
                return null;
            else
                return tableSignals[currentIndexPresent - 1].Color;
        }

        public void ToDefault()
        {
            currentIndexPresent = -1;
        }
    }
}


*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StressEvaluationM\StressEvaluationMControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.StressEvaluationM
{
    public class StressEvaluationMControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;

        public event EventHandler ResetTimer;

        private Brush _colorBall;

        public Brush ColorBall
        {
            get { return _colorBall; }
            set
            {
                _colorBall = value;
                OnPropertyChanged();
            }
        }

        private BallColor _color;

        public BallColor Color
        {
            get { return _color; }
            set
            {
                if (_color != value)
                {
                    _color = value;
                    ColorBall = GetColor(_color);
                }
            }
        }

        private Brush GetColor(BallColor? color)
        {
            switch (color)
            {
                case BallColor.Green:
                    return Common.Drawing.GetColor(Common.ColorsCircle.Green);

                case BallColor.Red:
                    return Common.Drawing.GetColor(Common.ColorsCircle.Red);

                case BallColor.Default:
                    return Brushes.Gray;
            }
            return null;
        }

        private List<RowTableResult> _tableResult = new List<RowTableResult>();
        public double Average3Quest { get; set; }
        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private DispatcherTimer _timer = new DispatcherTimer();
        private QuestStrategyContext _context;
        private int _numberQuest = 0;
        private int sumEmptyClicks = 0;//количество пустых нажатий
        private List<double> reactionsAfterRedSignals;
        public StressEvaluationMControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
            {
                Color = BallColor.Default;
                TestMethods.Add("GreenSignal", () => GreenSignal());
                TestMethods.Add("RedSignal", () => RedSignal());
                TestMethods.Add("HideCircle", () => HideCircle());
            }
        }

        public StressEvaluationMControl(List<IQuestStrategy> strategies)
        {
            _timer.Tick += _timer_Tick;
            _context = new QuestStrategyContext(strategies);
        }

        private void HideCircle()
        {
            Color = BallColor.Default;
        }

        public void RedSignal()
        {
            Color = BallColor.Red;
        }

        public void GreenSignal()
        {
            Color = BallColor.Green;
        }

        public void Start(int numberQuest)
        {
            Clear();
            _timer.Interval = TimeSpan.FromSeconds(Common.GetRandomNumber(1.5, 4));
            Color = BallColor.Default;
            _numberQuest = numberQuest;
            _context.StartQuest(numberQuest);
            _timer.Start();
        }

        private void Clear()
        {
            sumEmptyClicks = 0;
            reactionsAfterRedSignals = new List<double>();
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            _timer.Stop();
            switch (Color)
            {
                case BallColor.Green:
                    _timer.Interval = TimeSpan.FromSeconds(Common.GetRandomNumber(1.5, 4));
                    _tableResult.Add(new RowTableResult(Color, Buttons.NoButton, 2));//если не отреагировал
                    Color = BallColor.Default;
                    _timer.Start();
                    break;

                case BallColor.Red:
                    _timer.Interval = TimeSpan.FromSeconds(Common.GetRandomNumber(1.5, 4));
                    _tableResult.Add(new RowTableResult(Color, Buttons.NoButton, 2));//если не отреагировал
                    Color = BallColor.Default;
                    _timer.Start();
                    break;

                case BallColor.Default:
                    var value = _context.GetBallColor();
                    if (value != null)
                    {
                        Color = value.Value;
                        ResetTimer?.Invoke(this, new EventArgs());
                        _timer.Start();
                        _timer.Interval = TimeSpan.FromSeconds(2);
                    }
                    else
                    {
                        _timer.Stop();
                        CalculateResults();
                    }
                    break;
            }
        }

        private int countMoreThanAverageTimesInARow = 0;//количество подряд(счетчик)
        private int countReactionsForAdditionalRedSignals = 0;
        private int countAdditionalPairSignals = 0;

        public void PressButton(Buttons button, int time)
        {
            var curTime = TimeSpan.FromSeconds(time / 10000.0).TotalSeconds;
            if (Color != BallColor.Default)
            {
                _timer.Stop();
                switch (_numberQuest)
                {
                    case 1:
                        if (button == Buttons.Green)
                        {
                            _tableResult.Add(new RowTableResult(Color, button, curTime));
                        }
                        else
                        {
                            _tableResult.Add(new RowTableResult(Color, button, -1));
                        }
                        break;

                    case 2:
                        if (button == Buttons.Red)
                        {
                            _tableResult.Add(new RowTableResult(Color, button, curTime));
                        }
                        else
                        {
                            _tableResult.Add(new RowTableResult(Color, button, -1));
                        }
                        break;

                    case 3:
                        if (Color == BallColor.Red)
                        {
                            _tableResult.Add(new RowTableResult(Color, button, -1));
                        }
                        else if (Color == BallColor.Green)
                        {
                            if (button == Buttons.Green)
                            {
                                _tableResult.Add(new RowTableResult(Color, button, curTime));
                            }
                            else
                            {
                                _tableResult.Add(new RowTableResult(Color, button, -1));
                            }
                        }
                        break;

                    case 4:
                        if (Color == BallColor.Red)
                        {
                            if (_context.Strategy is IStrategy4 strategy)
                                if (strategy.GetRow().IsAdditionalSignal)
                                {
                                    countReactionsForAdditionalRedSignals++;
                                    _tableResult.Add(new RowTableResult(Color, button, -1, true));
                                }
                                else
                                {
                                    _tableResult.Add(new RowTableResult(Color, button, -1));
                                }
                        }
                        else if (Color == BallColor.Green)
                        {
                            if (button == Buttons.Green)
                            {
                                if (_context.GetPrevBallColor() == BallColor.Red)
                                {
                                    if (curTime > Average3Quest)
                                    {
                                        _context.SetPairBalls();
                                        countAdditionalPairSignals++;
                                        countMoreThanAverageTimesInARow++;
                                        if (countMoreThanAverageTimesInARow > 3)
                                        {
                                            CalculateResults();
                                        }
                                    }
                                    else
                                    {
                                        countMoreThanAverageTimesInARow = 0;
                                    }
                                }
                                _tableResult.Add(new RowTableResult(Color, button, curTime, (_context.Strategy as IStrategy4).GetRow().IsAdditionalSignal));
                            }
                            else
                            {
                                _tableResult.Add(new RowTableResult(Color, button, -1));
                            }
                        }
                        break;
                }

                var value = _context.NextBallColor();
                if (value == null)
                {
                    _timer.Stop();
                    CalculateResults();
                }
                else
                {
                    _timer.Interval = TimeSpan.FromSeconds(Common.GetRandomNumber(1.5, 4));
                    Color = BallColor.Default;
                    _timer.Start();
                }
            }
            else if (Color == BallColor.Default &&
                _context.GetCurrentBallColor() == BallColor.Red &&
                _context.NextBallColor() == BallColor.Green &&
                button == Buttons.Green)
            {
                sumEmptyClicks++;
            }
        }

        private void CalculateResults()
        {
            _timer.Stop();

            switch (_numberQuest)
            {
                case 1:
                    {
                        var reactions = _tableResult.Where(w => w.Signal == BallColor.Green && w.Reaction > 0);
                        var averageGreen1 = reactions.Count() > 0 ? reactions.Average(a => a.Reaction) : 0.0;
                        Results?.Invoke(this, new Dictionary<string, object>()
                        {
                            ["Задание 1. Cреднеарифметическое T реагирования"] = (float)averageGreen1,
                            [$"Таблица {_context.Strategy.Quest}: тип сигнала"] = _tableResult.Select(s => (int)s.Signal).ToArray(),
                            [$"Таблица {_context.Strategy.Quest}: реакция"] = _tableResult.Select(s => (float)s.Reaction).ToArray()
                        });
                        break;
                    }
                case 2:
                    {
                        var reactions = _tableResult.Where(w => w.Signal == BallColor.Red && w.Reaction > 0);
                        var averageRed1 = reactions.Count() > 0 ? reactions.Average(a => a.Reaction) : 0.0;
                        Results?.Invoke(this, new Dictionary<string, object>()
                        {
                            ["Задание 2. Cреднеарифметическое Т реагирования"] = (float)averageRed1,
                            [$"Таблица {_context.Strategy.Quest}: тип сигнала"] = _tableResult.Select(s => (int)s.Signal).ToArray(),
                            [$"Таблица {_context.Strategy.Quest}: реакция"] = _tableResult.Select(s => (float)s.Reaction).ToArray()
                        });
                        break;
                    }
                case 3:
                    {
                        List<double> reactionsAfterRed1 = GetReactionsAfterRedSignal();
                        Average3Quest = reactionsAfterRed1.Count > 0 ? reactionsAfterRed1.Average() : 0.0;
                        var pressesRedSignal = _tableResult.Where(w => w.Reaction == -1 && w.Signal == BallColor.Red);

                        var countPresesRedSignal = pressesRedSignal.Count();

                        Results?.Invoke(this, new Dictionary<string, object>()
                        {
                            ["Задание 3. Среднее время реагирования (Т3)"] = (float)Average3Quest,
                            ["Задание 3. Количество ошибок (нажатие на красный сигнал)"] = countPresesRedSignal,
                            ["Задание 3. Количество " + '"' + "пустых" + '"' + " нажатий на зелёную кнопку между загораниями красного и зелёного сигналов"] = sumEmptyClicks,
                            [$"Таблица {_context.Strategy.Quest}: тип сигнала"] = _tableResult.Select(s => (int)s.Signal).ToArray(),
                            [$"Таблица {_context.Strategy.Quest}: реакция"] = _tableResult.Select(s => (float)s.Reaction).ToArray()
                        });
                        break;
                    }
                case 4:
                    {
                        List<double> reactionsAfterRed2 = GetReactionsAfterRedSignal();

                        var averageAfterRedSignals = reactionsAfterRed2.Count > 0 ? reactionsAfterRed2.Average() : 0.0;
                        var pressesRedSignal = _tableResult.Where(w => w.Reaction == -1 && w.Signal == BallColor.Red);

                        var countPresesRedSignal = pressesRedSignal.Count();

                        Results?.Invoke(this, new Dictionary<string, object>()
                        {
                            ["Задание 4. Среднее время реагирования (Т4)"] = (float)averageAfterRedSignals,
                            ["Задание 4. Количество ошибок (нажатие на красный сигнал)"] = countPresesRedSignal,
                            ["Задание 4. Количество " + '"' + "пустых" + '"' + " нажатий на зелёную кнопку между загораниями красного и зелёного сигналов"] = sumEmptyClicks,
                            ["Задание 4. Количество дополнительных пар сигналов"] = countAdditionalPairSignals,
                            ["Задание 4. Количество реакций на дополнительные красные сигналы"] = countReactionsForAdditionalRedSignals,
                            [$"Таблица {_context.Strategy.Quest}: тип сигнала"] = _tableResult.Select(s => (int)s.Signal).ToArray(),
                            [$"Таблица {_context.Strategy.Quest}: реакция"] = _tableResult.Select(s => (float)s.Reaction).ToArray()
                        });
                        break;
                    }
            }
        }

        private List<double> GetReactionsAfterRedSignal()
        {
            RowTableResult rtr = null;
            var reactionsAfterRed = new List<double>();
            foreach (var signal in _tableResult)
            {
                if (rtr != null)
                {
                    if (signal.Signal == BallColor.Green && rtr.Signal == BallColor.Red && signal.Button == Buttons.Green)
                    {
                        reactionsAfterRed.Add(signal.Reaction);
                    }
                }
                rtr = signal;
            }

            return reactionsAfterRed;
        }

        public void Stop()
        {
            _timer.Stop();
        }
    }

    public class TableResult
    {
        public string QuestName { get; private set; }
        public List<RowTableResult> Table { get; private set; }

        public TableResult(string questName, List<RowTableResult> table)
        {
            QuestName = questName;
            Table = table;
        }
    }

    public class RowTableResult
    {
        public BallColor? Signal { get; private set; }
        public Buttons? Button { get; private set; }
        public bool IsAdditionalSignal { get; private set; }
        public double Reaction { get; set; }

        public RowTableResult(BallColor? signal, Buttons? button, double reaction, bool isAdditionalSignal = false)
        {
            Reaction = reaction;
            Signal = signal;
            Button = button;
            IsAdditionalSignal = isAdditionalSignal;
        }
    }

    public enum Buttons
    {
        Green,
        Red,
        NoButton
    }

    public enum BallColor
    {
        Green,
        Red,
        Default
    }
}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StressEvaluationM\StressEvaluationMViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.StressEvaluationM
{
    public class StressEvaluationMViewModel : TestBase
    {
        private int _numberInstruction;
        public int NumberInstruction
        {
            get { return _numberInstruction; }
            set
            {
                _numberInstruction = value;
                OnPropertyChanged();
            }
        }

        public override event EventHandler<Results> Results;

        private Pult.PultButtons Buttons;
        private StressEvaluationMControl control;
        private List<IQuestStrategy> _strategies;
        public StressEvaluationMViewModel(List<IQuestStrategy> strategies, PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            _strategies = strategies;
            Manager.TraningTime = Common.GetSeconds(40);
            SetInstructions("StressEvaluationM_1", 1);
            NumberInstruction = 1;
        }


        public override FrameworkElement GetTestControl()
        {
            return new StressEvaluationMControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new StressEvaluationMControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }


        public override void TestStart()
        {
            control = new StressEvaluationMControl(_strategies);
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            control.Start(1);
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }
        private void Buttons_Disconnected(object sender, Pult.DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception=e.Exception});
        }

        public override void ToDefault()
        {
            base.ToDefault();
            //NumberInstruction = 1;
        }

        public override void Start()
        {
            GenetateControl();
            control.Start(NumberInstruction);
        }

        private void GenetateControl()
        {
            foreach (var strategy in _strategies)
                strategy.ToDefault();

            control = new StressEvaluationMControl(_strategies);
            if (_Average3Quest != 0)
                control.Average3Quest = _Average3Quest;
            Buttons = Pult as PultButtons;
            TestCurrentView = control;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            control.Results += Control_Results;
        }

        private Dictionary<string, object> QuestResult = new Dictionary<string, object>();
        private double _Average3Quest = 0;
        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            try
            {
                foreach (KeyValuePair<string, object> kvPair in e)
                    QuestResult.Add(kvPair.Key, kvPair.Value);
                _Average3Quest = (sender as StressEvaluationMControl).Average3Quest;
                if (NumberInstruction != 4)
                {
                    Stop();
                }
                else
                {
                    QuestResult.Add("Разница времён реагирования (Т3 - Т4)",
                        Convert.ToSingle(QuestResult["Задание 3. Среднее время реагирования (Т3)"]) - Convert.ToSingle(QuestResult["Задание 4. Среднее время реагирования (Т4)"]));
                    QuestResult.Add("Разница количества ошибок между 4-ым и 3-им заданиями",
                        Convert.ToInt32(QuestResult["Задание 4. Количество ошибок (нажатие на красный сигнал)"]) - Convert.ToInt32(QuestResult["Задание 3. Количество ошибок (нажатие на красный сигнал)"]));
                    Results?.Invoke(this, new Results(QuestResult));
                }
                NumberInstruction++;
                SetInstructions($"StressEvaluationM_{NumberInstruction}", NumberInstruction, true);
                Manager.ToInstruction();
            }
            catch (Exception)
            {
                throw new Exception($"Error: {ExceptionCodes.StressEvaluationMCodes.Vm_Error_ControlResults_Code}");
            }
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Green)
                control.PressButton(StressEvaluationM.Buttons.Green, e.Time);
            else if (e.Button == PultButton.Red)
                control.PressButton(StressEvaluationM.Buttons.Red, e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.ResetTimer -= Control_ResetTimer;
                control.Results -= Control_Results;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StressEvaluationM\TableSignalsRow.cs


namespace Updk7.Tests.Wpf.Psychophysical.StressEvaluationM
{
    public class TableSignalsRow
    {
        public BallColor Color { get; set; }
        public bool IsAdditionalSignal { get; set; }

        public TableSignalsRow(BallColor color, bool isAdditionalSignal = false)
        {
            Color = color;
            IsAdditionalSignal = isAdditionalSignal;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StressEvaluationM\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.StressEvaluationM"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    <Style TargetType="local:StressEvaluationMControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:StressEvaluationMControl">
                    <Border Background="{TemplateBinding Background}">
                        <Viewbox>
                            <Grid Width="1920"
                                  Height="1080">
                                <Ellipse Height="3cm"
                                             Width="3cm"
                                             HorizontalAlignment="Center"
                                             VerticalAlignment="Center"
                                             Fill="{Binding ColorBall, 
                                                    RelativeSource={RelativeSource FindAncestor, 
                                                    AncestorType={x:Type local:StressEvaluationMControl}}}"
                                             Stroke="White"/>
                                <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:StressEvaluationMControl}}}">
                                    <ContentPresenter.Resources>
                                        <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                            <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                        </DataTemplate>
                                    </ContentPresenter.Resources>
                                </ContentPresenter>
                            </Grid>
                        </Viewbox>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:StressEvaluationMViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:StressEvaluationMViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:StressEvaluationMViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StressEvaluationM2\Strategies.cs


using System.Collections.Generic;
using Updk7.Tests.Wpf.Psychophysical.StressEvaluationM;

namespace Updk7.Tests.Wpf.Psychophysical.StressEvaluationM2
{
    public class Strategy3 : IQuestStrategy
    {
        public string Quest { get; set; } = "Задание 3";
        private int currentIndexPresent = -1;

        private List<BallColor> tableSignals = new List<BallColor>();

        public Strategy3()
        {
            for (int i = 0; i < 46; i++)
                tableSignals.Add(BallColor.Green);

            GenerateTableModification();
        }

        private void GenerateTableModification()
        {
            for (int i = 0; i < tableSignals.Count; i++)
            {
                if (i == 4 || i == 10 || i == 17 || i == 23 || i == 31 || i == 39)
                {
                    var indexRedSignal = i + Common._rnd.Next(0, 4);
                    tableSignals[indexRedSignal] = BallColor.Red;
                }
            }
        }

        public BallColor? GetBallColor()
        {
            if (currentIndexPresent < tableSignals.Count - 1)
            {
                currentIndexPresent++;
                var signal = tableSignals[currentIndexPresent];
                return signal;
            }
            else
                return null;
        }

        public BallColor? GetNextBallColor()
        {
            if (currentIndexPresent == tableSignals.Count - 1 || currentIndexPresent < 0)
                return null;
            return tableSignals[currentIndexPresent + 1];
        }

        public BallColor? GetCurrentBallColor()
        {
            if (currentIndexPresent == tableSignals.Count - 1 || currentIndexPresent < 0)
                return null;
            return tableSignals[currentIndexPresent];
        }

        public void SetPairBalls()
        {

        }

        public BallColor? GetPrevBallColor()
        {
            if (currentIndexPresent <= 0)
                return null;
            else
                return tableSignals[currentIndexPresent - 1];
        }

        public void ToDefault()
        {
            currentIndexPresent = -1;
        }
    }

    public class Strategy4 : IQuestStrategy, IStrategy4
    {
        public string Quest { get; set; } = "Задание 4";
        private int currentIndexPresent = -1;

        private List<TableSignalsRow> tableSignals = new List<TableSignalsRow>();

        public Strategy4()
        {
            for (int i = 0; i < 46; i++)
                tableSignals.Add(new TableSignalsRow(BallColor.Green));

            GenerateTableModification();
        }

        private void GenerateTableModification()
        {
            for (int i = 0; i < tableSignals.Count; i++)
            {
                if (i == 4 || i == 10 || i == 17 || i == 23 || i == 31 || i == 39)
                {
                    var indexRedSignal = i + Common._rnd.Next(0, 4);
                    tableSignals[indexRedSignal].Color = BallColor.Red;
                }
            }
        }

        public BallColor? GetBallColor()
        {
            if (currentIndexPresent < tableSignals.Count - 1)
            {
                currentIndexPresent++;
                var signal = tableSignals[currentIndexPresent].Color;
                return signal;
            }
            else
                return null;
        }

        public BallColor? GetNextBallColor()
        {
            if (currentIndexPresent == tableSignals.Count - 1 || currentIndexPresent < 0)
                return null;
            return tableSignals[currentIndexPresent + 1].Color;
        }

        public BallColor? GetCurrentBallColor()
        {
            if (currentIndexPresent == tableSignals.Count - 1 || currentIndexPresent < 0)
                return null;
            return tableSignals[currentIndexPresent].Color;
        }

        public void SetPairBalls()
        {
            tableSignals.Insert(currentIndexPresent + 1, new TableSignalsRow(BallColor.Green, true));
            tableSignals.Insert(currentIndexPresent + 1, new TableSignalsRow(BallColor.Red, true));
        }

        public TableSignalsRow GetRow()
        {
            return tableSignals[currentIndexPresent];
        }

        public BallColor? GetPrevBallColor()
        {
            if (currentIndexPresent <= 0)
                return null;
            else
                return tableSignals[currentIndexPresent - 1].Color;
        }

        public void ToDefault()
        {
            currentIndexPresent = -1;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StressEvaluationSTR\StressEvaluationSTRControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.StressEvaluationSTR
{
    public class StressEvaluationSTRControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler ResetTimer;
        private Brush _colorBall;
        public Brush ColorBall
        {
            get { return _colorBall; }
            set
            {
                _colorBall = value;
                OnPropertyChanged();
            }
        }

        private BallColor _color;
        public BallColor Color
        {
            get { return _color; }
            set
            {
                if (_color != value)
                {
                    _color = value;
                    ColorBall = GetColor(_color);
                }
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }
        private Brush GetColor(BallColor? color)
        {
            switch (color)
            {
                case BallColor.Green:
                    return Common.Drawing.GetColor(Common.ColorsCircle.Green);
                case BallColor.Red:
                    return Common.Drawing.GetColor(Common.ColorsCircle.Red);
                case BallColor.Default:
                    return Brushes.Gray;
            }
            return null;
        }

        private DispatcherTimer _timer = new DispatcherTimer();
        private QuestStrategyContext _context;
        private int _numberQuest = 0; 
        private List<ResultRow> _reactions;
        private int errors = 0;
        private int sumEmptyClicks = 0;//количество пустых нажатий

        public StressEvaluationSTRControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
            {
                Color = BallColor.Default;
                TestMethods.Add("GreenSignal", () => GreenSignal());
                TestMethods.Add("RedSignal", () => RedSignal());
                TestMethods.Add("HideCircle", () => HideCircle());
            }
        }
        public StressEvaluationSTRControl()
        {
            _timer.Tick += _timer_Tick;
            _context = new QuestStrategyContext();
        }

        private void HideCircle()
        {
            Color = BallColor.Default;
        }

        public void RedSignal()
        {
            Color = BallColor.Red;
        }

        public void GreenSignal()
        {
            Color = BallColor.Green;
        }
        public void Start(int numberQuest)
        {
            Clear();
            _timer.Interval = TimeSpan.FromSeconds(Common.GetRandomNumber(1.5, 4));
            Color = BallColor.Default;
            _numberQuest = numberQuest;
            _context.StartQuest(numberQuest);
            _timer.Start();
        }

        private void Clear()
        {
            _reactions = new List<ResultRow>();
            errors = 0;
            sumEmptyClicks = 0;
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            _timer.Stop();
            switch (Color)
            {
                case BallColor.Green:
                    _timer.Interval = TimeSpan.FromSeconds(Common.GetRandomNumber(1.5, 4));
                    _reactions.Add(new ResultRow(BallColor.Green, 2000));//если не отреагировал
                    Color = BallColor.Default;
                    _timer.Start();
                    break;
                case BallColor.Red:
                    _timer.Interval = TimeSpan.FromSeconds(Common.GetRandomNumber(1.5, 4));
                    _reactions.Add(new ResultRow(BallColor.Red, 2000));//если не отреагировал
                    Color = BallColor.Default;
                    _timer.Start();
                    break;
                case BallColor.Default:
                    var value = _context.GetBallColor();
                    if (value != null)
                    {
                        Color = value.Value;
                        ResetTimer?.Invoke(this, new EventArgs());
                        _timer.Start();
                        _timer.Interval = TimeSpan.FromSeconds(2);
                    }
                    else
                    {
                        _timer.Stop();
                        CalculateResults();
                    }
                    break;
            }
        }

        public void PressButton(Buttons button, int time)
        {
            if (Color != BallColor.Default)
            {
                _timer.Stop();
                var curTime = TimeSpan.FromSeconds(time / 10000.0).TotalMilliseconds;
                switch (_numberQuest)
                {
                    case 1:
                        if (button == Buttons.Green)
                            _reactions.Add(new  ResultRow(BallColor.Green, curTime));
                        else
                            errors++;
                        break;
                    case 2:
                        if (button == Buttons.Red)
                            _reactions.Add(new ResultRow(BallColor.Red, curTime));
                        else
                            errors++;
                        break;
                    case 3:
                        if (Color == BallColor.Red)
                            errors++;
                        else if (Color == BallColor.Green)
                        {
                            if (button == Buttons.Green)
                                _reactions.Add(new ResultRow(BallColor.Green, curTime));
                            else
                                errors++;
                        }
                        break;
                    case 4:
                        if (Color == BallColor.Red)
                            errors++;
                        else if (Color == BallColor.Green)
                        {
                            if (button == Buttons.Green)
                                _reactions.Add(new ResultRow(BallColor.Green, curTime));
                            else
                                errors++;
                        }
                        break;
                }

                var value = _context.NextBallColor();
                if (value == null)
                {
                    _timer.Stop();
                    CalculateResults();
                }
                else
                {
                    _timer.Interval = TimeSpan.FromSeconds(Common.GetRandomNumber(1.5, 4));
                    Color = BallColor.Default;
                    _timer.Start();
                }
            }
            else if (Color == BallColor.Default &&
                _context.GetCurrentBallColor() == BallColor.Red &&
                _context.NextBallColor() == BallColor.Green &&
                button == Buttons.Green)
            {
                sumEmptyClicks++;
            }
        }

        private void CalculateResults()
        {
            _timer.Stop();
           
            switch (_numberQuest)
            {
                case 1:
                    Results?.Invoke(this, new Dictionary<string, object>()
                    {
                        ["Задание 1. Cреднеарифметическое T реагирования"] = (float)(_reactions.Count > 0 ? _reactions.Average(a=>a.TimeReaction) : 0.0)
                    });
                    break;
                case 2:
                    Results?.Invoke(this, new Dictionary<string, object>()
                    {
                        ["Задание 2. Cреднеарифметическое Т реагирования"] = (float)(_reactions.Count > 0 ? _reactions.Average(a => a.TimeReaction) : 0.0)
                    });
                    break;
                case 3:

                    var reactionsAfterRedSignals1 = GetReactionsAfterRedSignal();
                    var averageAfterRedSignals1 = reactionsAfterRedSignals1.Count > 0 ? reactionsAfterRedSignals1.Average() : 0.0;

                    Results?.Invoke(this, new Dictionary<string, object>()
                    {
                        ["Задание 3. Среднее время реагирования (Т3)"] = (float)averageAfterRedSignals1,
                        ["Задание 3. Количество ошибок (нажатие на красный сигнал)"] = errors,
                        ["Задание 3. Количество " + '"' + "пустых" + '"' + " нажатий на зелёную кнопку между загораниями красного и зелёного сигналов"] = sumEmptyClicks
                    });
                    break;
                case 4:

                    var reactionsAfterRedSignals2 = GetReactionsAfterRedSignal();
                    var averageAfterRedSignals2 = reactionsAfterRedSignals2.Count > 0 ? reactionsAfterRedSignals2.Average() : 0.0;

                    Results?.Invoke(this, new Dictionary<string, object>()
                    {
                        ["Задание 4. Среднее время реагирования (Т4)"] = (float)averageAfterRedSignals2,
                        ["Задание 4. Количество ошибок (нажатие на красный сигнал)"] = errors,
                        ["Задание 4. Количество " + '"' + "пустых" + '"' + " нажатий на зелёную кнопку между загораниями красного и зелёного сигналов"] = sumEmptyClicks
                    });
                    break;
            }
        }

        private List<double> GetReactionsAfterRedSignal()
        {
            ResultRow rr = null;
            var reactionsAfterRed = new List<double>();
            foreach (var signal in _reactions)
            {
                if (rr != null)
                {
                    if (signal.Signal == BallColor.Green && rr.Signal == BallColor.Red)
                    {
                        reactionsAfterRed.Add(signal.TimeReaction);
                    }
                }
                rr = signal;
            }

            return reactionsAfterRed;
        }

        public void Stop()
        {
            _timer.Stop();
        }
    }

    public class ResultRow
    {
        public BallColor Signal { get; set; }
        public double TimeReaction { get; set; }

        public ResultRow(BallColor signal, double timeReaction)
        {
            Signal = signal;
            TimeReaction = timeReaction / 1000;
        }
    }

    public enum Buttons
    {
        Green,
        Red
    }

    public enum BallColor
    {
        Green,
        Red,
        Default
    }

    public interface IQuestStrategy
    {
        BallColor? GetBallColor();
        BallColor? GetNextBallColor();
        BallColor? GetCurrentBallColor();
    }

    public class Strategy1 : IQuestStrategy
    {
        private int countPresents = 12;
        private int currentCountPresents = 0;
        public BallColor? GetBallColor()
        {
            if (countPresents > currentCountPresents)
            {
                currentCountPresents++;
                return BallColor.Green;
            }
            else
                return null;

        }

        public BallColor? GetCurrentBallColor()
        {
            return BallColor.Green;
        }

        public BallColor? GetNextBallColor()
        {
            return BallColor.Green;
        }
    }

    public class Strategy2 : IQuestStrategy
    {
        private int countPresents = 12;
        private int currentCountPresents = 0;
        public BallColor? GetBallColor()
        {
            if (countPresents > currentCountPresents)
            {
                currentCountPresents++;
                return BallColor.Red;
            }
            else
                return null;
        }

        public BallColor? GetCurrentBallColor()
        {
            return BallColor.Red;
        }

        public BallColor? GetNextBallColor()
        {
            return BallColor.Red;
        }
    }

    public class Strategy3 : IQuestStrategy
    {
        private int currentIndexPresent = -1;
        private List<BallColor> tableSignals = new List<BallColor>()
        {
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green
        };
        public Strategy3()
        {
            GenerateTableModification();
        }

        private void GenerateTableModification()
        {
            for (int i = 0; i < tableSignals.Count; i++)
            {
                if (tableSignals[i] == BallColor.Red)
                {
                    var position = Common._rnd.Next(0, 3);
                    switch (position)
                    {
                        case 0:
                            if (i - 1 > 0)
                            {
                                var leftSignal = tableSignals[i - 1];
                                tableSignals[i - 1] = tableSignals[i];
                                tableSignals[i] = leftSignal;
                            }
                            break;
                        case 2:
                            if (i + 1 < tableSignals.Count)
                            {
                                var rightSignal = tableSignals[i + 1];
                                tableSignals[i + 1] = tableSignals[i];
                                tableSignals[i] = rightSignal;
                            }
                            break;
                    }
                }
            }
        }

        public BallColor? GetBallColor()
        {
            if (currentIndexPresent < tableSignals.Count - 1)
            {
                currentIndexPresent++;
                var signal = tableSignals[currentIndexPresent];
                return signal;
            }
            else
                return null;
        }

        public BallColor? GetNextBallColor()
        {
            if (currentIndexPresent == tableSignals.Count - 1 || currentIndexPresent < 0)
                return null;
            return tableSignals[currentIndexPresent + 1];
        }

        public BallColor? GetCurrentBallColor()
        {
            if (currentIndexPresent == tableSignals.Count - 1 || currentIndexPresent < 0)
                return null;
            return tableSignals[currentIndexPresent];
        }
    }

    public class Strategy4 : IQuestStrategy
    {
        private int currentIndexPresent = -1;
        private List<BallColor> tableSignals = new List<BallColor>()
        {
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Red,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green,
         BallColor.Green
        };
        public Strategy4()
        {
            GenerateTableModification();
        }

        private void GenerateTableModification()
        {
            for (int i = 0; i < tableSignals.Count; i++)
            {
                if (tableSignals[i] == BallColor.Red)
                {
                    var position = Common._rnd.Next(0, 3);
                    switch (position)
                    {
                        case 0:
                            if (i - 1 > 0)
                            {
                                var leftSignal = tableSignals[i - 1];
                                tableSignals[i - 1] = tableSignals[i];
                                tableSignals[i] = leftSignal;
                            }
                            break;
                        case 2:
                            if (i + 1 < tableSignals.Count)
                            {
                                var rightSignal = tableSignals[i + 1];
                                tableSignals[i + 1] = tableSignals[i];
                                tableSignals[i] = rightSignal;
                            }
                            break;
                    }
                }
            }
        }

        public BallColor? GetBallColor()
        {
            if (currentIndexPresent < tableSignals.Count - 1)
            {
                currentIndexPresent++;
                var signal = tableSignals[currentIndexPresent];
                return signal;
            }
            else
                return null;
        }

        public BallColor? GetNextBallColor()
        {
            if (currentIndexPresent == tableSignals.Count - 1 || currentIndexPresent < 0)
                return null;
            return tableSignals[currentIndexPresent + 1];
        }

        public BallColor? GetCurrentBallColor()
        {
            if (currentIndexPresent == tableSignals.Count - 1 || currentIndexPresent < 0)
                return null;
            return tableSignals[currentIndexPresent];
        }
    }

    public class QuestStrategyContext
    {
        public int NumberQuest { get; private set; }
        private IQuestStrategy strategy;
        public BallColor? NextBallColor()
        {
            var nextBallColor = strategy.GetNextBallColor();
            if (nextBallColor != null)
                return strategy.GetNextBallColor().Value;
            else
                return null;
        }
        public BallColor GetCurrentBallColor()
        {
            return strategy.GetCurrentBallColor().Value;
        }

        public void StartQuest(int numberQuest)
        {
            NumberQuest = numberQuest;
            switch (numberQuest)
            {
                case 1:
                    strategy = new Strategy1();
                    break;
                case 2:
                    strategy = new Strategy2();
                    break;
                case 3:
                    strategy = new Strategy3();
                    break;
                case 4:
                    strategy = new Strategy4();
                    break;
                default:
                    NumberQuest = 0;
                    break;
            }

        }

        public BallColor? GetBallColor()
        {
            var color = strategy.GetBallColor();
            if (color != null)
                return color;
            else
                return null;//если null
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StressEvaluationSTR\StressEvaluationSTRViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.StressEvaluationSTR
{
    public class StressEvaluationSTRViewModel : TestBase
    {
        private int _numberInstruction;
        public int NumberInstruction
        {
            get { return _numberInstruction; }
            set
            {
                _numberInstruction = value;
                OnPropertyChanged();
            }
        }

        public override event EventHandler<Results> Results;
       
        private Pult.PultButtons Buttons;
        private StressEvaluationSTRControl control;
        public StressEvaluationSTRViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            Manager.TraningTime = Common.GetSeconds(40);
            SetInstructions("StressEvaluationM_1", 1);
            NumberInstruction = 1;
        }

        public override FrameworkElement GetTestControl()
        {
            return new StressEvaluationSTRControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new StressEvaluationSTRControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void ToDefault()
        {
            base.ToDefault();
            //NumberInstruction = 1;
        }

        public override void TestStart()
        {
            control = new StressEvaluationSTRControl();
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            control.Start(1);
        }

        public override void Start()
        {
            GenetateControl();
            control.Start(NumberInstruction);
        }

        private void GenetateControl()
        {
            control = new StressEvaluationSTRControl();
            Buttons = Pult as Pult.PultButtons;
            Buttons.UpdateInterval = TimeSpan.FromMilliseconds(50);
            TestCurrentView = control;
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            control.Results += Control_Results;
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Buttons_Disconnected(object sender, Pult.DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) {Exception = e.Exception });
        }

        private Dictionary<string, object> QuestResult = new Dictionary<string, object>();
        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            foreach (var kvPair in e)
                QuestResult.Add(kvPair.Key, kvPair.Value);
            if (NumberInstruction != 4)
            {
                Stop();
            }
            else
            {
                QuestResult.Add("Разница времён реагирования (Т3 - Т4)",
                    Convert.ToSingle(QuestResult["Задание 3. Среднее время реагирования (Т3)"]) - Convert.ToSingle(QuestResult["Задание 4. Среднее время реагирования (Т4)"]));
                QuestResult.Add("Разница количества ошибок между 4-ым и 3-им заданиями",
                    Convert.ToInt32(QuestResult["Задание 4. Количество ошибок (нажатие на красный сигнал)"]) - Convert.ToInt32(QuestResult["Задание 3. Количество ошибок (нажатие на красный сигнал)"]));
                Results?.Invoke(this, new Results(QuestResult));
            }
            NumberInstruction++; 
            SetInstructions($"StressEvaluationM_{NumberInstruction}", NumberInstruction, true);
            Manager.ToInstruction();
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void Buttons_ButtonPressed(object sender, Pult.ButtonPressedEventArgs e)
        {
            if (e.Button == Tests.Pult.PultButton.Green)
                control.PressButton(StressEvaluationSTR.Buttons.Green, e.Time);
            else if (e.Button == Tests.Pult.PultButton.Red)
                control.PressButton(StressEvaluationSTR.Buttons.Red, e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.ResetTimer -= Control_ResetTimer;
                control.Results -= Control_Results;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\StressEvaluationSTR\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.StressEvaluationSTR"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <Style TargetType="local:StressEvaluationSTRControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:StressEvaluationSTRControl">
                    <Border Background="{TemplateBinding Background}">
                        <Viewbox>
                            <Grid Width="1920"
                                  Height="1080">
                                <Ellipse Height="3cm"
                                             Width="3cm"
                             HorizontalAlignment="Center"
                             VerticalAlignment="Center"
                             Fill="{Binding ColorBall, 
                                    RelativeSource={RelativeSource FindAncestor, 
                                    AncestorType={x:Type local:StressEvaluationSTRControl}}}"
                             Stroke="White"/>
                                <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:StressEvaluationSTRControl}}}">
                                    <ContentPresenter.Resources>
                                        <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                            <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                        </DataTemplate>
                                    </ContentPresenter.Resources>
                                </ContentPresenter>
                            </Grid>
                        </Viewbox>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:StressEvaluationSTRViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:StressEvaluationSTRViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:StressEvaluationSTRViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Styles\BaseStyles.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Converters"
                    xmlns:controls="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Controls">
    <SolidColorBrush x:Key="Default.Background.Dark" Color="#FF49505B" x:Shared="False"/>
    <DataTemplate DataType="{x:Type tests:StartViewModel}">
        <tests:StartView DataContext="{Binding}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type tests:TextInstructionViewModel}">
        <tests:TextInstructionView DataContext="{Binding}"/>
    </DataTemplate>
    <Style TargetType="tests:MessageBoxControl">
        <Style.Resources>
            <converters:StringOrEmptyConverter x:Key="StringOrEmptyConverter"/>
            <SolidColorBrush x:Key="Back" Color="#FF04347F"/>
        </Style.Resources>
        <Setter Property="Background" Value="{DynamicResource Back}"/>
        <Setter Property="FontSize" Value="45"/>
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="Opacity" Value="0.0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="tests:MessageBoxControl">
                    <ContentControl>
                        <Grid>
                            <Rectangle
                                    RadiusX="20"
                                    RadiusY="20"
                                    Fill="{TemplateBinding Background}"/>
                            <TextBlock 
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Center"
                                    TextAlignment="Center"
                                    Padding="20"
                                    Text="{Binding Message,
                                    RelativeSource={RelativeSource FindAncestor,
                                    AncestorType={x:Type tests:MessageBoxControl}}}"/>
                        </Grid>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding MessageT, Converter={StaticResource StringOrEmptyConverter}, RelativeSource={RelativeSource Self}}" Value="true">
                            <Setter Property="Opacity" Value="0.0"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding MessageT, Converter={StaticResource StringOrEmptyConverter}, RelativeSource={RelativeSource Self}}" Value="false">
                            <Setter Property="Opacity" Value="1"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Storyboard x:Key="motionBlur" x:Shared="false">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="border">
            <EasingDoubleKeyFrame KeyTime="0" Value="0.75"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1">
                <EasingDoubleKeyFrame.EasingFunction>
                    <ElasticEase EasingMode="EaseInOut"/>
                </EasingDoubleKeyFrame.EasingFunction>
            </EasingDoubleKeyFrame>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="border">
            <EasingDoubleKeyFrame KeyTime="0" Value="0.75"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1">
                <EasingDoubleKeyFrame.EasingFunction>
                    <ElasticEase EasingMode="EaseInOut"/>
                </EasingDoubleKeyFrame.EasingFunction>
            </EasingDoubleKeyFrame>
        </DoubleAnimationUsingKeyFrames>
       
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border1">
            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="borderBlurred">
            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Effect).(BlurEffect.Radius)" Storyboard.TargetName="borderBlurred">
            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="5"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="10"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>

    <DataTemplate DataType="{x:Type tests:ContinueViewModel}" x:Shared="false">
        <DataTemplate.Resources>
            <Style x:Key="FocusVisual">
                <Setter Property="Control.Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <SolidColorBrush x:Key="strokeRectangle" Color="#FFA5BADB"/>
            <SolidColorBrush x:Key="Button.Static.Background" Color="#00000000"/>
            <SolidColorBrush x:Key="Button.Default.Text.Foreground" Color="White"/>
            <SolidColorBrush x:Key="Button.MouseOver.Text.Foreground" Color="#FFFFAE00"/>
            <SolidColorBrush x:Key="Button.Pressed.Text.Foreground" Color="#FF35D2E2"/>
            <Style x:Key="SubmenuButtonStyle" TargetType="{x:Type controls:SubMenuButton}">
                <Style.Resources>
                    <Style TargetType="Rectangle">
                        <Setter Property="Height" Value="20"/>
                        <Setter Property="Width" Value="20" />
                        <Setter Property="Margin" Value="5" />
                        <Setter Property="RadiusX" Value="5" />
                        <Setter Property="RadiusY" Value="5" />
                    </Style>
                </Style.Resources>
                <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
                <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>
                <Setter Property="Foreground" Value="{StaticResource Button.Default.Text.Foreground}"/>
                <Setter Property="FontSize" Value="32" />
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="FontFamily" Value="Segoe Print" />
                <Setter Property="Margin" Value="10,5,5,5" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type controls:SubMenuButton}">
                            <Border x:Name="border" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                                <StackPanel Focusable="False" Orientation="Horizontal"
                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                  Margin="{TemplateBinding Padding}"
                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                    <Rectangle Fill="{TemplateBinding RectangleFill}" Stroke="{StaticResource strokeRectangle}"/>
                                    <TextBlock x:Name="tbxDescription" Grid.Column="1" Text="{TemplateBinding Description}"/>
                                </StackPanel>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter TargetName="tbxDescription" Property="Foreground" Value="{StaticResource Button.MouseOver.Text.Foreground}"/>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter TargetName="tbxDescription" Property="Foreground" Value="{StaticResource Button.Pressed.Text.Foreground}"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

        </DataTemplate.Resources>
        <Grid>
            <Border x:Name="borderBlurred" Opacity="0">
                <Border.Background>
                    <VisualBrush Visual="{Binding ElementForScreen}"/>
                </Border.Background>
                <Border.Effect>
                    <BlurEffect Radius="0"/>
                </Border.Effect>
            </Border>
            <Border x:Name="border1" Opacity="0">
                <Border x:Name="border" Height="285" Width="400" CornerRadius="20" Background="#9F101929" RenderTransformOrigin="0.5,0.5">
                    <Border.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="1" ScaleY="1"/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </Border.RenderTransform>
                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center" >
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <controls:SubMenuButton Grid.Row="1" Description="Повторить" RectangleFill="Orange" Style="{DynamicResource SubmenuButtonStyle}" Command="{Binding RestartLearning_Command}"/>
                        <controls:SubMenuButton Grid.Row="2" Description="Текст инструкции" RectangleFill="Black" Style="{DynamicResource SubmenuButtonStyle}" Command="{Binding TextInstruction_Command}"/>
                        <controls:SubMenuButton Description="Тестирование" RectangleFill="Red" Style="{DynamicResource SubmenuButtonStyle}" Command="{Binding StartMain_Command}"/>
                        <controls:SubMenuButton Description="Демо инструкции" Grid.Row="3" RectangleFill="Green" Style="{DynamicResource SubmenuButtonStyle}" Command="{Binding Preview_Command}"/>
                    </Grid>
                </Border>
                <Border.Triggers>
                    <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                        <BeginStoryboard x:Name="moutionBlurStart" Storyboard="{StaticResource motionBlur}"/>
                    </EventTrigger>
                </Border.Triggers>
            </Border>
        </Grid>
    </DataTemplate>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\Cell.cs


using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention
{
    public class Cell : NotifyViewModelBase
    {
        private Brush _color;
        public Brush Color
        {
            get { return _color; }
            set
            {
                _color = value;
                OnPropertyChanged();
            }
        }

        private bool _mark;

        public bool Mark
        {
            get { return _mark; }
            set 
            {
                _mark = value;
                OnPropertyChanged();
            }
        }

        private int _number;
        public int Number
        {
            get { return _number; }
            set
            {
                _number = value;
                OnPropertyChanged();
            }
        }
        private MatrixCellData _cellData;
        public MatrixCellData CellData
        {
            get { return _cellData; }
            private set
            {
                _cellData = value;
                Number = _cellData.Number;
                Color = getColor(_cellData.Color);
            }
        }

        private Brush getColor(ColorCell colorCell)
        {
            switch (colorCell)
            {
                case ColorCell.Red:
                    return Brushes.Red;
                case ColorCell.Black:
                    return Brushes.Black;
            }
            return null;
        }

        public Cell(MatrixCellData cellData)
        {
            CellData = cellData;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\ColorCell.cs


namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention
{
    public enum ColorCell
    {
        Red,
        Black
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\ICalculateStrategy.cs


using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention
{
    public interface ICalculateStrategy
    {
        Dictionary<string, object> Calculate(List<MatrixCellData> _results);
    }

    #region Strategy1
    public class Quest1CalculateResults : ICalculateStrategy
    {
        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            var oldStrategy = new OldStrategiesCalculateResults.CalculateResultsForQ1();
            var results = oldStrategy.Calculate(_results);
            return results;
        }
    }
    #endregion
    #region Strategy2
    public class Quest2CalculateResults : ICalculateStrategy
    {
        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            var oldStrategy = new OldStrategiesCalculateResults.CalculateResultsForQ2();
            var results = oldStrategy.Calculate(_results);
            return results;
        }
    }
    #endregion
    #region Strategy3
    public class Quest3CalculateResults : ICalculateStrategy
    {
        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            var oldStrategy =new OldStrategiesCalculateResults.CalculateResultsForQ3Q4();
            var results =  oldStrategy.Calculate(_results);
            return results;
        }
    }
    #endregion

    public class PairColorNumber
    {
        public PairColorNumber(ColorCell color, int number)
        {
            Color = color;
            Number = number;
        }

        public ColorCell? Color { get; private set; }
        public int? Number { get; private set; }
        public int IndexInResult { get; set; }
    }

    public class PairColorNumberComparer : IEqualityComparer<PairColorNumber>
    {
        public bool Equals(PairColorNumber x, PairColorNumber y)
        {
            if (ReferenceEquals(x, y)) return true;

            return x != null && y != null && x.Color.Equals(y.Color) && x.Number.Equals(y.Number);
        }

        public int GetHashCode(PairColorNumber obj)
        {
            int hashPairNumber = obj.Number == null ? 0 : obj.Number.GetHashCode();

            int hashPairColor = obj.Color.GetHashCode();

            return hashPairNumber ^ hashPairColor;
        }
    }

    public class Block
    {
        public Block(List<PairColorNumber> blockData, int index)
        {
            BlockData = blockData;
            Index = index;
        }

        public List<PairColorNumber> BlockData { get; private set; }
        public int Index { get; private set; }
    }

    public class Context
    {
        private ICalculateStrategy _calculate;
        public Context(ICalculateStrategy calculate)
        {
            _calculate = calculate;
        }

        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            return _calculate.Calculate(_results);
        }
    }

    public interface IFactoryCalculateStrategy
    {
        ICalculateStrategy GetStrategyCalculate(int numberQuest);
    }

    public class FactoryCalculateStrategy : IFactoryCalculateStrategy
    {
        public ICalculateStrategy GetStrategyCalculate(int numberQuest)
        {
            switch (numberQuest)
            {
                case 1:
                    return new Quest1CalculateResults();
                case 2:
                    return new Quest2CalculateResults();
                case 3:
                    return new Quest3CalculateResults();
                case 4:
                    return new Quest3CalculateResults();
                default: return null;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\IEtalon.cs


using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention
{
    public interface IEtalon
    {
        List<MatrixCellData> GetEtalonData(int numberQuest);
    }

    public class Etalon : IEtalon
    {
        public List<MatrixCellData> GetEtalonData(int numberQuest)
        {
            var _etalon = new List<MatrixCellData>();
            int number = 24;
            var blackNumbers = new List<MatrixCellData>();
            var redNumbers = new List<MatrixCellData>();
            int blackIndex = 0;
            int redIndex = 0;
            switch (numberQuest)
            {
                case 1:
                    for (int i = 0; i < 25; i++)
                        _etalon.Add(new MatrixCellData(ColorCell.Black, i + 1, i));
                    return _etalon;
                case 2:
                    for (int i = 0; i < 24; i++)
                    {
                        _etalon.Add(new MatrixCellData(ColorCell.Red, number, i));
                        number = number - 1;
                    }
                    return _etalon;
                case 3:
                    for (int i = 0; i < 25; i++)
                        blackNumbers.Add(new MatrixCellData(ColorCell.Black, i + 1, i));
                    for (int i = 0; i < 24; i++)
                    {
                        redNumbers.Add(new MatrixCellData(ColorCell.Red, number, i));
                        number = number - 1;
                    }

                    for (int i = 0; i < 49; i++)
                    {
                        if ((i + 1) % 2 == 0)
                        {
                            _etalon.Add(redNumbers[redIndex]);
                            redIndex++;
                        }
                        else
                        {
                            _etalon.Add(blackNumbers[blackIndex]);
                            blackIndex++;
                        }
                    }
                    return _etalon;
                case 4:
                    for (int i = 0; i < 25; i++)
                        blackNumbers.Add(new MatrixCellData(ColorCell.Black, i + 1, i));
                    for (int i = 0; i < 24; i++)
                    {
                        redNumbers.Add(new MatrixCellData(ColorCell.Red, number, i));
                        number = number - 1;
                    }
                    for (int i = 0; i < 49; i++)
                    {
                        if ((i + 1) % 2 == 0)
                        {
                            _etalon.Add(redNumbers[redIndex]);
                            redIndex++;
                        }
                        else
                        {
                            _etalon.Add(blackNumbers[blackIndex]);
                            blackIndex++;
                        }
                    }
                    return _etalon;
                default: return null;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\MatrixCellData.cs


namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention
{
    public class MatrixCellData
    {
        public ColorCell Color { get; private set; }
        public int Number { get; private set; }
        public int Index { get; private set; }
        public MatrixCellData(ColorCell color, int number, int index)
        {
            Index = index;
            Color = color;
            Number = number;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\PlaySoundsNumbers.cs


using System;
using System.Collections.Generic;
using System.IO;
using System.Media;
using System.Windows;
using System.Windows.Threading;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention
{
    public class PlayerSoundsNumbers
    {
        private readonly List<int> numbersSoundsBlack =
            new List<int>()
            {
                1, 2, 3, 4, 5,
                6, 7, 8, 9, 10,
                11, 12, 13, 14, 15,
                16, 17, 18, 19, 20,
                21, 22, 23, 24, 25
            };

        private readonly List<int> numbersSoundsRed =
            new List<int>()
            {
                1, 2, 3, 4, 5,
                6, 7, 8, 9, 10,
                11, 12, 13, 14, 15,
                16, 17, 18, 19, 20,
                21, 22, 23, 24
            };

        private SoundPlayer _player;
        DispatcherTimer _timerBetweenSounds = new DispatcherTimer();
        DispatcherTimer _timerToRedBlackSounds = new DispatcherTimer();//таймер перехода от звука числа к звуку красное/черное (для удобства и только)
        TimeSpan _intervanBetweenRedBlack;
        TimeSpan _intervanBetweenBlackRed;
        public PlayerSoundsNumbers(TimeSpan intervanBetweenBlackRed, TimeSpan intervanBetweenRedBlack)
        {
            _intervanBetweenBlackRed = intervanBetweenBlackRed;
            _intervanBetweenRedBlack = intervanBetweenRedBlack;
            _player = new SoundPlayer();
            _timerBetweenSounds.Tick += _timerBetweenSounds_Tick;
            _timerToRedBlackSounds.Interval = TimeSpan.FromSeconds(2.0);
            _timerToRedBlackSounds.Tick += _timerToRedBlackSounds_Tick;
        }

        public void Start()
        {
            _timerBetweenSounds.Interval = _intervanBetweenBlackRed;
            _timerBetweenSounds.Start();
        }

        public void Stop()
        {
            _timerBetweenSounds.Tick -= _timerBetweenSounds_Tick;
            _timerToRedBlackSounds.Tick -= _timerToRedBlackSounds_Tick;
            _timerToRedBlackSounds.Stop();
            _timerBetweenSounds.Stop();
            _player.Stop();
        }

        public void CloseRes()
        {
            _ms?.Dispose();
            _player.Dispose();
        }

        private bool _isRedBlack = false;
        private void _timerBetweenSounds_Tick(object sender, EventArgs e)
        {
            _timerBetweenSounds.Stop();
            if (!_isRedBlack)
                Play(numbersSoundsBlack[Common._rnd.Next(0, numbersSoundsBlack.Count)]);
            else
                Play(numbersSoundsRed[Common._rnd.Next(0, numbersSoundsRed.Count)]);
            _timerToRedBlackSounds.Start();

        }

        private void _timerToRedBlackSounds_Tick(object sender, EventArgs e)
        {
            _timerToRedBlackSounds.Stop();
            if (!_isRedBlack)
            {
                _isRedBlack = true;
                _timerBetweenSounds.Interval = _intervanBetweenRedBlack;
            }
            else
            {
                _isRedBlack = false;
                _timerBetweenSounds.Interval = _intervanBetweenBlackRed;
            }
            Play(GetPathColorSounds(!_isRedBlack));
            _timerBetweenSounds.Start();

        }

        private MemoryStream _ms;
        private void Play(Uri path)
        {
            _ms?.Dispose();
            var byteArray =
             SoundResources.GetSoundArray(path.OriginalString);
            _ms = new MemoryStream(byteArray);
            _player.Stream = _ms;

            _player.Play();
        }

        private void Play(int numberSound)
        {
            _ms?.Dispose();
            var byteArray =
             SoundResources.GetSoundArray(GetPathNumberSound(numberSound).OriginalString);
            _ms = new MemoryStream(byteArray);
            _player.Stream = _ms;

            _player.Play();
        }

        private Uri GetPathColorSounds(bool _isBlackRed)
        {
            if (!_isBlackRed)
                return new Uri($@"pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/black.wav");
            else
                return new Uri($@"pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/red.wav");
        }

        private Uri GetPathNumberSound(int numberSound)
        {
            return new Uri($@"pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/{numberSound}.wav");
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\SwitchAttentionQuest.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention
{
    public class SwitchAttentionQuest : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        private TimeSpan timeQuest = TimeSpan.FromSeconds(90);
        double HeigthWidthCell = 50;
        private int questNumber;

        private List<MatrixCellData> _results = new List<MatrixCellData>();
        private DateTime _startTime;
        private bool timeOut = false;
        List<Cell> _cells = new List<Cell>();
        private PlayerSoundsNumbers _player = null;

        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public TimeSpan? IntervalBetweenBlackRed { get; set; } = null;
        public TimeSpan? IntervalBetweenRedBlack { get; set; } = null;
        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }
        private int aimNumberForActivatingSounds = 6;
        DispatcherTimer _timer = new DispatcherTimer();
        private List<MatrixCellData> _etalonData;
        private bool _isInitialized = false;

        public SwitchAttentionQuest(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
            {
                generateScene();
                TestMethods.Add("NumbersTask1", () => NumbersTask1());
                TestMethods.Add("NumbersTask2", () => NumbersTask2());
                TestMethods.Add("NumbersTask3_4", () => NumbersTask3_4());
                TestMethods.Add("instruction_Tick_250ms", () => instruction_Tick_250ms());
            }
        }

        private List<Cell> orderedNumbers;
        private int indexONumbers = 0;
       
        private void NumbersTask1()
        {
            indexONumbers = 0;
            orderedNumbers = _cells.Where(f => f.CellData.Color == ColorCell.Black).OrderBy(o => o.CellData.Number).ToList();
        }

        private void NumbersTask2()
        {
            indexONumbers = 0;
            orderedNumbers = _cells.Where(f => f.CellData.Color == ColorCell.Red).OrderByDescending(o => o.CellData.Number).ToList();
        }

        private void NumbersTask3_4()
        {
            indexONumbers = 0;
            var newOrderedNumbers = new List<Cell>();
            var blackOrderedAscending = _cells.Where(f => f.CellData.Color == ColorCell.Black).OrderBy(o => o.CellData.Number).ToList();
            var redOrderedAscending = _cells.Where(f => f.CellData.Color == ColorCell.Red).OrderByDescending(o => o.CellData.Number).ToList();
            for (int i = 0; i < redOrderedAscending.Count; i++)
            {
                newOrderedNumbers.Add(blackOrderedAscending[i]);
                newOrderedNumbers.Add(redOrderedAscending[i]);
            }
            newOrderedNumbers.Add(blackOrderedAscending[24]);
            orderedNumbers = newOrderedNumbers;
        }

        private void instruction_Tick_250ms()
        {
            if (indexONumbers < orderedNumbers.Count)
            {
                orderedNumbers[indexONumbers].Mark = true;
                indexONumbers++;
            }
        }

        private void Initialize()
        {
            if (!_isInitialized)
            {
                _timer.Interval = timeQuest;
                _timer.Tick += _timer_Tick;
                _isInitialized = true;
            }
        }
        public void Start(int questNumber)
        {
            if (questNumber == 4)
                aimNumberForActivatingSounds = Common._rnd.Next(6, 9);
            Clear();
            this.questNumber = questNumber;
            generateScene();
            IEtalon etalon = new Etalon();
            if (questNumber == 1 || questNumber == 2)
            {
                Initialize();
                _timer.Start();
            }
            _etalonData = etalon.GetEtalonData(questNumber);
            _startTime = DateTime.Now;
        }

        public void Stop()
        {
            if (_player != null)
                _player.Stop();
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
        }

        public void CloseRes()
        {
            if (_player != null)
                _player.CloseRes();
        }

        private void Clear()
        {
            timeOut = false;
            _cells = new List<Cell>();
            _player = null;
            _results = new List<MatrixCellData>();
        }
      
        private void _timer_Tick(object sender, EventArgs e)
        {
            timeOut = true;
            ReturnResults();
        }

        private void generateScene()
        {
            List<MatrixCellData> matrixCellDatas = new List<MatrixCellData>();
            for (int i = 0; i < 25; i++)
                matrixCellDatas.Add(new MatrixCellData(ColorCell.Black, i + 1, i));
            int even = 0;
            for (int i = 0; i < 24; i++)
            {
                even = even + 1;
                matrixCellDatas.Add(new MatrixCellData(ColorCell.Red, even, i));
            }

            Common.Shuffle(matrixCellDatas);
            int index = 0;
            var canvas = new Canvas();
            canvas.Height = canvas.Width = HeigthWidthCell * 7;
            for (int i = 0; i < 7; i++)
                for (int j = 0; j < 7; j++)
                {
                    var cell = new Cell(matrixCellDatas[index]);
                    cell.Height = cell.Width = HeigthWidthCell;
                    index++;
                    cell.SetValue(Canvas.LeftProperty, HeigthWidthCell * j);
                    cell.SetValue(Canvas.TopProperty, HeigthWidthCell * i);
                    _cells.Add(cell);
                    canvas.Children.Add(cell);
                }
            Canva = canvas;
            foreach (var cell in _cells)
                cell.MouseDown += Cell_MouseDown;
        }

        private List<TimeSpan> intervalsBetweenPressedForQuest3 = new List<TimeSpan>();
        private DateTime? _timeStartIntervalPressed = null;
        private void Cell_MouseDown(object sender, MouseButtonEventArgs e)
        {
            var cellData = (sender as Cell).CellData;

            if (_results.Count != 0 && _etalonData.Last().Number == cellData.Number &&
             _etalonData.Last().Color == cellData.Color &&
             _results.Last().Color == cellData.Color &&
             _results.Last().Number == cellData.Number)
            {
                ReturnResults();
            }
            else if (_results.Count != 0 && _etalonData[_etalonData.Count - 2].Number == _results.Last().Number &&
                _etalonData[_etalonData.Count - 2].Color == _results.Last().Color &&
                _etalonData.Last().Number == cellData.Number &&
             _etalonData.Last().Color == cellData.Color)
            {
                _results.Add(cellData);
                ReturnResults();
            }
            else
            {
                
                if (questNumber == 4 && cellData.Number == aimNumberForActivatingSounds && cellData.Color == ColorCell.Black && _player == null)
                {
                    if (IntervalBetweenBlackRed != null && IntervalBetweenRedBlack != null)
                    {
                        _player = new PlayerSoundsNumbers(IntervalBetweenBlackRed.Value, IntervalBetweenRedBlack.Value);
                        _player.Start();
                    }
                }
                _results.Add(cellData);

                if (questNumber == 3)
                {
                    if (intervalsBetweenPressedForQuest3.Count == 0)
                    {
                        var time = DateTime.Now - _startTime;
                        intervalsBetweenPressedForQuest3.Add(time);
                        _timeStartIntervalPressed = DateTime.Now;
                    }
                    else
                    {
                        var time = DateTime.Now - _timeStartIntervalPressed;
                        intervalsBetweenPressedForQuest3.Add(time.Value);
                        _timeStartIntervalPressed = DateTime.Now;
                    }
                }
            }
        }
        
        private void ReturnResults()
        {
            if (questNumber == 4 && _player != null)
                _player.Stop();
            var time = DateTime.Now - _startTime;
            _timer.Stop();
            IFactoryCalculateStrategy factoryStrategy = new FactoryCalculateStrategy();
            ICalculateStrategy calculateStrategy = factoryStrategy.GetStrategyCalculate(questNumber);
            var calculateContext = new Context(calculateStrategy);

            var registeredResults = calculateContext.Calculate(_results);
            registeredResults.Add("Время теста", time);
            if (timeOut && (questNumber == 1 || questNumber == 2))
                registeredResults.Add("Время истекло", true);
            if (questNumber == 3)
                registeredResults.Add("Интервал между нажатиями", 2000.0);
            //registeredResults.Add("Интервал между нажатиями",intervalsBetweenPressedForQuest3.Count > 1? intervalsBetweenPressedForQuest3.Average(a => a.TotalMilliseconds) : 400.0);
            Results?.Invoke(this, registeredResults);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\SwitchAttentionViewModel.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention
{
    public class SwitchAttentionViewModel : TestBase
    {
        private int _numberInstruction;
        public int NumberInstruction
        {
            get { return _numberInstruction; }
            set
            {
                _numberInstruction = value;
                OnPropertyChanged();
            }
        }

        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (string.IsNullOrEmpty(_message))
                    IsMessageBoxVisible = false;
                else
                    IsMessageBoxVisible = true;
                OnPropertyChanged();
            }
        }

        private bool _isMessageBoxVisible;
        public bool IsMessageBoxVisible
        {
            get { return _isMessageBoxVisible; }
            set
            {
                _isMessageBoxVisible = value;
                OnPropertyChanged();
            }
        }

        public override event EventHandler<Results> Results;
        DispatcherTimer _timer = new DispatcherTimer();
        private SwitchAttentionQuest control;
        public SwitchAttentionViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            Manager.TraningTime = Common.GetSeconds(40);
            SetInstructions("SwitchAttention1_1", 1);
            NumberInstruction = 1;
        }
        public override FrameworkElement GetTestControl()
        {
            return new SwitchAttentionQuest(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new SwitchAttentionQuest(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            control = new SwitchAttentionQuest();
            TestCurrentView = control;
            control.Start(1);
        }

        public override void ToDefault()
        {
            base.ToDefault();
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }
        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        public override void Start()
        {
            control = new SwitchAttentionQuest();
            control.Results += Control_Results;
            _timer.Interval = TimeSpan.FromSeconds(5);
            _timer.Tick += _timer_Tick;
            control.Start(NumberInstruction);
            if (NumberInstruction == 4)
            {
                control.IntervalBetweenBlackRed = _intervarForTask4;
                control.IntervalBetweenRedBlack = _intervarForTask4;
            }
            TestCurrentView = control;
        }

        private TimeSpan _intervarForTask4;

        private Dictionary<string, Dictionary<string, object>> QuestResult = new Dictionary<string, Dictionary<string, object>>();
        private bool _isRepeatUsedQ1 = false;
        private bool _isRepeatUsedQ2 = false;
        private bool _isRepeatUsedQ3 = false;
        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            switch (NumberInstruction)
            {
                case 1:
                    if (Convert.ToInt32(e["Ошибки"]) > 3 && !_isRepeatUsedQ1)
                    {
                        QuestResult.Add($"Задание {NumberInstruction}", e);
                        Message = "Много ошибок! Тест будет перезапущен через 5 секунд";
                        _isRepeatUsedQ1 = true;
                        NumberInstruction = 1;
                        RepeatStart();
                    }
                    else
                    {
                        if (_isRepeatUsedQ1)
                            QuestResult.Add($"Задание_повторное {NumberInstruction}", e);
                        else
                            QuestResult.Add($"Задание {NumberInstruction}", e);
                        NumberInstruction = 2;
                        ToInstruction();
                    }
                    break;
                case 2:
                    if (Convert.ToInt32(e["Ошибки"]) > 3 && !_isRepeatUsedQ2)
                    {
                        QuestResult.Add($"Задание {NumberInstruction}", e);
                        Message = "Много ошибок! Тест будет перезапущен через 5 секунд";
                        _isRepeatUsedQ2 = true;
                        NumberInstruction = 2;
                        RepeatStart();
                    }
                    else
                    {
                        if (_isRepeatUsedQ2)
                            QuestResult.Add($"Задание_повторное {NumberInstruction}", e);
                        else
                            QuestResult.Add($"Задание {NumberInstruction}", e);
                        NumberInstruction = 3;
                        ToInstruction();
                    }
                    break;
                case 3:
                    if (Convert.ToInt32(e["Ошибки"]) > 3 && !_isRepeatUsedQ3)
                    {
                        QuestResult.Add($"Задание {NumberInstruction}", e);
                        Message = "Много ошибок! Тест будет перезапущен через 5 секунд";
                        _isRepeatUsedQ3 = true;
                        NumberInstruction = 3;
                        RepeatStart();
                    }
                    else
                    {
                        if (_isRepeatUsedQ3)
                            QuestResult.Add($"Задание_повторное {NumberInstruction}", e);
                        else
                            QuestResult.Add($"Задание {NumberInstruction}", e);
                        TimeSpan interval;
                        if (!_isRepeatUsedQ3)
                            interval = TimeSpan.FromMilliseconds(Convert.ToDouble(QuestResult["Задание 3"]["Интервал между нажатиями"]));
                        else
                            interval = TimeSpan.FromMilliseconds(Convert.ToDouble(QuestResult["Задание_повторное 3"]["Интервал между нажатиями"]));
                        _intervarForTask4 = interval;
                        NumberInstruction = 4;
                        ToInstruction();
                    }
                    break;
                case 4:
                    QuestResult.Add($"Задание {NumberInstruction}", e);

                    var res1 = QuestResult.Keys.FirstOrDefault(f => f == "Задание_повторное 1") != null ?
                        QuestResult["Задание_повторное 1"] : QuestResult["Задание 1"];

                    var res2 = QuestResult.Keys.FirstOrDefault(f => f == "Задание_повторное 2") != null ?
                        QuestResult["Задание_повторное 2"] : QuestResult["Задание 2"];

                    var res3 = QuestResult.Keys.FirstOrDefault(f => f == "Задание_повторное 3") != null ?
                        QuestResult["Задание_повторное 3"] : QuestResult["Задание 3"];
                    var res4 = QuestResult["Задание 4"];

                    var res1Repeat = QuestResult.Keys.FirstOrDefault(f => f == "Задание_повторное 1") != null ?
                        QuestResult["Задание_повторное 1"] : new Dictionary<string, object>() { ["Ряд"] = new List<MatrixCellData>() };
                    var res2Repeat = QuestResult.Keys.FirstOrDefault(f => f == "Задание_повторное 2") != null ?
                        QuestResult["Задание_повторное 2"] : new Dictionary<string, object>() { ["Ряд"] = new List<MatrixCellData>() };
                    var res3Repeat = QuestResult.Keys.FirstOrDefault(f => f == "Задание_повторное 3") != null ?
                        QuestResult["Задание_повторное 3"] : new Dictionary<string, object>() { ["Ряд"] = new List<MatrixCellData>() };

                    var time1 = TimeSpan.Parse(res1["Время теста"].ToString());
                    var time2 = TimeSpan.Parse(res2["Время теста"].ToString());
                    var time3 = TimeSpan.Parse(res3["Время теста"].ToString());
                    var time4 = TimeSpan.Parse(res4["Время теста"].ToString());

                    var errors1 = Convert.ToInt32(res1["Ошибки"]);
                    var errors2 = Convert.ToInt32(res2["Ошибки"]);
                    var errors3 = Convert.ToInt32(res3["Ошибки"]);
                    var errors4 = Convert.ToInt32(res4["Ошибки"]);

                    var series1 = (List<MatrixCellData>)QuestResult["Задание 1"]["Ряд"];
                    var series2 = (List<MatrixCellData>)QuestResult["Задание 2"]["Ряд"];
                    var series3 = (List<MatrixCellData>)QuestResult["Задание 3"]["Ряд"];
                    var series4 = (List<MatrixCellData>)QuestResult["Задание 4"]["Ряд"];
                    var series1Repeat = (List<MatrixCellData>)res1Repeat["Ряд"];
                    var series2Repeat = (List<MatrixCellData>)res2Repeat["Ряд"];
                    var series3Repeat = (List<MatrixCellData>)res3Repeat["Ряд"];

                    var timeSwitchAttention = time3 - (time1 + time2);

                    var noiseImmunity = time4 - time3;

                    var res = new Dictionary<string, object>()
                    {
                        ["Время выполнения 1-го задания"] = (float)time1.TotalSeconds,
                        ["Время выполнения 2-го задания"] = (float)time2.TotalSeconds,
                        ["Время выполнения 3-го задания"] = (float)time3.TotalSeconds,
                        ["Время выполнения 4-го задания"] = (float)time4.TotalSeconds,
                        ["Количество ошибок в 1 задании"] = errors1,
                        ["Количество ошибок вo 2 задании"] = errors2,
                        ["Количество ошибок в 3 задании"] = errors3,
                        ["Количество ошибок в 4 задании"] = errors4,
                        ["Время переключения внимания"] = (float)timeSwitchAttention.TotalSeconds,
                        ["Помехоустойчивость"] = (float)noiseImmunity.TotalSeconds,
                        ["Разница числа ошибок в 4-ом и 3-ем заданиях"] = errors4 - errors3,
                        ["Нажатые числа в 1-ом задании"] = GetConvertedToStringSeries(series1),
                        ["Нажатые числа во 2-ом задании"] = GetConvertedToStringSeries(series2),
                        ["Нажатые числа в 3-ом задании"] = GetConvertedToStringSeries(series3),
                        ["Нажатые числа в 4-ом задании"] = GetConvertedToStringSeries(series4),
                        ["Нажатые числа в 1-ом повторном задании"] = GetConvertedToStringSeries(series1Repeat),
                        ["Нажатые числа в 2-ом повторном задании"] = GetConvertedToStringSeries(series2Repeat),
                        ["Нажатые числа в 3-ом повторном задании"] = GetConvertedToStringSeries(series3Repeat)
                    };

                    Results?.Invoke(this, new Results(res));
                    if (control != null)
                        control.CloseRes();
                    break;
            }
        }

        private void RepeatStart()
        {
            control.Results -= Control_Results;
            control.Stop();
            _timer.Start();
        }

        private void ToInstruction()
        {
            Stop();
            SetInstructions($"SwitchAttention1_{NumberInstruction}", NumberInstruction, true);
            Manager.ToInstruction();
        }

        private string GetStringColor(ColorCell color)
        {
            switch (color)
            {
                case ColorCell.Red:
                    return "Красное";
                case ColorCell.Black:
                    return "Черное";
            }
            return "";
        }

        private string GetConvertedToStringSeries(List<MatrixCellData> series)
        {
            string s = "";
            foreach (var value in series)
                s = s + $"{value.Number} {GetStringColor(value.Color)} ";
            return s;
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
            Start(); 
        }

        public override void Stop()
        {
            base.Stop();
            if (control != null)
            {
                control.Results -= Control_Results;
                control.Stop();
                control.CloseRes();
            }
            if (_timer != null)
            {
                _timer.Tick -= _timer_Tick;
                _timer.Stop();
            }
        }
    }
}


*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.SwitchAttention"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    <Style TargetType="local:Cell">
        <Setter Property="Background" Value="#00000000"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Cell">
                    <Border x:Name="border" Background="WhiteSmoke" BorderBrush="Black" BorderThickness="0.3">
                        <TextBlock x:Name="tbx" IsHitTestVisible="False" HorizontalAlignment="Center" VerticalAlignment="Center"
                                   FontWeight="DemiBold"
                                       Foreground="{Binding Color, RelativeSource={RelativeSource FindAncestor,
                                AncestorType={x:Type local:Cell}}}"
                                       Text="{Binding Number, RelativeSource={RelativeSource FindAncestor,
                                AncestorType={x:Type local:Cell}}}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Mark, RelativeSource={RelativeSource Self}}" Value="true">
                            <Setter TargetName="border" Property="Background" Value="LightGreen"/>
                        </DataTrigger>
                        <EventTrigger RoutedEvent="MouseDown">
                            <EventTrigger.Actions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="border">
                                            <EasingColorKeyFrame KeyTime="0:0:0" Value="WhiteSmoke"/>
                                            <EasingColorKeyFrame KeyTime="0:0:0.2" Value="LightGreen"/>
                                            <EasingColorKeyFrame KeyTime="0:0:0.5" Value="WhiteSmoke"/>
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:SwitchAttentionQuest">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SwitchAttentionQuest">
                    <Border Background="{TemplateBinding Background}">
                        <Viewbox>
                            <Grid Width="1920"
                                  Height="1080">
                                <Viewbox Height="800" Width="800">
                                    <ContentControl FontSize="24" Content="{Binding Canva, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:SwitchAttentionQuest}}}"/>
                                </Viewbox>
                                <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:SwitchAttentionQuest}}}">
                                    <ContentPresenter.Resources>
                                        <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                            <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                        </DataTemplate>
                                    </ContentPresenter.Resources>
                                </ContentPresenter>
                            </Grid>
                        </Viewbox>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:SwitchAttentionViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SwitchAttentionViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <Border Visibility="{Binding IsMessageBoxVisible, 
                                                         RelativeSource={RelativeSource FindAncestor,
                                                         AncestorType={x:Type local:SwitchAttentionViewModel}},
                                                         Converter={StaticResource BooleanToVisibilityConverter}}" Background="#7F000000">
                                <tests:MessageBoxControl Message="{Binding Message,
                                                         RelativeSource={RelativeSource FindAncestor,
                                                         AncestorType={x:Type local:SwitchAttentionViewModel}}}"/>
                            </Border>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:SwitchAttentionViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\NewStrategiesCalculateResults\CalculateResultsForQ1.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention.NewStrategiesCalculateResults
{
    class CalculateResultsForQ1
    {
        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            List<PairColorNumber> etalonBlack = new List<PairColorNumber>()
            {
                new PairColorNumber(ColorCell.Black,1),
                new PairColorNumber(ColorCell.Black,2),
                new PairColorNumber(ColorCell.Black,3),
                new PairColorNumber(ColorCell.Black,4),
                new PairColorNumber(ColorCell.Black,5),
                new PairColorNumber(ColorCell.Black,6),
                new PairColorNumber(ColorCell.Black,7),
                new PairColorNumber(ColorCell.Black,8),
                new PairColorNumber(ColorCell.Black,9),
                new PairColorNumber(ColorCell.Black,10),
                new PairColorNumber(ColorCell.Black,11),
                new PairColorNumber(ColorCell.Black,12),
                new PairColorNumber(ColorCell.Black,13),
                new PairColorNumber(ColorCell.Black,14),
                new PairColorNumber(ColorCell.Black,15),
                new PairColorNumber(ColorCell.Black,16),
                new PairColorNumber(ColorCell.Black,17),
                new PairColorNumber(ColorCell.Black,18),
                new PairColorNumber(ColorCell.Black,19),
                new PairColorNumber(ColorCell.Black,20),
                new PairColorNumber(ColorCell.Black,21),
                new PairColorNumber(ColorCell.Black,22),
                new PairColorNumber(ColorCell.Black,23),
                new PairColorNumber(ColorCell.Black,24),
                new PairColorNumber(ColorCell.Black,25)
            };
            List<Block> blocks = new List<Block>();
            int blockIndex = 0;
            var block = new Block(new List<PairColorNumber>(), blockIndex);
            blocks.Add(block);
            for (int i = 0; i < _results.Count; i++)
            {
                if (block.BlockData.Count > 0)
                {
                    if (_results[i].Color == ColorCell.Black)
                    {
                        if (block.BlockData.Last().Number + 1 == _results[i].Number)
                        {
                            block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                        }
                        else
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                            blocks.Add(block);
                        }
                    }
                    else
                    {
                        if (block.BlockData.Count != 0)
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            blocks.Add(block);
                        }
                    }
                }
                else if (block.BlockData.Count == 0)
                {
                    if (_results[i].Color == ColorCell.Black)
                    {
                        block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                    }
                    else
                    {
                        if (block.BlockData.Count != 0)
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            blocks.Add(block);
                        }
                    }
                }
            }

            blocks = blocks.Where(b => b.BlockData.Count > 0).ToList();

            var checkZeroBlockData = blocks.Any(a => a.BlockData.Count == 0);

            var sorted = !checkZeroBlockData ? blocks.OrderBy(o => o.BlockData.First().Number) : new List<Block>().AsEnumerable();//сортируем по первому элементу блока по возрастанию

            var startBlocks = sorted.Where(f => f.BlockData.First().Number == sorted.First().BlockData.First().Number);//выборка стартовых блоков

            var listChains = new List<List<Block>>();//список возможных цепочек

            foreach (var startBlock in startBlocks)
            {
                var chain = new List<Block>();
                chain.Add(startBlock);
                while (true)
                {
                    Block bcur = null;
                    for (int i = 0; i < sorted.Count(); i++)
                    {
                        if (bcur == null)
                        {
                            var findBlock = sorted.FirstOrDefault(f => f.BlockData.First().Number >= chain.Last().BlockData.Last().Number && !chain.Any(a => a.Index == f.Index));
                            if (findBlock != null)
                                bcur = findBlock;
                            else break;
                        }
                        else
                        {
                            var findBlock = sorted.FirstOrDefault(f => f.BlockData.First().Number >= chain.Last().BlockData.Last().Number && !chain.Any(a => a.Index == f.Index));
                            if (findBlock != null && findBlock != bcur)
                                bcur = findBlock;
                            else break;
                        }
                    }
                    if (bcur != null)
                        chain.Add(bcur);
                    else
                        break;
                    bcur = null;
                }
                listChains.Add(chain);
            }

            int countErrors = 0;
            var errorsChains = new List<int>();
            foreach (var chain in listChains)
            {
                int errorsChain = 0;
                for (int i = 0; i < chain.Count; i++)
                {
                    if (i == 0)
                    {
                        var MustBe = etalonBlack.IndexOf(chain.First().BlockData.First()) + 1;
                        var real = blocks.Where(w => w.Index < chain[i].Index).Sum(s => s.BlockData.Count);
                        if (MustBe > real)
                            errorsChain = errorsChain + MustBe;
                        else
                            errorsChain = errorsChain + real;
                    }
                    else
                    {
                        var indexLeft = etalonBlack.IndexOf(chain[i - 1].BlockData.Last()) + 1;
                        var indexRight = etalonBlack.IndexOf(chain[i].BlockData.First()) + 1;
                        var MustBe = indexRight - indexLeft;
                        var indexLeftReal = _results.FindIndex(f => f.Index == chain[i - 1].BlockData.Last().IndexInResult) + 1;
                        var indexRightReal = _results.FindIndex(f => f.Index == chain[i].BlockData.First().IndexInResult) + 1;
                        var real = indexRightReal - indexLeftReal;
                        if (MustBe > real)
                            errorsChain = errorsChain + MustBe;
                        else
                            errorsChain = errorsChain + real;
                    }
                }
                errorsChains.Add(errorsChain);
            }

            if (errorsChains.Count != 0)
                countErrors = errorsChains.Min();

            //ищем пропущенные числа
            var selectedNumbersInResults = _results.Select(s => new PairColorNumber(s.Color, s.Number));
            IEnumerable<PairColorNumber> gapsedNumbers = etalonBlack.Except(selectedNumbersInResults, new PairColorNumberComparer()).Where(w => w.Color == ColorCell.Black);

            countErrors = countErrors + gapsedNumbers.Count();

            var nonBlack = _results.Where(f => f.Color != ColorCell.Black);

            countErrors = countErrors + nonBlack.Count();

            var results = new Dictionary<string, object>() { ["Ряд"] = _results, ["Ошибки"] = countErrors };
            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\NewStrategiesCalculateResults\CalculateResultsForQ2.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention.NewStrategiesCalculateResults
{
    class CalculateResultsForQ2
    {
        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            List<PairColorNumber> etalonRed = new List<PairColorNumber>()
            {
                new PairColorNumber(ColorCell.Red,24),
                new PairColorNumber(ColorCell.Red,23),
                new PairColorNumber(ColorCell.Red,22),
                new PairColorNumber(ColorCell.Red,21),
                new PairColorNumber(ColorCell.Red,20),
                new PairColorNumber(ColorCell.Red,19),
                new PairColorNumber(ColorCell.Red,18),
                new PairColorNumber(ColorCell.Red,17),
                new PairColorNumber(ColorCell.Red,16),
                new PairColorNumber(ColorCell.Red,15),
                new PairColorNumber(ColorCell.Red,14),
                new PairColorNumber(ColorCell.Red,13),
                new PairColorNumber(ColorCell.Red,12),
                new PairColorNumber(ColorCell.Red,11),
                new PairColorNumber(ColorCell.Red,10),
                new PairColorNumber(ColorCell.Red,9),
                new PairColorNumber(ColorCell.Red,8),
                new PairColorNumber(ColorCell.Red,7),
                new PairColorNumber(ColorCell.Red,6),
                new PairColorNumber(ColorCell.Red,5),
                new PairColorNumber(ColorCell.Red,4),
                new PairColorNumber(ColorCell.Red,3),
                new PairColorNumber(ColorCell.Red,2),
                new PairColorNumber(ColorCell.Red,1)
            };

            List<Block> blocks = new List<Block>();
            int blockIndex = 0;
            var block = new Block(new List<PairColorNumber>(), blockIndex);
            blocks.Add(block);
            for (int i = 0; i < _results.Count; i++)
            {
                if (block.BlockData.Count > 0)
                {
                    if (_results[i].Color == ColorCell.Red)
                    {
                        if (block.BlockData.Last().Number - 1 == _results[i].Number)
                        {
                            block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                        }
                        else
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                            blocks.Add(block);
                        }
                    }
                    else
                    {
                        if (block.BlockData.Count != 0)
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            blocks.Add(block);
                        }
                        //Черный ошибка
                    }
                }
                else if (block.BlockData.Count == 0)
                {
                    if (_results[i].Color == ColorCell.Red)
                    {
                        block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                    }
                    else
                    {
                        if (block.BlockData.Count != 0)
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            blocks.Add(block);
                        }
                        //Черный ошибка
                    }
                }
            }

            blocks = blocks.Where(b => b.BlockData.Count > 0).ToList();

            var checkZeroBlockData = blocks.Any(a => a.BlockData.Count == 0);
            var sorted = !checkZeroBlockData ? blocks.OrderByDescending(o => o.BlockData.First().Number) : new List<Block>().AsEnumerable();//сортируем по первому элементу блока по убыванию

            var startBlocks = sorted.Where(f => f.BlockData.First().Number == sorted.First().BlockData.First().Number);//выборка стартовых блоков

            var listChains = new List<List<Block>>();//список возможных цепочек

            foreach (var startBlock in startBlocks)
            {
                var chain = new List<Block>();
                chain.Add(startBlock);
                while (true)
                {
                    Block bcur = null;
                    for (int i = 0; i < sorted.Count(); i++)
                    {
                        if (bcur == null)
                        {
                            var findBlock = sorted.FirstOrDefault(f => f.BlockData.First().Number < chain.Last().BlockData.Last().Number && !chain.Any(a => a.Index == f.Index));
                            if (findBlock != null)
                                bcur = findBlock;
                            else break;
                        }
                        else
                        {
                            var findBlock = sorted.FirstOrDefault(f => f.BlockData.First().Number > bcur.BlockData.First().Number && !chain.Any(a => a.Index == f.Index));
                            if (findBlock != null)
                                bcur = findBlock;
                            else break;
                        }
                    }
                    if (bcur != null)
                        chain.Add(bcur);
                    else
                        break;
                    bcur = null;
                }
                listChains.Add(chain);
            }

            int countErrors = 0;
            var errorsChains = new List<int>();
            foreach (var chain in listChains)
            {
                int errorsChain = 0;
                for (int i = 0; i < chain.Count; i++)
                {
                    if (i == 0)
                    {
                        var MustBe = etalonRed.IndexOf(chain.First().BlockData.First()) + 1;
                        var real = blocks.Where(w => w.Index < chain[i].Index).Sum(s => s.BlockData.Count);
                        if (MustBe > real)
                            errorsChain = errorsChain + MustBe;
                        else
                            errorsChain = errorsChain + real;
                    }
                    else
                    {
                        var indexLeft = etalonRed.IndexOf(chain[i - 1].BlockData.Last()) + 1;
                        var indexRight = etalonRed.IndexOf(chain[i].BlockData.First()) + 1;
                        var MustBe = indexRight - indexLeft;
                        var indexLeftReal = _results.FindIndex(f => f.Index == chain[i - 1].BlockData.Last().IndexInResult) + 1;
                        var indexRightReal = _results.FindIndex(f => f.Index == chain[i].BlockData.First().IndexInResult) + 1;
                        var real = indexRightReal - indexLeftReal;
                        if (MustBe > real)
                            errorsChain = errorsChain + MustBe;
                        else
                            errorsChain = errorsChain + real;
                    }
                }
                errorsChains.Add(errorsChain);
            }

            if (errorsChains.Count != 0)
                countErrors = errorsChains.Min();

            //ищем пропущенные числа
            var selectedNumbersInResults = _results.Select(s => new PairColorNumber(s.Color, s.Number));
            IEnumerable<PairColorNumber> gapsedNumbers = etalonRed.Except(selectedNumbersInResults, new PairColorNumberComparer()).Where(w => w.Color == ColorCell.Red);

            countErrors = countErrors + gapsedNumbers.Count();

            var nonBlack = _results.Where(f => f.Color != ColorCell.Red);

            countErrors = countErrors + nonBlack.Count();

            var results = new Dictionary<string, object>() { ["Ряд"] = _results, ["Ошибки"] = countErrors };
            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\NewStrategiesCalculateResults\CalculateResultsForQ3Q4.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention.NewStrategiesCalculateResults
{
    class CalculateResultsForQ3Q4
    {
        public List<PairColorNumber> etalonBlackRed = new List<PairColorNumber>()
            {
                new PairColorNumber(ColorCell.Black,1),
                new PairColorNumber(ColorCell.Red,24),
                new PairColorNumber(ColorCell.Black,2),
                 new PairColorNumber(ColorCell.Red,23),
                new PairColorNumber(ColorCell.Black,3),
                 new PairColorNumber(ColorCell.Red,22),
                new PairColorNumber(ColorCell.Black,4),
                 new PairColorNumber(ColorCell.Red,21),
                new PairColorNumber(ColorCell.Black,5),
                 new PairColorNumber(ColorCell.Red,20),
                new PairColorNumber(ColorCell.Black,6),
                 new PairColorNumber(ColorCell.Red,19),
                new PairColorNumber(ColorCell.Black,7),
                 new PairColorNumber(ColorCell.Red,18),
                new PairColorNumber(ColorCell.Black,8),
                 new PairColorNumber(ColorCell.Red,17),
                new PairColorNumber(ColorCell.Black,9),
                 new PairColorNumber(ColorCell.Red,16),
                new PairColorNumber(ColorCell.Black,10),
                 new PairColorNumber(ColorCell.Red,15),
                new PairColorNumber(ColorCell.Black,11),
                 new PairColorNumber(ColorCell.Red,14),
                new PairColorNumber(ColorCell.Black,12),
                 new PairColorNumber(ColorCell.Red,13),
                new PairColorNumber(ColorCell.Black,13),
                 new PairColorNumber(ColorCell.Red,12),
                new PairColorNumber(ColorCell.Black,14),
                 new PairColorNumber(ColorCell.Red,11),
                new PairColorNumber(ColorCell.Black,15),
                 new PairColorNumber(ColorCell.Red,10),
                new PairColorNumber(ColorCell.Black,16),
                 new PairColorNumber(ColorCell.Red,9),
                new PairColorNumber(ColorCell.Black,17),
                 new PairColorNumber(ColorCell.Red,8),
                new PairColorNumber(ColorCell.Black,18),
                 new PairColorNumber(ColorCell.Red,7),
                new PairColorNumber(ColorCell.Black,19),
                 new PairColorNumber(ColorCell.Red,6),
                new PairColorNumber(ColorCell.Black,20),
                 new PairColorNumber(ColorCell.Red,5),
                new PairColorNumber(ColorCell.Black,21),
                 new PairColorNumber(ColorCell.Red,4),
                new PairColorNumber(ColorCell.Black,22),
                 new PairColorNumber(ColorCell.Red,3),
                new PairColorNumber(ColorCell.Black,23),
                 new PairColorNumber(ColorCell.Red,2),
                new PairColorNumber(ColorCell.Black,24),
                 new PairColorNumber(ColorCell.Red,1),
                new PairColorNumber(ColorCell.Black,25)
            };

        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            List<Block> blocks = new List<Block>();
            int blockIndex = 0;
            var block = new Block(new List<PairColorNumber>(), blockIndex);
            blocks.Add(block);
            for (int i = 0; i < _results.Count; i++)
            {
                if (block.BlockData.Count > 0)
                {
                    if (_results[i].Color == ColorCell.Red)
                    {
                        if (block.BlockData.Last().Color == ColorCell.Black)
                        {
                            if (block.BlockData.Last().Number == 25 - _results[i].Number)
                            {
                                block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                            }
                            else
                            {
                                blockIndex++;
                                block = new Block(new List<PairColorNumber>(), blockIndex);
                                block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                                blocks.Add(block);
                            }
                        }
                        else
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                            blocks.Add(block);
                        }
                    }
                    else if (_results[i].Color == ColorCell.Black)
                    {
                        if (block.BlockData.Last().Color == ColorCell.Red)
                        {
                            if (block.BlockData.Last().Number == 25 - _results[i].Number + 1)
                            {
                                block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                            }
                            else
                            {
                                blockIndex++;
                                block = new Block(new List<PairColorNumber>(), blockIndex);
                                block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                                blocks.Add(block);
                            }
                        }
                        else
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                            blocks.Add(block);
                        }
                    }
                }
                else if (block.BlockData.Count == 0)
                {
                    blockIndex++;
                    block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number));
                }
            }


            PairColorNumber pair = null;
            foreach (var curBlock in blocks)
            {
                if (pair == null)
                {
                    if (curBlock.BlockData.Count() != 0)
                        pair = curBlock.BlockData.First();
                }
                else
                {
                    var index = etalonBlackRed.IndexOf(pair);
                    var currentIndex = etalonBlackRed.IndexOf(curBlock.BlockData.First());
                    if (currentIndex < index)
                        pair = curBlock.BlockData.First();
                }
            }

            var startBlocks = pair != null ? blocks.Where(f => f.BlockData.First().Color == pair.Color && f.BlockData.First().Number == pair.Number) : null;//выборка стартовых блоков
            var listChains = new List<List<Block>>();//список возможных цепочек
            var sorted = blocks.OrderBy(f => etalonBlackRed.IndexOf(f.BlockData.First()));

            if (startBlocks != null)
            {
                var exceptedBlocks = sorted.ToList();
                foreach (var startBlock in startBlocks)
                {
                    var chain = new List<Block>();
                    chain.Add(startBlock);
                    while (true)
                    {
                        var rightBlocks = sorted.Where(f => etalonBlackRed.FindIndex(indexLeft => indexLeft.Color == chain.Last().BlockData.Last().Color && indexLeft.Number == chain.Last().BlockData.Last().Number) <
                                                                             etalonBlackRed.FindIndex(indexRight => indexRight.Color == f.BlockData.First().Color && indexRight.Number == f.BlockData.First().Number) &&
                                                                             !chain.Any(a => a.Index == f.Index));
                        Block bCur2 = null;
                        foreach (var value in rightBlocks)
                        {
                            if (bCur2 == null)
                                bCur2 = value;
                            else if (etalonBlackRed.FindIndex(indexLeft => indexLeft.Color == bCur2.BlockData.First().Color && indexLeft.Number == bCur2.BlockData.First().Number) >
                                etalonBlackRed.FindIndex(indexLeft => indexLeft.Color == value.BlockData.First().Color && indexLeft.Number == value.BlockData.First().Number))
                            {
                                bCur2 = value;
                            }
                        }

                        if (bCur2 != null)
                            chain.Add(bCur2);
                        else
                            break;
                        bCur2 = null;
                    }
                    listChains.Add(chain);
                }
            }

            int countErrors = 0;
            var errorsChains = new List<int>();
            foreach (var chain in listChains)
            {
                int errorsChain = 0;
                for (int i = 0; i < chain.Count; i++)
                {
                    if (i == 0)
                    {
                        var MustBe = etalonBlackRed.FindIndex(f => f.Color == chain.First().BlockData.First().Color && f.Number == chain.First().BlockData.First().Number);
                        var real = blocks.Where(w => w.Index < chain[i].Index).Sum(s => s.BlockData.Count);
                        if (MustBe > real)
                            errorsChain = errorsChain + MustBe;
                        else
                            errorsChain = errorsChain + real;
                    }
                    else
                    {
                        var indexLeft = etalonBlackRed.FindIndex(f => f.Color == chain[i - 1].BlockData.Last().Color && f.Number == chain[i - 1].BlockData.Last().Number);
                        var indexRight = etalonBlackRed.FindIndex(f => f.Color == chain[i].BlockData.First().Color && f.Number == chain[i].BlockData.First().Number);
                        var MustBe = indexRight - indexLeft;
                        var indexLeftReal = _results.FindIndex(f => f.Index == chain[i - 1].BlockData.Last().IndexInResult);
                        var indexRightReal = _results.FindIndex(f => f.Index == chain[i].BlockData.First().IndexInResult);
                        var real = indexRightReal - indexLeftReal;
                        if (MustBe > real)
                            errorsChain = errorsChain + MustBe - 1;
                        else
                            errorsChain = errorsChain + real - 1;
                    }
                }
                errorsChains.Add(errorsChain);
            }

            if (errorsChains.Count != 0)
                countErrors = errorsChains.Min();


            var selectedNumbersInResults = _results.Select(s => new PairColorNumber(s.Color, s.Number));

            //ищем одинаковые(повторы)
            var countClone = selectedNumbersInResults.GroupBy(g => new { g.Color, g.Number }).Where(w => w.Count() > 1).Sum(s => s.Count() - 1);

            countErrors = countErrors + countClone;

            var results = new Dictionary<string, object>()
            {
                ["Ряд"] = _results,
                ["Ошибки"] = countErrors
            };
            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\OldStrategiesCalculateResults\BaseClasses.cs


namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention.OldStrategiesCalculateResults
{
    class Number
    {
        public int Num { get; set; }
        public NumberColor Color { get; set; }
    }

    enum NumberColor { Red, Black }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\OldStrategiesCalculateResults\CalculateResultsForQ1.cs


using System;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention.OldStrategiesCalculateResults
{
    class CalculateResultsForQ1
    {
        private List<Block> Roots;
        private List<Block> Blocks;
        private int Mistakes;
        private bool RootBlocksFound;
        private bool EndCount;

        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            int I;
            Mistakes = 24;
            RootBlocksFound = false;
            EndCount = false;
            Roots = new List<Block>();
            Blocks = new List<Block>();

            RowToBlocks(_results);
            if (!EndCount)
            {
                FillLinks();
                for (I = 0; I <= Roots.Count - 1; I++)
                {
                    Recurse(Math.Max(Roots[I].StartNum - 1, Roots[I].StartPos), Roots[I],_results.Count);
                }
            }

            var results = new Dictionary<string, object>() { ["Ряд"] = _results, ["Ошибки"] = Mistakes };
            return results;
        }

        private void Recurse(int S, Block Block, int RowCount)
        {
            int I, M;

            if (Block.Links.Count != 0)
            {
                for (I = 0; I <= Block.Links.Count - 1; I++)
                {
                    M = Block.Links[I].StartPos - Block.EndPos - 1;

                    if (Block.Links[I].StartNum <= (Block.StartNum - Block.StartPos + Block.EndPos))
                    {
                        M = M + Block.StartNum - Block.StartPos + Block.EndPos - Block.Links[I].StartNum + 1;
                    }
                    M = Math.Max(M, Math.Abs(Block.Links[I].StartNum - Block.StartNum - Block.EndPos + Block.StartPos - 1));
                    Recurse(S + M, Block.Links[I],RowCount);
                }
            }
            else
            {
                S = S + Math.Max(RowCount - Block.EndPos - 1, 25 - Block.StartNum - Block.EndPos + Block.StartPos);
                if (S < Mistakes)
                {
                    Mistakes = S;
                }
            }
        }



        private void FillLinks()
        {
            int I, J, K;
            List<Block> Starts = new List<Block>();
            List<Block> Ends = new List<Block>();
            List<Block> Del = new List<Block>();

            for (I = 0; I <= Blocks.Count - 1; I++)
            {
                Ends.Add(Blocks[I]);
            }

            for (I = 1; I <= 25; I++)
            {
                if (!RootBlocksFound)
                {
                    for (J = 0; J <= Ends.Count - 1; J++)
                    {
                        if (I == Ends[J].StartNum)
                        {
                            Roots.Add(Ends[J]);
                            Starts.Add(Ends[J]);
                            Del.Add(Ends[J]);
                            RootBlocksFound = true;
                        }
                    }

                    for (J = 0; J <= Del.Count - 1; J++)
                    {
                        Ends.Remove(Del[J]);
                    }
                    Del.Clear();
                   
                }
                else
                {
                    for (J = 0; J <= Ends.Count - 1; J++)
                    {
                        if (I == Ends[J].StartNum)
                        {
                            for (K = 0; K <= Starts.Count - 1; K++)
                            {
                                if (Starts[K].Number < Ends[J].Number)
                                {
                                    Starts[K].Links.Add(Ends[J]);
                                }
                            }
                            Starts.Add(Ends[J]);
                            Del.Add(Ends[J]);
                        }
                    }
                    for (J = 0; J <= Del.Count - 1; J++)
                    {
                        Ends.Remove(Del[J]);
                    }
                    Del.Clear();
                }
            }
        }


        private void RowToBlocks(List<MatrixCellData> Row)
        {
            int I, NumberOfBlock, Start;
            Block B;
            bool BlockIsStarted;

            NumberOfBlock = 0;
            Start = 0;
            BlockIsStarted = false;
            if (Row.Count == 1)
            {
                Mistakes = 24;
                EndCount = true;
                return;
            }
            else
            {
                for (I = 0; I <= Row.Count - 2; I++)
                {
                    if ((!BlockIsStarted) && (ToNumber(Row[I]).Color == NumberColor.Black))
                    {
                        BlockIsStarted = true;
                        Start = I;
                    }

                    if (BlockIsStarted && ((ToNumber(Row[I + 1]).Num != (ToNumber(Row[I]).Num + 1)) || (ToNumber(Row[I + 1]).Color == NumberColor.Red)))
                    {
                        B = new Block();
                        B.Number = NumberOfBlock;
                        B.StartNum = ToNumber(Row[Start]).Num;
                        B.StartPos = Start;
                        B.EndPos = I;
                        B.Links = new List<Block>();
                        Blocks.Add(B);
                        NumberOfBlock++;
                        BlockIsStarted = false;
                    }

                    if (I == Row.Count - 2)
                    {
                        if (BlockIsStarted)
                        {
                            B = new Block();
                            B.Number = NumberOfBlock;
                            B.StartNum = ToNumber(Row[Start]).Num;
                            B.StartPos = Start;
                            B.EndPos = Row.Count - 1;
                            B.Links = new List<Block>();
                            Blocks.Add(B);
                            NumberOfBlock++;
                            BlockIsStarted = false;
                        }
                        else
                        {
                            B = new Block();
                            B.Number = NumberOfBlock;
                            B.StartNum = 25;
                            B.StartPos = Row.Count - 1;
                            B.EndPos = Row.Count - 1;
                            B.Links = new List<Block>();
                            Blocks.Add(B);
                            NumberOfBlock++;
                            BlockIsStarted = false;
                        }
                    }
                }
            }
        }

        private Number ToNumber(MatrixCellData S)
        {
            Number Num = new Number();
            if (S.Color == ColorCell.Red)
                Num.Color = NumberColor.Red;
            else
                Num.Color = NumberColor.Black;
            Num.Num = S.Number;
            return Num;
        }

        public class Block
        {
            public int Number { get; set; }
            public int StartNum { get; set; }
            public int StartPos { get; set; }
            public int EndPos { get; set; }
            public List<Block> Links { get; set; }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\OldStrategiesCalculateResults\CalculateResultsForQ2.cs


using System;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention.OldStrategiesCalculateResults
{
    class CalculateResultsForQ2
    {
        private List<Block> Roots;
        private List<Block> Blocks;
        private int Mistakes;
        private bool RootBlocksFound;
        private bool EndCount;

        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            int I;
            Mistakes = 23;
            RootBlocksFound = false;
            EndCount = false;
            Roots = new List<Block>();
            Blocks = new List<Block>();

            RowToBlocks(_results);
            if (!EndCount)
            {
                FillLinks();
                for (I = 0; I <= Roots.Count - 1; I++)
                {
                    Recurse(Math.Max(24-Roots[I].StartNum,Roots[I].StartPos), Roots[I],_results.Count);
                }
            }

            var results = new Dictionary<string, object>() { ["Ряд"] = _results, ["Ошибки"] = Mistakes };
            return results;
        }

        private void Recurse(int S, Block Block,int RowCount)
        {
            int I, M;

            if (Block.Links.Count != 0)
            {
                for (I = 0; I <= Block.Links.Count - 1; I++)
                {
                    M = Block.Links[I].StartPos - Block.EndPos - 1;

                    if (Block.Links[I].StartNum >= (Block.StartNum + Block.StartPos - Block.EndPos))
                    {
                        M = M + Block.Links[I].StartNum - Block.StartNum - Block.StartPos + Block.EndPos + 1;
                    }
                    M = Math.Max(M, Math.Abs(Block.Links[I].StartNum - Block.StartNum + Block.EndPos - Block.StartPos + 1));
                    Recurse(S + M, Block.Links[I],RowCount);
                }
            }
            else
            {
                S = S + Math.Max(RowCount - Block.EndPos - 1, Block.StartNum - Block.EndPos + Block.StartPos - 1);
                if (S < Mistakes)
                {
                    Mistakes = S;
                }
            }
        }



        private void FillLinks()
        {
            int I, J, K;
            List<Block> Starts = new List<Block>();
            List<Block> Ends = new List<Block>();
            List<Block> Del = new List<Block>();

            for (I = 0; I <= Blocks.Count - 1; I++)
            {
                Ends.Add(Blocks[I]);
            }

            for (I = 24; I >= 1; I--)
            {
                if (!RootBlocksFound)
                {
                    for (J = 0; J <= Ends.Count - 1; J++)
                    {
                        if (I == Ends[J].StartNum)
                        {
                            Roots.Add(Ends[J]);
                            Starts.Add(Ends[J]);
                            Del.Add(Ends[J]);
                            RootBlocksFound = true;
                        }
                    }

                    for (J = 0; J <= Del.Count - 1; J++)
                    {
                        Ends.Remove(Del[J]);
                    }
                    Del.Clear();
                    
                }
                else
                {
                    for (J = 0; J <= Ends.Count - 1; J++)
                    {
                        if (I == Ends[J].StartNum)
                        {
                            for (K = 0; K <= Starts.Count - 1; K++)
                            {
                                if (Starts[K].Number < Ends[J].Number)
                                {
                                    Starts[K].Links.Add(Ends[J]);
                                }
                            }
                            Starts.Add(Ends[J]);
                            Del.Add(Ends[J]);
                        }
                    }
                    for (J = 0; J <= Del.Count - 1; J++)
                    {
                        Ends.Remove(Del[J]);
                    }
                    Del.Clear();
                }
            }
        }


        private void RowToBlocks(List<MatrixCellData> Row)
        {
            int I, NumberOfBlock, Start;
            Block B;
            bool BlockIsStarted;

            NumberOfBlock = 0;
            Start = 0;
            BlockIsStarted = false;
            Blocks = new List<Block>();
            if (Row.Count == 1)
            {
                Mistakes = 23;
                EndCount = true;
                return;
            }
            else
            {
                for (I = 0; I <= Row.Count - 2; I++)
                {
                    if ((!BlockIsStarted) && (ToNumber(Row[I]).Color == NumberColor.Red))
                    {
                        BlockIsStarted = true;
                        Start = I;
                    }

                    if (BlockIsStarted && ((ToNumber(Row[I + 1]).Num != (ToNumber(Row[I]).Num - 1)) || (ToNumber(Row[I + 1]).Color == NumberColor.Black)))
                    {
                        B = new Block();
                        B.Number = NumberOfBlock;
                        B.StartNum = ToNumber(Row[Start]).Num;
                        B.StartPos = Start;
                        B.EndPos = I;
                        B.Links = new List<Block>();
                        Blocks.Add(B);
                        NumberOfBlock++;
                        BlockIsStarted = false;
                    }

                    if (I == Row.Count - 2)
                    {
                        if (BlockIsStarted)
                        {
                            B = new Block();
                            B.Number = NumberOfBlock;
                            B.StartNum = ToNumber(Row[Start]).Num;
                            B.StartPos = Start;
                            B.EndPos = Row.Count - 1;
                            B.Links = new List<Block>();
                            Blocks.Add(B);
                            NumberOfBlock++;
                            BlockIsStarted = false;
                        }
                        else
                        {
                            B = new Block();
                            B.Number = NumberOfBlock;
                            B.StartNum = 1;
                            B.StartPos = Row.Count - 1;
                            B.EndPos = Row.Count - 1;
                            B.Links = new List<Block>();
                            Blocks.Add(B);
                            NumberOfBlock++;
                            BlockIsStarted = false;
                        }
                    }
                }
            }
        }

        private Number ToNumber(MatrixCellData S)
        {
            Number Num = new Number();
            if (S.Color == ColorCell.Red)
            {
                Num.Color = NumberColor.Red;
            }
            else
            {
                Num.Color = NumberColor.Black;
            }

            Num.Num = S.Number;

            return Num;
        }

        public class Block
        {
            public int Number { get; set; }
            public int StartNum { get; set; }
            public int StartPos { get; set; }
            public int EndPos { get; set; }
            public List<Block> Links { get; set; }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention\OldStrategiesCalculateResults\CalculateResultsForQ3Q4.cs


using System;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention.OldStrategiesCalculateResults
{
    class CalculateResultsForQ3Q4
    {
        private List<MatrixCellData> Row;
        private List<Block> Roots;
        private int Mistakes = 0;
        private List<Block> Blocks;
        private bool RootBlocksFound;
        private bool EndCount;
        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            int I;
            Mistakes = 48;
            EndCount = false;
            RootBlocksFound = false;
            Roots = new List<Block>();
            Row = _results;

            FindBlocks();
            if (!EndCount)
            {
                FillLinks();
                for (I = 0; I <= Roots.Count - 1; I++)
                {
                    Recurse(Math.Max(Roots[I].StartNum - 1, Roots[I].StartPos), Roots[I], Row.Count);
                }
            }
            var results = new Dictionary<string, object>() { ["Ряд"] = _results, ["Ошибки"] = Mistakes };
            return results;
        }

        private Number ToNumber(MatrixCellData S)
        {
            Number Num = new Number();
            if (S.Color == ColorCell.Red)
            {
                Num.Color = NumberColor.Red;
                Num.Num = S.Number;
            }
            else
            {
                Num.Color = NumberColor.Black;
                Num.Num = S.Number;
            }
            return Num;
        }

        private void FindBlocks()
        {
            int I, NumberOfBlock, Start, BlockSum;
            bool BlockIsStarted;

            NumberOfBlock = 0;
            Start = 0;
            Blocks = new List<Block>();
            BlockIsStarted = false;
            BlockSum = 0;

            if (Row.Count < 3)
            {
                Mistakes = 49 - Row.Count;
                EndCount = true;
                return;
            }
            else
            {
                for (I = 0; I <= Row.Count - 3; I++)
                {
                    if (!BlockIsStarted)
                    {
                        BlockIsStarted = true;
                        Start = I;
                        if ((ToNumber(Row[I]).Color == NumberColor.Black) && (ToNumber(Row[I + 1]).Color == NumberColor.Red))
                        {
                            BlockSum = ToNumber(Row[I]).Num + ToNumber(Row[I + 1]).Num;
                        }

                        if ((ToNumber(Row[I]).Color == NumberColor.Red) && (ToNumber(Row[I + 1]).Color == NumberColor.Black))
                        {
                            BlockSum = ToNumber(Row[I]).Num + ToNumber(Row[I + 1]).Num - 1;
                        }
                    }

                    if (BlockIsStarted)
                    {
                        if (I == Start && (!(((ToNumber(Row[I]).Color == NumberColor.Black) &&
                            (ToNumber(Row[I + 1]).Color == NumberColor.Red) &&
                            (ToNumber(Row[I + 2]).Color == NumberColor.Black) &&
                            (ToNumber(Row[I]).Num + ToNumber(Row[I + 1]).Num) == BlockSum &&
                            ((ToNumber(Row[I + 1]).Num + ToNumber(Row[I + 2]).Num) == BlockSum + 1)) ||

                            ((ToNumber(Row[I]).Color == NumberColor.Red) &&
                            (ToNumber(Row[I + 1]).Color == NumberColor.Black) &&
                            (ToNumber(Row[I + 2]).Color == NumberColor.Red) &&
                            ((ToNumber(Row[I]).Num + ToNumber(Row[I + 1]).Num) == BlockSum + 1) &&
                            (ToNumber(Row[I + 1]).Num + ToNumber(Row[I + 2]).Num == BlockSum)))))
                        {
                            Blocks.Add(Block_Create(NumberOfBlock, BlockSum, Start, I, Row[Start], Row[I]));
                            NumberOfBlock++;
                            BlockIsStarted = false;
                        }

                        if ((I != Start) && (!(((ToNumber(Row[I]).Color == NumberColor.Black) &&
                          (ToNumber(Row[I + 1]).Color == NumberColor.Red) &&
                          ((ToNumber(Row[I]).Num + ToNumber(Row[I + 1]).Num) == BlockSum)) ||
                          ((ToNumber(Row[I]).Color == NumberColor.Red) &&
                          (ToNumber(Row[I + 1]).Color == NumberColor.Black) &&
                          ((ToNumber(Row[I]).Num + ToNumber(Row[I + 1]).Num) == BlockSum + 1)))))
                        {
                            Blocks.Add(Block_Create(NumberOfBlock, BlockSum,Start, I, Row[Start], Row[I]));
                            NumberOfBlock++;
                            BlockIsStarted = false;
                        }
                    }

                    if (I == Row.Count - 3)
                        if (BlockIsStarted)
                        {
                            if (Row[I].Color == ColorCell.Black && Row[I].Number == 24)
                            {
                                Blocks.Add(Block_Create(NumberOfBlock, BlockSum, Start, Row.Count - 1, Row[Start], new MatrixCellData(ColorCell.Black, 25, 0)));
                                NumberOfBlock++;
                                BlockIsStarted = false;
                            }
                            else
                            {
                                Blocks.Add(Block_Create(NumberOfBlock, BlockSum, Start, Row.Count - 2, Row[Start], Row[Row.Count - 2]));
                                NumberOfBlock++;
                                BlockIsStarted = false;

                                Blocks.Add(Block_Create(NumberOfBlock, 0, Row.Count - 1, Row.Count - 1, new MatrixCellData(ColorCell.Black, 25, 0), new MatrixCellData(ColorCell.Black, 25, 0)));
                                NumberOfBlock++;
                                BlockIsStarted = false;
                            }
                        }
                        else
                        {
                            if (Row[I + 1].Color == ColorCell.Red && Row[I + 1].Number == 1)
                            {
                                Blocks.Add(Block_Create(NumberOfBlock, 25, Row.Count - 2, Row.Count - 1, new MatrixCellData(ColorCell.Red, 1, 0), new MatrixCellData(ColorCell.Black, 25, 0)));
                                NumberOfBlock++;
                                BlockIsStarted = false;
                            }
                            else
                            {
                                Blocks.Add(Block_Create(NumberOfBlock, 0, Row.Count - 2, Row.Count - 1, Row[Row.Count - 2], Row[Row.Count - 2]));
                                NumberOfBlock++;
                                BlockIsStarted = false;


                                Blocks.Add(Block_Create(NumberOfBlock, 0, Row.Count - 1, Row.Count - 1, new MatrixCellData(ColorCell.Black, 25, 0), new MatrixCellData(ColorCell.Black, 25, 0)));
                                NumberOfBlock++;
                                BlockIsStarted = false;
                            }
                        }
                    }
            }
        }

        private void FillLinks()
        {
            int I, J, K;

            var Starts = new List<Block>();
            var Ends = new List<Block>();
            var Del = new List<Block>();

            for (I = 0; I <= Blocks.Count - 1; I++)
            {
                Ends.Add(Blocks[I]);
            }

            for (I = 1; I <= 49; I++)
            {
                if (!RootBlocksFound)
                {
                    for (J = 0; J <= Ends.Count - 1; J++)
                    {
                        if (I == Ends[J].StartNum)
                        {
                            Roots.Add(Ends[J]);
                            Starts.Add(Ends[J]);
                            Del.Add(Ends[J]);
                            RootBlocksFound = true;
                        }
                    }

                    for (J = 0; J <= Del.Count - 1; J++)
                    {
                        Ends.Remove(Del[J]);
                    }
                    Del.Clear();
                }
                else
                {
                    for (J = 0; J <= Ends.Count - 1; J++)
                    {
                        if (I == Ends[J].StartNum)
                        {
                            for (K = 0; K <= Starts.Count - 1; K++)
                            {
                                if (Starts[K].Number < Ends[J].Number)
                                {
                                    Starts[K].Links.Add(Ends[J]);
                                }
                            }
                            Starts.Add(Ends[J]);
                            Del.Add(Ends[J]);
                        }
                    }

                    for (J = 0; J <= Del.Count - 1; J++)
                    {
                        Ends.Remove(Del[J]);
                    }
                    Del.Clear();
                }
            }
        }

        private void Recurse(int S, Block Block, int RowCount)
        {
            int I, M;

            if (Block.Links.Count != 0)
            {
                for (I = 0; I <= Block.Links.Count - 1; I++)
                {
                    M = Block.Links[I].StartPos - Block.EndPos - 1;

                    if (Block.Links[I].StartNum <= (Block.StartNum - Block.StartPos + Block.EndPos))
                    {
                        M = M + Block.StartNum - Block.StartPos + Block.EndPos - Block.Links[I].StartNum + 1;
                    }
                    M = Math.Max(M, Math.Abs(Block.Links[I].StartNum - Block.StartNum - Block.EndPos + Block.StartPos - 1));

                    if ((Math.Abs(25 - Block.Links[I].Sum) > Math.Abs(25 - Block.Sum)) && (Block.Links[I].Sum > 0) && (Block.Sum > 0))
                    {
                        M = M + 1;
                    }
                    Recurse(S + M, Block.Links[I], RowCount);
                }
            }
            else
            {
                S = S + RowCount - Block.EndPos - 1;
                if (S < Mistakes)
                {
                    Mistakes = S;
                }
            }
        }


        private Block Block_Create(int N, int S, int SP, int EP, MatrixCellData SN, MatrixCellData EN)
        {
            var block = new Block();
            block.Number = N;

            if (ToNumber(SN).Color == NumberColor.Black)
            {
                block.StartNum = 2 * ToNumber(SN).Num-1;
            }
            else
            {
                block.StartNum = 50 - 2 * ToNumber(SN).Num;
            }

            block.StartPos = SP;

            if (ToNumber(EN).Color == NumberColor.Black)
            {
                block.EndNum = 2 * ToNumber(EN).Num-1;
            }
            else
            {
                block.EndNum = 50 - 2 * ToNumber(EN).Num;
            }

            block.EndPos = EP;

            block.Links = new List<Block>();

            if (block.EndPos - block.StartPos > 0)
            {
                block.Sum = S;
            }
            else
                block.Sum = 0;

            return block;
        }

        class Block
        {
            public int Number { get; set; }
            public int Sum { get; set; }
            public int StartNum { get; set; }
            public int StartPos { get; set; }
            public int EndNum { get; set; }
            public int EndPos { get; set; }
            public List<Block> Links { get; set; }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\Cell.cs


using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2
{
    public class Cell : NotifyViewModelBase
    {
        private Brush _color;
        public Brush Color
        {
            get { return _color; }
            set
            {
                _color = value;
                OnPropertyChanged();
            }
        }

        private bool _mark;

        public bool Mark
        {
            get { return _mark; }
            set
            {
                _mark = value;
                OnPropertyChanged();
            }
        }

        private int _number;
        public int Number
        {
            get { return _number; }
            set
            {
                _number = value;
                OnPropertyChanged();
            }
        }
        private MatrixCellData _cellData;
        public MatrixCellData CellData
        {
            get { return _cellData; }
            private set
            {
                _cellData = value;
                Number = _cellData.Number;
                Color = getColor(_cellData.Color);
            }
        }

        private Brush getColor(ColorCell colorCell)
        {
            switch (colorCell)
            {
                case ColorCell.Red:
                    return Brushes.Red;
                case ColorCell.Black:
                    return Brushes.Black;
            }
            return null;
        }

        public Cell(MatrixCellData cellData)
        {
            CellData = cellData;
        }
    }

    public enum ColorCell
    {
        Red, Black
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\ICalculateStrategy.cs


using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2
{
    public interface ICalculateStrategy
    {
        Dictionary<string, object> Calculate(List<MatrixCellData> _results);
    }

    #region Strategy1
    public class Quest1CalculateResults : ICalculateStrategy
    {
        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            var oldStrategy = new OldStrategiesCalculateResults.CalculateResultsForQ1();
            var results = oldStrategy.Calculate(_results);
            return results;
        }
    }
    #endregion
    #region Strategy2
    public class Quest2CalculateResults : ICalculateStrategy
    {
        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            var oldStrategy = new OldStrategiesCalculateResults.CalculateResultsForQ2();
            var results = oldStrategy.Calculate(_results);
            return results;
        }
    }
    #endregion
    #region Strategy3
    public class Quest3CalculateResults : ICalculateStrategy
    {
        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            var oldStrategy = new OldStrategiesCalculateResults.CalculateResultsForQ3Q4();
            var results = oldStrategy.Calculate(_results);
            return results;
        }
    }
    #endregion

    public class PairColorNumber
    {
        public PairColorNumber(ColorCell color, int number)
        {
            Color = color;
            Number = number;
        }

        public ColorCell? Color { get; private set; }
        public int? Number { get; private set; }
        public int IndexInResult { get; set; }
    }

    public class PairColorNumberComparer : IEqualityComparer<PairColorNumber>
    {
        public bool Equals(PairColorNumber x, PairColorNumber y)
        {
            if (ReferenceEquals(x, y)) return true;

            return x != null && y != null && x.Color.Equals(y.Color) && x.Number.Equals(y.Number);
        }

        public int GetHashCode(PairColorNumber obj)
        {
            int hashPairNumber = obj.Number == null ? 0 : obj.Number.GetHashCode();

            int hashPairColor = obj.Color.GetHashCode();

            return hashPairNumber ^ hashPairColor;
        }
    }

    public class Block
    {
        public Block(List<PairColorNumber> blockData, int index)
        {
            BlockData = blockData;
            Index = index;
        }

        public List<PairColorNumber> BlockData { get; private set; }
        public int Index { get; private set; }

    }

    public class Context
    {
        private ICalculateStrategy _calculate;
        public Context(ICalculateStrategy calculate)
        {
            _calculate = calculate;
        }

        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            return _calculate.Calculate(_results);
        }
    }

    public interface IFactoryCalculateStrategy
    {
        ICalculateStrategy GetStrategyCalculate(int numberQuest);
    }

    public class FactoryCalculateStrategy : IFactoryCalculateStrategy
    {
        public ICalculateStrategy GetStrategyCalculate(int numberQuest)
        {
            switch (numberQuest)
            {
                case 1:
                    return new Quest1CalculateResults();
                case 2:
                    return new Quest2CalculateResults();
                case 3:
                    return new Quest3CalculateResults();
                case 4:
                    return new Quest3CalculateResults();
                default: return null;
            }
        }
    }
}
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\IEtalon.cs


using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2
{
    public interface IEtalon
    {
        List<MatrixCellData> GetEtalonData(int numberQuest);
    }

    public class Etalon : IEtalon
    {
        public List<MatrixCellData> GetEtalonData(int numberQuest)
        {
            var _etalon = new List<MatrixCellData>();
            int number = 48;
            var blackNumbers = new List<MatrixCellData>();
            var redNumbers = new List<MatrixCellData>();
            int blackIndex = 0;
            int redIndex = 0;
            switch (numberQuest)
            {
                case 1:
                    for (int i = 0; i < 25; i++)
                        _etalon.Add(new MatrixCellData(ColorCell.Black, i + 1, i));
                    return _etalon;
                case 2:
                    for (int i = 0; i < 24; i++)
                    {
                        _etalon.Add(new MatrixCellData(ColorCell.Red, number, i));
                        number = number - 2;
                    }
                    return _etalon;
                case 3:
                    for (int i = 0; i < 25; i++)
                        blackNumbers.Add(new MatrixCellData(ColorCell.Black, i + 1, i));
                    for (int i = 0; i < 24; i++)
                    {
                        redNumbers.Add(new MatrixCellData(ColorCell.Red, number, i));
                        number = number - 2;
                    }

                    for (int i = 0; i < 49; i++)
                    {
                        if ((i + 1) % 2 == 0)
                        {
                            _etalon.Add(redNumbers[redIndex]);
                            redIndex++;
                        }
                        else
                        {
                            _etalon.Add(blackNumbers[blackIndex]);
                            blackIndex++;
                        }
                    }
                    return _etalon;
                case 4:
                    for (int i = 0; i < 25; i++)
                        blackNumbers.Add(new MatrixCellData(ColorCell.Black, i + 1, i));
                    for (int i = 0; i < 24; i++)
                    {
                        redNumbers.Add(new MatrixCellData(ColorCell.Red, number, i));
                        number = number - 2;
                    }
                    for (int i = 0; i < 49; i++)
                    {
                        if ((i + 1) % 2 == 0)
                        {
                            _etalon.Add(redNumbers[redIndex]);
                            redIndex++;
                        }
                        else
                        {
                            _etalon.Add(blackNumbers[blackIndex]);
                            blackIndex++;
                        }
                    }
                    return _etalon;
                default: return null;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\MatrixCellData.cs


namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2
{
    public class MatrixCellData
    {
        public ColorCell Color { get; private set; }
        public int Number { get; private set; }
        public int Index { get; private set; }
        public MatrixCellData(ColorCell color, int number, int index)
        {
            Index = index;
            Color = color;
            Number = number;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\PlaySoundsNumbers.cs


using System;
using System.Collections.Generic;
using System.IO;
using System.Media;
using System.Windows;
using System.Windows.Threading;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2
{
    public class PlayerSoundsNumbers
    {
        private readonly List<int> numbersSoundsBlack =
            new List<int>()
            {
                1, 2, 3, 4, 5,
                6, 7, 8, 9, 10,
                11, 12, 13, 14, 15,
                16, 17, 18, 19, 20,
                21, 22, 23, 24, 25
            };

        private readonly List<int> numbersSoundsRed =
            new List<int>()
            {
                2, 4, 6, 8, 10,
                12, 14, 16, 18, 20,
                22, 24, 26, 28, 30,
                32, 34, 36, 38, 40,
                42, 44, 46, 48
            };

        private SoundPlayer _player;
        DispatcherTimer _timerBetweenSounds = new DispatcherTimer();
        DispatcherTimer _timerToRedBlackSounds = new DispatcherTimer();//таймер перехода от звука числа к звуку красное/черное (для удобства и только)
        TimeSpan _intervanBetweenRedBlack;
        TimeSpan _intervanBetweenBlackRed;
        public PlayerSoundsNumbers(TimeSpan intervanBetweenBlackRed, TimeSpan intervanBetweenRedBlack)
        {
            _intervanBetweenBlackRed = intervanBetweenBlackRed;
            _intervanBetweenRedBlack = intervanBetweenRedBlack;
            _player = new SoundPlayer();
            _timerBetweenSounds.Tick += _timerBetweenSounds_Tick;
            _timerToRedBlackSounds.Interval = TimeSpan.FromSeconds(2.0);
            _timerToRedBlackSounds.Tick += _timerToRedBlackSounds_Tick;
        }

        public void Start()
        {
            _timerBetweenSounds.Interval = _intervanBetweenBlackRed;
            _timerBetweenSounds.Start();
        }

        public void CloseRes()
        {
            _ms?.Dispose();
            _player.Dispose();
        }

        public void Stop()
        {
            _timerBetweenSounds.Tick -= _timerBetweenSounds_Tick;
            _timerToRedBlackSounds.Tick -= _timerToRedBlackSounds_Tick;
            _timerToRedBlackSounds.Stop();
            _timerBetweenSounds.Stop();
            _player.Stop();
        }

        private bool _isRedBlack = false;
        private void _timerBetweenSounds_Tick(object sender, EventArgs e)
        {
            _timerBetweenSounds.Stop();
            if (!_isRedBlack)
                Play(numbersSoundsBlack[Common._rnd.Next(0, numbersSoundsBlack.Count)]);
            else
                Play(numbersSoundsRed[Common._rnd.Next(0, numbersSoundsRed.Count)]);
            _timerToRedBlackSounds.Start();

        }

        private void _timerToRedBlackSounds_Tick(object sender, EventArgs e)
        {
            _timerToRedBlackSounds.Stop();
            if (!_isRedBlack)
            {
                _isRedBlack = true;
                _timerBetweenSounds.Interval = _intervanBetweenRedBlack;
            }
            else
            {
                _isRedBlack = false;
                _timerBetweenSounds.Interval = _intervanBetweenBlackRed;
            }
            Play(GetPathColorSounds(!_isRedBlack));
            _timerBetweenSounds.Start();

        }

        private MemoryStream _ms;
        private void Play(Uri path)
        {
            _ms?.Dispose();
            var byteArray =
             SoundResources.GetSoundArray(path.OriginalString);
            _ms = new MemoryStream(byteArray);
            _player.Stream = _ms;
            _player.Play();
        }

        private void Play(int numberSound)
        {
            _ms?.Dispose();
            var byteArray =
             SoundResources.GetSoundArray(GetPathNumberSound(numberSound).OriginalString);
            _ms = new MemoryStream(byteArray);
            _player.Stream = _ms;
            _player.Play();
        }

        private Uri GetPathColorSounds(bool _isBlackRed)
        {
            if (!_isBlackRed)
                return new Uri($@"pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/black.wav");
            else
                return new Uri($@"pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/red.wav");
        }

        private Uri GetPathNumberSound(int numberSound)
        {
            return new Uri($@"pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/Numbers/{numberSound}.wav");
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\SwitchAttention2ViewModel.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2
{
    public class SwitchAttention2ViewModel : TestBase
    {
        private int _numberInstruction;
        public int NumberInstruction
        {
            get { return _numberInstruction; }
            set
            {
                _numberInstruction = value;
                OnPropertyChanged();
            }
        }

        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (string.IsNullOrEmpty(_message))
                    IsMessageBoxVisible = false;
                else
                    IsMessageBoxVisible = true;
                OnPropertyChanged();
            }
        }

        private bool _isMessageBoxVisible;
        public bool IsMessageBoxVisible
        {
            get { return _isMessageBoxVisible; }
            set
            {
                _isMessageBoxVisible = value;
                OnPropertyChanged();
            }
        }

        public override event EventHandler<Results> Results;
        DispatcherTimer _timer = new DispatcherTimer();
        private SwitchAttentionQuest control;
        public SwitchAttention2ViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            Manager.TraningTime = Common.GetSeconds(40);
            SetInstructions("SwitchAttention2_1", 1);
            NumberInstruction = 1;
        }
        public override FrameworkElement GetTestControl()
        {
            return new SwitchAttentionQuest(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new SwitchAttentionQuest(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            control = new SwitchAttentionQuest();
            TestCurrentView = control;
            control.Start(1);
        }

        public override void ToDefault()
        {
            base.ToDefault();
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        public override void Start()
        {
            control = new SwitchAttentionQuest();
            control.Results += Control_Results;
            _timer.Interval = TimeSpan.FromSeconds(5);
            _timer.Tick += _timer_Tick;
            control.Start(NumberInstruction);
            if (NumberInstruction == 4)
            {
                control.IntervalBetweenBlackRed = _intervarForTask4;
                control.IntervalBetweenRedBlack = _intervarForTask4;
            }
            TestCurrentView = control;
        }

        private TimeSpan _intervarForTask4;

        private Dictionary<string, Dictionary<string, object>> QuestResult = new Dictionary<string, Dictionary<string, object>>();
        private bool _isRepeatUsedQ1 = false;
        private bool _isRepeatUsedQ2 = false;
        private bool _isRepeatUsedQ3 = false;
        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            switch (NumberInstruction)
            {
                case 1:
                    if (Convert.ToInt32(e["Ошибки"]) > 3 && !_isRepeatUsedQ1)
                    {
                        QuestResult.Add($"Задание {NumberInstruction}", e);
                        Message = "Много ошибок! Тест будет перезапущен через 5 секунд";
                        _isRepeatUsedQ1 = true;
                        NumberInstruction = 1;
                        RepeatStart();
                    }
                    else
                    {
                        if (_isRepeatUsedQ1)
                            QuestResult.Add($"Задание_повторное {NumberInstruction}", e);
                        else
                            QuestResult.Add($"Задание {NumberInstruction}", e);
                        NumberInstruction = 2;
                        ToInstruction();
                    }
                    break;
                case 2:
                    if (Convert.ToInt32(e["Ошибки"]) > 3 && !_isRepeatUsedQ2)
                    {
                        QuestResult.Add($"Задание {NumberInstruction}", e);
                        Message = "Много ошибок! Тест будет перезапущен через 5 секунд";
                        _isRepeatUsedQ2 = true;
                        NumberInstruction = 2;
                        RepeatStart();
                    }
                    else
                    {
                        if (_isRepeatUsedQ2)
                            QuestResult.Add($"Задание_повторное {NumberInstruction}", e);
                        else
                            QuestResult.Add($"Задание {NumberInstruction}", e);
                        NumberInstruction = 3;
                        ToInstruction();
                    }
                    break;
                case 3:
                    if (Convert.ToInt32(e["Ошибки"]) > 3 && !_isRepeatUsedQ3)
                    {
                        QuestResult.Add($"Задание {NumberInstruction}", e);
                        Message = "Много ошибок! Тест будет перезапущен через 5 секунд";
                        _isRepeatUsedQ3 = true;
                        NumberInstruction = 3;
                        RepeatStart();
                    }
                    else
                    {
                        if (_isRepeatUsedQ3)
                            QuestResult.Add($"Задание_повторное {NumberInstruction}", e);
                        else
                            QuestResult.Add($"Задание {NumberInstruction}", e);
                        TimeSpan interval;
                        if (!_isRepeatUsedQ3)
                            interval = TimeSpan.FromMilliseconds(Convert.ToDouble(QuestResult["Задание 3"]["Интервал между нажатиями"]));
                        else
                            interval = TimeSpan.FromMilliseconds(Convert.ToDouble(QuestResult["Задание_повторное 3"]["Интервал между нажатиями"]));
                        _intervarForTask4 = interval;
                        NumberInstruction = 4;
                        ToInstruction();
                    }
                    break;
                case 4:
                    QuestResult.Add($"Задание {NumberInstruction}", e);
                    var res1 = QuestResult.Keys.FirstOrDefault(f => f == "Задание_повторное 1") != null ?
                                           QuestResult["Задание_повторное 1"] : QuestResult["Задание 1"];

                    var res2 = QuestResult.Keys.FirstOrDefault(f => f == "Задание_повторное 2") != null ?
                        QuestResult["Задание_повторное 2"] : QuestResult["Задание 2"];

                    var res3 = QuestResult.Keys.FirstOrDefault(f => f == "Задание_повторное 3") != null ?
                        QuestResult["Задание_повторное 3"] : QuestResult["Задание 3"];
                    var res4 = QuestResult["Задание 4"];

                    var res1Repeat = QuestResult.Keys.FirstOrDefault(f => f == "Задание_повторное 1") != null ?
                        QuestResult["Задание_повторное 1"] : new Dictionary<string, object>() { ["Ряд"] = new List<MatrixCellData>() };
                    var res2Repeat = QuestResult.Keys.FirstOrDefault(f => f == "Задание_повторное 2") != null ?
                        QuestResult["Задание_повторное 2"] : new Dictionary<string, object>() { ["Ряд"] = new List<MatrixCellData>() };
                    var res3Repeat = QuestResult.Keys.FirstOrDefault(f => f == "Задание_повторное 3") != null ?
                        QuestResult["Задание_повторное 3"] : new Dictionary<string, object>() { ["Ряд"] = new List<MatrixCellData>() };

                    var time1 = TimeSpan.Parse(res1["Время теста"].ToString());
                    var time2 = TimeSpan.Parse(res2["Время теста"].ToString());
                    var time3 = TimeSpan.Parse(res3["Время теста"].ToString());
                    var time4 = TimeSpan.Parse(res4["Время теста"].ToString());

                    var errors1 = Convert.ToInt32(res1["Ошибки"]);
                    var errors2 = Convert.ToInt32(res2["Ошибки"]);
                    var errors3 = Convert.ToInt32(res3["Ошибки"]);
                    var errors4 = Convert.ToInt32(res4["Ошибки"]);

                    var series1 = (List<MatrixCellData>)QuestResult["Задание 1"]["Ряд"];
                    var series2 = (List<MatrixCellData>)QuestResult["Задание 2"]["Ряд"];
                    var series3 = (List<MatrixCellData>)QuestResult["Задание 3"]["Ряд"];
                    var series4 = (List<MatrixCellData>)QuestResult["Задание 4"]["Ряд"];
                    var series1Repeat = (List<MatrixCellData>)res1Repeat["Ряд"];
                    var series2Repeat = (List<MatrixCellData>)res2Repeat["Ряд"];
                    var series3Repeat = (List<MatrixCellData>)res3Repeat["Ряд"];

                    var timeSwitchAttention = time3 - (time1 + time2);

                    var noiseImmunity = time4 - time3;

                    var res = new Dictionary<string, object>()
                    {
                        ["Время выполнения 1-го задания"] = (float)time1.TotalSeconds,
                        ["Время выполнения 2-го задания"] = (float)time2.TotalSeconds,
                        ["Время выполнения 3-го задания"] = (float)time3.TotalSeconds,
                        ["Время выполнения 4-го задания"] = (float)time4.TotalSeconds,
                        ["Количество ошибок в 1 задании"] = errors1,
                        ["Количество ошибок вo 2 задании"] = errors2,
                        ["Количество ошибок в 3 задании"] = errors3,
                        ["Количество ошибок в 4 задании"] = errors4,
                        ["Время переключения внимания"] = (float)timeSwitchAttention.TotalSeconds,
                        ["Помехоустойчивость"] = (float)noiseImmunity.TotalSeconds,
                        ["Разница числа ошибок в 4-ом и 3-ем заданиях"] = errors4 - errors3,
                        ["Нажатые числа в 1-ом задании"] = GetConvertedToStringSeries(series1),
                        ["Нажатые числа во 2-ом задании"] = GetConvertedToStringSeries(series2),
                        ["Нажатые числа в 3-ом задании"] = GetConvertedToStringSeries(series3),
                        ["Нажатые числа в 4-ом задании"] = GetConvertedToStringSeries(series4),
                        ["Нажатые числа в 1-ом повторном задании"] = GetConvertedToStringSeries(series1Repeat),
                        ["Нажатые числа в 2-ом повторном задании"] = GetConvertedToStringSeries(series2Repeat),
                        ["Нажатые числа в 3-ом повторном задании"] = GetConvertedToStringSeries(series3Repeat)
                    };

                    Results?.Invoke(this, new Results(res));
                    if (control != null)
                        control.CloseRes();
                    break;
            }
        }

        private void RepeatStart()
        {
            control.Results -= Control_Results;
            control.Stop();
            _timer.Start();
        }

        private void ToInstruction()
        {
            Stop();
            SetInstructions($"SwitchAttention2_{NumberInstruction}", NumberInstruction, true);
            Manager.ToInstruction();
        }

        private string GetStringColor(ColorCell color)
        {
            switch (color)
            {
                case ColorCell.Red:
                    return "Красное";
                case ColorCell.Black:
                    return "Черное";
            }
            return "";
        }

        private string GetConvertedToStringSeries(List<MatrixCellData> series)
        {
            string s = "";
            foreach (var value in series)
                s = s + $"{value.Number} {GetStringColor(value.Color)} ";
            return s;
        }

        private void _timer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
            Start();
        }

        public override void Stop()
        {
            base.Stop();
            if (control != null)
            {
                control.Results -= Control_Results;
                control.Stop();
                control.CloseRes();
            }
            if (_timer != null)
            {
                _timer.Tick -= _timer_Tick;
                _timer.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\SwitchAttentionQuest.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2
{
    public class SwitchAttentionQuest : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        private TimeSpan timeQuest = TimeSpan.FromSeconds(90);
        double HeigthWidthCell = 50;
        private int questNumber;

        private List<MatrixCellData> _results = new List<MatrixCellData>();
        private DateTime _startTime;
        private bool timeOut = false;
        List<Cell> _cells = new List<Cell>();
        private PlayerSoundsNumbers _player = null;

        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public TimeSpan? IntervalBetweenBlackRed { get; set; } = null;
        public TimeSpan? IntervalBetweenRedBlack { get; set; } = null;
        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }
        DispatcherTimer _timer = new DispatcherTimer();
        private List<MatrixCellData> _etalonData;
        private bool _isInitialized = false;
        private int aimNumberForActivatingSounds = 6;
        public SwitchAttentionQuest(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
            {
                generateScene();
                TestMethods.Add("NumbersTask1", () => NumbersTask1());
                TestMethods.Add("NumbersTask2", () => NumbersTask2());
                TestMethods.Add("NumbersTask3_4", () => NumbersTask3_4());
                TestMethods.Add("instruction_Tick_250ms", () => instruction_Tick_250ms());
            }
        }

        private List<Cell> orderedNumbers;
        private int indexONumbers = 0;

        private void NumbersTask1()
        {
            indexONumbers = 0;
            orderedNumbers = _cells.Where(f => f.CellData.Color == ColorCell.Black).OrderBy(o => o.CellData.Number).ToList();
        }

        private void NumbersTask2()
        {
            indexONumbers = 0;
            orderedNumbers = _cells.Where(f => f.CellData.Color == ColorCell.Red).OrderByDescending(o => o.CellData.Number).ToList();
        }

        private void NumbersTask3_4()
        {
            indexONumbers = 0;
            var newOrderedNumbers = new List<Cell>();
            var blackOrderedAscending = _cells.Where(f => f.CellData.Color == ColorCell.Black).OrderBy(o => o.CellData.Number).ToList();
            var redOrderedAscending = _cells.Where(f => f.CellData.Color == ColorCell.Red).OrderByDescending(o => o.CellData.Number).ToList();
            for (int i = 0; i < redOrderedAscending.Count; i++)
            {
                newOrderedNumbers.Add(blackOrderedAscending[i]);
                newOrderedNumbers.Add(redOrderedAscending[i]);
            }
            newOrderedNumbers.Add(blackOrderedAscending[24]);
            orderedNumbers = newOrderedNumbers;
        }

        private void instruction_Tick_250ms()
        {
            if (indexONumbers < orderedNumbers.Count)
            {
                orderedNumbers[indexONumbers].Mark = true;
                indexONumbers++;
            }
        }


        private void Initialize()
        {
            if (!_isInitialized)
            {
                _timer.Interval = timeQuest;
                _timer.Tick += _timer_Tick;
                _isInitialized = true;
            }
        }

        public void Start(int questNumber)
        {
            if (questNumber == 4)
                aimNumberForActivatingSounds = Common._rnd.Next(6, 9);
            Clear();
            this.questNumber = questNumber;
            generateScene();
            IEtalon etalon = new Etalon();
            if (questNumber == 1 || questNumber == 2)
            {
                Initialize();
                _timer.Start();
            }
            _etalonData = etalon.GetEtalonData(questNumber);
            _startTime = DateTime.Now;
        }

        public void CloseRes()
        {
            if (_player != null)
                _player.CloseRes();
        }

        private void Clear()
        {
            timeOut = false;
            _cells = new List<Cell>();
            _player = null;
            _results = new List<MatrixCellData>();
        }
      
        private void _timer_Tick(object sender, EventArgs e)
        {
            timeOut = true;
            ReturnResults();
        }

        public void Stop()
        {
            if (_player != null)
                _player.Stop();
            _timer.Stop();
        }

        private void generateScene()
        {
            List<MatrixCellData> matrixCellDatas = new List<MatrixCellData>();
            for (int i = 0; i < 25; i++)
                matrixCellDatas.Add(new MatrixCellData(ColorCell.Black, i + 1, i));
            int even = 0;
            for (int i = 0; i < 24; i++)
            {
                even = even + 2;
                matrixCellDatas.Add(new MatrixCellData(ColorCell.Red, even, i));
            }

            Common.Shuffle(matrixCellDatas);
            int index = 0;
            var canvas = new Canvas();
            canvas.Height = canvas.Width = HeigthWidthCell * 7;
            for (int i = 0; i < 7; i++)
                for (int j = 0; j < 7; j++)
                {
                    var cell = new Cell(matrixCellDatas[index]);
                    cell.Height = cell.Width = HeigthWidthCell;
                    index++;
                    cell.SetValue(Canvas.LeftProperty, HeigthWidthCell * j);
                    cell.SetValue(Canvas.TopProperty, HeigthWidthCell * i);
                    _cells.Add(cell);
                    canvas.Children.Add(cell);
                }
            Canva = canvas;
            foreach (var cell in _cells)
                cell.MouseDown += Cell_MouseDown;
        }

        private List<TimeSpan> intervalsBetweenPressedForQuest3 = new List<TimeSpan>();
        private DateTime? _timeStartIntervalPressed = null;
        private void Cell_MouseDown(object sender, MouseButtonEventArgs e)
        {
            var cellData = (sender as Cell).CellData;
            if (_results.Count != 0 && _etalonData.Last().Number == cellData.Number &&
             _etalonData.Last().Color == cellData.Color &&
             _results.Last().Color == cellData.Color &&
             _results.Last().Number == cellData.Number)
            {
                ReturnResults();
            }
            else if (_results.Count != 0 && _etalonData[_etalonData.Count - 2].Number == _results.Last().Number &&
                _etalonData[_etalonData.Count - 2].Color == _results.Last().Color &&
                _etalonData.Last().Number == cellData.Number &&
             _etalonData.Last().Color == cellData.Color)
            {
                _results.Add(cellData);
                ReturnResults();
            }
            else
            {
                if (questNumber == 4 && cellData.Number == aimNumberForActivatingSounds && cellData.Color == ColorCell.Black && _player == null)
                {
                    if (IntervalBetweenBlackRed != null && IntervalBetweenRedBlack != null)
                    {
                        _player = new PlayerSoundsNumbers(IntervalBetweenBlackRed.Value, IntervalBetweenRedBlack.Value);
                        _player.Start();
                    }
                }
                _results.Add(cellData);

                if (questNumber == 3)
                {
                    if (intervalsBetweenPressedForQuest3.Count == 0)
                    {
                        var time = DateTime.Now - _startTime;
                        intervalsBetweenPressedForQuest3.Add(time);
                        _timeStartIntervalPressed = DateTime.Now;
                    }
                    else
                    {
                        var time = DateTime.Now - _timeStartIntervalPressed;
                        intervalsBetweenPressedForQuest3.Add(time.Value);
                        _timeStartIntervalPressed = DateTime.Now;
                    }
                }
            }
        }
        
        private void ReturnResults()
        {
            if (questNumber == 4 && _player != null)
                _player.Stop();
            var time = DateTime.Now - _startTime;
            _timer.Stop();
            IFactoryCalculateStrategy factoryStrategy = new FactoryCalculateStrategy();
            ICalculateStrategy calculateStrategy = factoryStrategy.GetStrategyCalculate(questNumber);
            var calculateContext = new Context(calculateStrategy);

            var registeredResults = calculateContext.Calculate(_results);
            registeredResults.Add("Время теста", time);
            if (timeOut && (questNumber == 1 || questNumber == 2))
                registeredResults.Add("Время истекло", true);
            if (questNumber == 3)
                registeredResults.Add("Интервал между нажатиями", 2000.0);
            //registeredResults.Add("Интервал между нажатиями", intervalsBetweenPressedForQuest3.Count > 1 ? intervalsBetweenPressedForQuest3.Average(a => a.TotalMilliseconds) : 400.0);
            Results?.Invoke(this, registeredResults);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.SwitchAttention2"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    <Style TargetType="local:Cell">
        <Setter Property="Background" Value="#00000000"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Cell">
                    <Border x:Name="border" Background="WhiteSmoke" BorderBrush="Black" BorderThickness="0.3">
                        <TextBlock x:Name="tbx" IsHitTestVisible="False" HorizontalAlignment="Center" VerticalAlignment="Center"
                                       Foreground="{Binding Color, RelativeSource={RelativeSource FindAncestor,
                                AncestorType={x:Type local:Cell}}}"
                                       Text="{Binding Number, RelativeSource={RelativeSource FindAncestor,
                                AncestorType={x:Type local:Cell}}}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Mark, RelativeSource={RelativeSource Self}}" Value="true">
                            <Setter TargetName="border" Property="Background" Value="LightGreen"/>
                        </DataTrigger>
                        <EventTrigger RoutedEvent="MouseDown">
                            <EventTrigger.Actions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="border">
                                            <EasingColorKeyFrame KeyTime="0:0:0" Value="WhiteSmoke"/>
                                            <EasingColorKeyFrame KeyTime="0:0:0.2" Value="LightGreen"/>
                                            <EasingColorKeyFrame KeyTime="0:0:0.5" Value="WhiteSmoke"/>
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:SwitchAttentionQuest">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SwitchAttentionQuest">
                    <Border Background="{TemplateBinding Background}">
                        <Viewbox>
                            <Grid Width="1920"
                                  Height="1080">
                                <Viewbox Height="800" Width="800">
                                    <ContentControl FontSize="24" Content="{Binding Canva, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:SwitchAttentionQuest}}}"/>
                                </Viewbox>
                                <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:SwitchAttentionQuest}}}">
                                    <ContentPresenter.Resources>
                                        <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                            <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                        </DataTemplate>
                                    </ContentPresenter.Resources>
                                </ContentPresenter>
                            </Grid>
                        </Viewbox>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:SwitchAttention2ViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SwitchAttention2ViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <Border Visibility="{Binding IsMessageBoxVisible, 
                                                         RelativeSource={RelativeSource FindAncestor,
                                                         AncestorType={x:Type local:SwitchAttention2ViewModel}},
                                                         Converter={StaticResource BooleanToVisibilityConverter}}" Background="#7F000000">
                                <tests:MessageBoxControl Message="{Binding Message,
                                                         RelativeSource={RelativeSource FindAncestor,
                                                         AncestorType={x:Type local:SwitchAttention2ViewModel}}}"/>
                            </Border>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:SwitchAttention2ViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\NewStrategiesCalcllateResults\CalculateResultsForQ1.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2.NewStrategiesCalcllateResults
{
    class CalculateResultsForQ1
    {
        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            List<PairColorNumber> etalonBlack = new List<PairColorNumber>()
            {
                new PairColorNumber(ColorCell.Black,1),
                new PairColorNumber(ColorCell.Black,2),
                new PairColorNumber(ColorCell.Black,3),
                new PairColorNumber(ColorCell.Black,4),
                new PairColorNumber(ColorCell.Black,5),
                new PairColorNumber(ColorCell.Black,6),
                new PairColorNumber(ColorCell.Black,7),
                new PairColorNumber(ColorCell.Black,8),
                new PairColorNumber(ColorCell.Black,9),
                new PairColorNumber(ColorCell.Black,10),
                new PairColorNumber(ColorCell.Black,11),
                new PairColorNumber(ColorCell.Black,12),
                new PairColorNumber(ColorCell.Black,13),
                new PairColorNumber(ColorCell.Black,14),
                new PairColorNumber(ColorCell.Black,15),
                new PairColorNumber(ColorCell.Black,16),
                new PairColorNumber(ColorCell.Black,17),
                new PairColorNumber(ColorCell.Black,18),
                new PairColorNumber(ColorCell.Black,19),
                new PairColorNumber(ColorCell.Black,20),
                new PairColorNumber(ColorCell.Black,21),
                new PairColorNumber(ColorCell.Black,22),
                new PairColorNumber(ColorCell.Black,23),
                new PairColorNumber(ColorCell.Black,24),
                new PairColorNumber(ColorCell.Black,25)
            };
            List<Block> blocks = new List<Block>();
            int blockIndex = 0;
            var block = new Block(new List<PairColorNumber>(), blockIndex);
            blocks.Add(block);
            for (int i = 0; i < _results.Count; i++)
            {
                if (block.BlockData.Count > 0)
                {
                    if (_results[i].Color == ColorCell.Black)
                    {
                        if (block.BlockData.Last().Number + 1 == _results[i].Number)
                        {
                            block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                        }
                        else
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                            blocks.Add(block);
                        }
                    }
                    else
                    {
                        if (block.BlockData.Count != 0)
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            blocks.Add(block);
                        }
                    }
                }
                else if (block.BlockData.Count == 0)
                {
                    if (_results[i].Color == ColorCell.Black)
                    {
                        block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                    }
                    else
                    {
                        if (block.BlockData.Count != 0)
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            blocks.Add(block);
                        }
                    }
                }
            }

            blocks = blocks.Where(b => b.BlockData.Count > 0).ToList();

            var checkZeroBlockData = blocks.Any(a => a.BlockData.Count == 0);

            var sorted = !checkZeroBlockData ? blocks.OrderBy(o => o.BlockData.First().Number) : new List<Block>().AsEnumerable();//сортируем по первому элементу блока по возрастанию

            var startBlocks = sorted.Where(f => f.BlockData.First().Number == sorted.First().BlockData.First().Number);//выборка стартовых блоков

            var listChains = new List<List<Block>>();//список возможных цепочек

            foreach (var startBlock in startBlocks)
            {
                var chain = new List<Block>();
                chain.Add(startBlock);
                while (true)
                {
                    Block bcur = null;
                    for (int i = 0; i < sorted.Count(); i++)
                    {
                        if (bcur == null)
                        {
                            var findBlock = sorted.FirstOrDefault(f => f.BlockData.First().Number >= chain.Last().BlockData.Last().Number && !chain.Any(a => a.Index == f.Index));
                            if (findBlock != null)
                                bcur = findBlock;
                            else break;
                        }
                        else
                        {
                            var findBlock = sorted.FirstOrDefault(f => f.BlockData.First().Number >= chain.Last().BlockData.Last().Number && !chain.Any(a => a.Index == f.Index));
                            if (findBlock != null && findBlock != bcur)
                                bcur = findBlock;
                            else break;
                        }
                    }
                    if (bcur != null)
                        chain.Add(bcur);
                    else
                        break;
                    bcur = null;
                }
                listChains.Add(chain);
            }

            int countErrors = 0;
            var errorsChains = new List<int>();
            foreach (var chain in listChains)
            {
                int errorsChain = 0;
                for (int i = 0; i < chain.Count; i++)
                {
                    if (i == 0)
                    {
                        var MustBe = etalonBlack.IndexOf(chain.First().BlockData.First()) + 1;
                        var real = blocks.Where(w => w.Index < chain[i].Index).Sum(s => s.BlockData.Count);
                        if (MustBe > real)
                            errorsChain = errorsChain + MustBe;
                        else
                            errorsChain = errorsChain + real;
                    }
                    else
                    {
                        var indexLeft = etalonBlack.IndexOf(chain[i - 1].BlockData.Last()) + 1;
                        var indexRight = etalonBlack.IndexOf(chain[i].BlockData.First()) + 1;
                        var MustBe = indexRight - indexLeft;
                        var indexLeftReal = _results.FindIndex(f => f.Index == chain[i - 1].BlockData.Last().IndexInResult) + 1;
                        var indexRightReal = _results.FindIndex(f => f.Index == chain[i].BlockData.First().IndexInResult) + 1;
                        var real = indexRightReal - indexLeftReal;
                        if (MustBe > real)
                            errorsChain = errorsChain + MustBe;
                        else
                            errorsChain = errorsChain + real;
                    }
                }
                errorsChains.Add(errorsChain);
            }

            if (errorsChains.Count != 0)
                countErrors = errorsChains.Min();

            //ищем пропущенные числа
            var selectedNumbersInResults = _results.Select(s => new PairColorNumber(s.Color, s.Number));
            IEnumerable<PairColorNumber> gapsedNumbers = etalonBlack.Except(selectedNumbersInResults, new PairColorNumberComparer()).Where(w => w.Color == ColorCell.Black);

            countErrors = countErrors + gapsedNumbers.Count();

            var nonBlack = _results.Where(f => f.Color != ColorCell.Black);

            countErrors = countErrors + nonBlack.Count();

            var results = new Dictionary<string, object>() { ["Ряд"] = _results, ["Ошибки"] = countErrors };
            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\NewStrategiesCalcllateResults\CalculateResultsForQ2.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2.NewStrategiesCalcllateResults
{
    class CalculateResultsForQ2
    {
        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            List<PairColorNumber> etalonRed = new List<PairColorNumber>()
            {
                new PairColorNumber(ColorCell.Red,48),
                new PairColorNumber(ColorCell.Red,46),
                new PairColorNumber(ColorCell.Red,44),
                new PairColorNumber(ColorCell.Red,42),
                new PairColorNumber(ColorCell.Red,40),
                new PairColorNumber(ColorCell.Red,38),
                new PairColorNumber(ColorCell.Red,36),
                new PairColorNumber(ColorCell.Red,34),
                new PairColorNumber(ColorCell.Red,32),
                new PairColorNumber(ColorCell.Red,30),
                new PairColorNumber(ColorCell.Red,28),
                new PairColorNumber(ColorCell.Red,26),
                new PairColorNumber(ColorCell.Red,24),
                new PairColorNumber(ColorCell.Red,22),
                new PairColorNumber(ColorCell.Red,20),
                new PairColorNumber(ColorCell.Red,18),
                new PairColorNumber(ColorCell.Red,16),
                new PairColorNumber(ColorCell.Red,14),
                new PairColorNumber(ColorCell.Red,12),
                new PairColorNumber(ColorCell.Red,10),
                new PairColorNumber(ColorCell.Red,8),
                new PairColorNumber(ColorCell.Red,6),
                new PairColorNumber(ColorCell.Red,4),
                new PairColorNumber(ColorCell.Red,2)
            };

            List<Block> blocks = new List<Block>();
            int blockIndex = 0;
            var block = new Block(new List<PairColorNumber>(), blockIndex);
            blocks.Add(block);
            for (int i = 0; i < _results.Count; i++)
            {
                if (block.BlockData.Count > 0)
                {
                    if (_results[i].Color == ColorCell.Red)
                    {
                        if (block.BlockData.Last().Number - 2 == _results[i].Number)
                        {
                            block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                        }
                        else
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                            blocks.Add(block);
                        }
                    }
                    else
                    {
                        if (block.BlockData.Count != 0)
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            blocks.Add(block);
                        }
                        //красный ошибка
                    }
                }
                else if (block.BlockData.Count == 0)
                {
                    if (_results[i].Color == ColorCell.Red)
                    {
                        block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                    }
                    else
                    {
                        if (block.BlockData.Count != 0)
                        {
                            blockIndex++;
                            block = new Block(new List<PairColorNumber>(), blockIndex);
                            blocks.Add(block);
                        }
                        //красный ошибка
                    }
                }
            }

            blocks = blocks.Where(b => b.BlockData.Count > 0).ToList();

            var checkZeroBlockData = blocks.Any(a => a.BlockData.Count == 0);
            var sorted = !checkZeroBlockData ? blocks.OrderByDescending(o => o.BlockData.First().Number) : new List<Block>().AsEnumerable();//сортируем по первому элементу блока по убыванию

            var startBlocks = sorted.Where(f => f.BlockData.First().Number == sorted.First().BlockData.First().Number);//выборка стартовых блоков

            var listChains = new List<List<Block>>();//список возможных цепочек

            foreach (var startBlock in startBlocks)
            {
                var chain = new List<Block>();
                chain.Add(startBlock);
                while (true)
                {
                    Block bcur = null;
                    for (int i = 0; i < sorted.Count(); i++)
                    {
                        if (bcur == null)
                        {
                            var findBlock = sorted.FirstOrDefault(f => f.BlockData.First().Number < chain.Last().BlockData.Last().Number && !chain.Any(a => a.Index == f.Index));
                            if (findBlock != null)
                                bcur = findBlock;
                            else break;
                        }
                        else
                        {
                            var findBlock = sorted.FirstOrDefault(f => f.BlockData.First().Number > bcur.BlockData.First().Number && !chain.Any(a => a.Index == f.Index));
                            if (findBlock != null)
                                bcur = findBlock;
                            else break;
                        }
                    }
                    if (bcur != null)
                        chain.Add(bcur);
                    else
                        break;
                    bcur = null;
                }
                listChains.Add(chain);
            }

            int countErrors = 0;
            var errorsChains = new List<int>();
            foreach (var chain in listChains)
            {
                int errorsChain = 0;
                for (int i = 0; i < chain.Count; i++)
                {
                    if (i == 0)
                    {
                        var MustBe = etalonRed.IndexOf(chain.First().BlockData.First()) + 1;
                        var real = blocks.Where(w => w.Index < chain[i].Index).Sum(s => s.BlockData.Count);
                        if (MustBe > real)
                            errorsChain = errorsChain + MustBe;
                        else
                            errorsChain = errorsChain + real;
                    }
                    else
                    {
                        var indexLeft = etalonRed.IndexOf(chain[i - 1].BlockData.Last()) + 1;
                        var indexRight = etalonRed.IndexOf(chain[i].BlockData.First()) + 1;
                        var MustBe = indexRight - indexLeft;
                        var indexLeftReal = _results.FindIndex(f => f.Index == chain[i - 1].BlockData.Last().IndexInResult) + 1;
                        var indexRightReal = _results.FindIndex(f => f.Index == chain[i].BlockData.First().IndexInResult) + 1;
                        var real = indexRightReal - indexLeftReal;
                        if (MustBe > real)
                            errorsChain = errorsChain + MustBe;
                        else
                            errorsChain = errorsChain + real;
                    }
                }
                errorsChains.Add(errorsChain);
            }

            if (errorsChains.Count != 0)
                countErrors = errorsChains.Min();

            //ищем пропущенные числа
            var selectedNumbersInResults = _results.Select(s => new PairColorNumber(s.Color, s.Number));
            IEnumerable<PairColorNumber> gapsedNumbers = etalonRed.Except(selectedNumbersInResults, new PairColorNumberComparer()).Where(w => w.Color == ColorCell.Red);

            countErrors = countErrors + gapsedNumbers.Count();

            var nonBlack = _results.Where(f => f.Color != ColorCell.Red);

            countErrors = countErrors + nonBlack.Count();

            var results = new Dictionary<string, object>() { ["Ряд"] = _results, ["Ошибки"] = countErrors };
            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\NewStrategiesCalcllateResults\CalculateResultsForQ3Q4.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2.NewStrategiesCalcllateResults
{
    #region Strategy3
    public class Quest3CalculateResults : ICalculateStrategy
        {
            public List<PairColorNumber> etalonBlackRed = new List<PairColorNumber>()
                {
                    new PairColorNumber(ColorCell.Black,1),
                    new PairColorNumber(ColorCell.Red,48),
                    new PairColorNumber(ColorCell.Black,2),
                     new PairColorNumber(ColorCell.Red,46),
                    new PairColorNumber(ColorCell.Black,3),
                     new PairColorNumber(ColorCell.Red,44),
                    new PairColorNumber(ColorCell.Black,4),
                     new PairColorNumber(ColorCell.Red,42),
                    new PairColorNumber(ColorCell.Black,5),
                     new PairColorNumber(ColorCell.Red,40),
                    new PairColorNumber(ColorCell.Black,6),
                     new PairColorNumber(ColorCell.Red,38),
                    new PairColorNumber(ColorCell.Black,7),
                     new PairColorNumber(ColorCell.Red,36),
                    new PairColorNumber(ColorCell.Black,8),
                     new PairColorNumber(ColorCell.Red,34),
                    new PairColorNumber(ColorCell.Black,9),
                     new PairColorNumber(ColorCell.Red,32),
                    new PairColorNumber(ColorCell.Black,10),
                     new PairColorNumber(ColorCell.Red,30),
                    new PairColorNumber(ColorCell.Black,11),
                     new PairColorNumber(ColorCell.Red,28),
                    new PairColorNumber(ColorCell.Black,12),
                     new PairColorNumber(ColorCell.Red,26),
                    new PairColorNumber(ColorCell.Black,13),
                     new PairColorNumber(ColorCell.Red,24),
                    new PairColorNumber(ColorCell.Black,14),
                     new PairColorNumber(ColorCell.Red,22),
                    new PairColorNumber(ColorCell.Black,15),
                     new PairColorNumber(ColorCell.Red,20),
                    new PairColorNumber(ColorCell.Black,16),
                     new PairColorNumber(ColorCell.Red,18),
                    new PairColorNumber(ColorCell.Black,17),
                     new PairColorNumber(ColorCell.Red,16),
                    new PairColorNumber(ColorCell.Black,18),
                     new PairColorNumber(ColorCell.Red,14),
                    new PairColorNumber(ColorCell.Black,19),
                     new PairColorNumber(ColorCell.Red,12),
                    new PairColorNumber(ColorCell.Black,20),
                     new PairColorNumber(ColorCell.Red,10),
                    new PairColorNumber(ColorCell.Black,21),
                     new PairColorNumber(ColorCell.Red,8),
                    new PairColorNumber(ColorCell.Black,22),
                     new PairColorNumber(ColorCell.Red,6),
                    new PairColorNumber(ColorCell.Black,23),
                     new PairColorNumber(ColorCell.Red,4),
                    new PairColorNumber(ColorCell.Black,24),
                     new PairColorNumber(ColorCell.Red,2),
                    new PairColorNumber(ColorCell.Black,25)
                };

            public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
            {
                List<Block> blocks = new List<Block>();
                int blockIndex = 0;
                var block = new Block(new List<PairColorNumber>(), blockIndex);
                blocks.Add(block);
                for (int i = 0; i < _results.Count; i++)
                {
                    if (block.BlockData.Count > 0)
                    {
                        if (_results[i].Color == ColorCell.Red)
                        {
                            if (block.BlockData.Last().Color == ColorCell.Black)
                            {
                                if (block.BlockData.Last().Number == (50 - _results[i].Number) / 2)
                                {
                                    block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                                }
                                else
                                {
                                    blockIndex++;
                                    block = new Block(new List<PairColorNumber>(), blockIndex);
                                    block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                                    blocks.Add(block);
                                }
                            }
                            else
                            {
                                blockIndex++;
                                block = new Block(new List<PairColorNumber>(), blockIndex);
                                block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                                blocks.Add(block);
                            }
                        }
                        else if (_results[i].Color == ColorCell.Black)
                        {
                            if (block.BlockData.Last().Color == ColorCell.Red)
                            {
                                if (block.BlockData.Last().Number == (50 - _results[i].Number) - (_results[i].Number - 2))
                                {
                                    block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                                }
                                else
                                {
                                    blockIndex++;
                                    block = new Block(new List<PairColorNumber>(), blockIndex);
                                    block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                                    blocks.Add(block);
                                }
                            }
                            else
                            {
                                blockIndex++;
                                block = new Block(new List<PairColorNumber>(), blockIndex);
                                block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number) { IndexInResult = _results[i].Index });
                                blocks.Add(block);
                            }
                        }
                    }
                    else if (block.BlockData.Count == 0)
                    {
                        blockIndex++;
                        block.BlockData.Add(new PairColorNumber(_results[i].Color, _results[i].Number));
                    }
                }


                PairColorNumber pair = null;
                foreach (var curBlock in blocks)
                {
                    if (pair == null)
                    {
                        if (curBlock.BlockData.Count() != 0)
                            pair = curBlock.BlockData.First();
                    }
                    else
                    {
                        var index = etalonBlackRed.IndexOf(pair);
                        var currentIndex = etalonBlackRed.IndexOf(curBlock.BlockData.First());
                        if (currentIndex < index)
                            pair = curBlock.BlockData.First();
                    }
                }

                var startBlocks = pair != null ? blocks.Where(f => f.BlockData.First().Color == pair.Color && f.BlockData.First().Number == pair.Number) : null;//выборка стартовых блоков
                var listChains = new List<List<Block>>();//список возможных цепочек
                var sorted = blocks.OrderBy(f => etalonBlackRed.IndexOf(f.BlockData.First()));

                if (startBlocks != null)
                {
                    var exceptedBlocks = sorted;
                    foreach (var startBlock in startBlocks)
                    {
                        var chain = new List<Block>();
                        chain.Add(startBlock);
                        while (true)
                        {
                            var rightBlocks = sorted.Where(f => etalonBlackRed.FindIndex(indexLeft => indexLeft.Color == chain.Last().BlockData.Last().Color && indexLeft.Number == chain.Last().BlockData.Last().Number) <
                                                                                 etalonBlackRed.FindIndex(indexRight => indexRight.Color == f.BlockData.First().Color && indexRight.Number == f.BlockData.First().Number) &&
                                                                                 !chain.Any(a => a.Index == f.Index));
                            Block bCur2 = null;
                            foreach (var value in rightBlocks)
                            {
                                if (bCur2 == null)
                                    bCur2 = value;
                                else if (etalonBlackRed.FindIndex(indexLeft => indexLeft.Color == bCur2.BlockData.First().Color && indexLeft.Number == bCur2.BlockData.First().Number) >
                                    etalonBlackRed.FindIndex(indexLeft => indexLeft.Color == value.BlockData.First().Color && indexLeft.Number == value.BlockData.First().Number))
                                {
                                    bCur2 = value;
                                }
                            }

                            if (bCur2 != null)
                                chain.Add(bCur2);
                            else
                                break;
                            bCur2 = null;

                            #region oldCode
                            //Block bCur = null;
                            //for (int i = 0; i < sorted.Count(); i++)
                            //{
                            //    if (bCur == null)
                            //    {
                            //        var findBlock = sorted.FirstOrDefault(f => etalonBlackRed.FindIndex(indexLeft => indexLeft.Color == chain.Last().BlockData.Last().Color && indexLeft.Number == chain.Last().BlockData.Last().Number) <
                            //                                                    etalonBlackRed.FindIndex(indexRight => indexRight.Color == f.BlockData.First().Color && indexRight.Number == f.BlockData.First().Number) &&
                            //                                                    !chain.Any(a => a.Index == f.Index));
                            //        if (findBlock != null)
                            //            bCur = findBlock;
                            //        else break;
                            //    }
                            //    else
                            //    {
                            //        var findBlock = sorted.FirstOrDefault(f => etalonBlackRed.FindIndex(indexLeft => indexLeft.Color == bCur.BlockData.Last().Color && indexLeft.Number == bCur.BlockData.Last().Number) >
                            //                                                    etalonBlackRed.FindIndex(indexRight => indexRight.Color == f.BlockData.First().Color && indexRight.Number == f.BlockData.First().Number) &&
                            //                                                    !chain.Any(a => a.Index == f.Index));
                            //        if (findBlock != null)
                            //            bCur = findBlock;
                            //        else break;
                            //    }

                            //}
                            //if (bCur != null)
                            //    chain.Add(bCur);
                            //else
                            //    break;
                            //bCur = null;
                            #endregion
                        }
                        listChains.Add(chain);
                    }
                }

                int countErrors = 0;
                var errorsChains = new List<int>();
                foreach (var chain in listChains)
                {
                    int errorsChain = 0;
                    for (int i = 0; i < chain.Count; i++)
                    {
                        if (i == 0)
                        {
                            var MustBe = etalonBlackRed.FindIndex(f => f.Color == chain.First().BlockData.First().Color && f.Number == chain.First().BlockData.First().Number);
                            var real = blocks.Where(w => w.Index < chain[i].Index).Sum(s => s.BlockData.Count);
                            if (MustBe > real)
                                errorsChain = errorsChain + MustBe;
                            else
                                errorsChain = errorsChain + real;
                        }
                        else
                        {
                            var indexLeft = etalonBlackRed.FindIndex(f => f.Color == chain[i - 1].BlockData.Last().Color && f.Number == chain[i - 1].BlockData.Last().Number);
                            var indexRight = etalonBlackRed.FindIndex(f => f.Color == chain[i].BlockData.First().Color && f.Number == chain[i].BlockData.First().Number);
                            var MustBe = indexRight - indexLeft;
                            var indexLeftReal = _results.FindIndex(f => f.Index == chain[i - 1].BlockData.Last().IndexInResult);
                            var indexRightReal = _results.FindIndex(f => f.Index == chain[i].BlockData.First().IndexInResult);
                            var real = indexRightReal - indexLeftReal;
                            if (MustBe > real)
                                errorsChain = errorsChain + MustBe - 1;
                            else
                                errorsChain = errorsChain + real - 1;
                        }
                    }
                    errorsChains.Add(errorsChain);
                }

                if (errorsChains.Count != 0)
                    countErrors = errorsChains.Min();


                var selectedNumbersInResults = _results.Select(s => new PairColorNumber(s.Color, s.Number));

                //ищем одинаковые(повторы)
                var countClone = selectedNumbersInResults.GroupBy(g => new { g.Color, g.Number }).Where(w => w.Count() > 1).Sum(s => s.Count() - 1);

                countErrors = countErrors + countClone;

                var results = new Dictionary<string, object>()
                {
                    ["Ряд"] = _results,
                    ["Ошибки"] = countErrors
                };
                return results;
            }
        }
        #endregion
    }

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\OldStrategiesCalculateResults\BaseClasses.cs


namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2.OldStrategiesCalculateResults
{
    class Number
    {
        public int Num { get; set; }
        public NumberColor Color { get; set; }
    }

    enum NumberColor { Red, Black }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\OldStrategiesCalculateResults\CalculateResultsForQ1.cs


using System;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2.OldStrategiesCalculateResults
{
    class CalculateResultsForQ1
    {
        private List<Block> Roots;
        private List<Block> Blocks;
        private int Mistakes;
        private bool RootBlocksFound;
        private bool EndCount;

        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {

            int I;
            Mistakes = 24;
            RootBlocksFound = false;
            EndCount = false;
            Roots = new List<Block>();
            Blocks = new List<Block>();

            RowToBlocks(_results);
            if (!EndCount)
            {
                FillLinks();
                for (I = 0; I <= Roots.Count - 1; I++)
                {
                    Recurse(Roots[I].StartPos, Roots[I]);
                }
            }

            var results = new Dictionary<string, object>() { ["Ряд"] = _results, ["Ошибки"] = Mistakes };
            return results;
        }

        private void Recurse(int S, Block Block)
        {
            int I, M;

            if (Block.Links.Count != 0)
            {
                for (I = 0; I <= Block.Links.Count - 1; I++)
                {
                    M = Block.Links[I].StartPos - Block.EndPos - 1;

                    if (Block.Links[I].StartNum <= (Block.StartNum - Block.StartPos + Block.EndPos))
                    {
                        M = M + Block.StartNum - Block.StartPos + Block.EndPos - Block.Links[I].StartNum + 1;
                    }
                    M = Math.Max(M, Math.Abs(Block.Links[I].StartNum - Block.StartNum - Block.EndPos + Block.StartPos - 1));
                    Recurse(S + M, Block.Links[I]);
                }
            }
            else
            {
                if (S < Mistakes)
                {
                    Mistakes = S;
                }
            }
        }



        private void FillLinks()
        {
            int I, J, K;
            List<Block> Starts = new List<Block>();
            List<Block> Ends = new List<Block>();
            List<Block> Del = new List<Block>();

            for (I = 0; I <= Blocks.Count - 1; I++)
            {
                Ends.Add(Blocks[I]);
            }

            for (I = 1; I <= 25; I++)
            {
                if (!RootBlocksFound)
                {
                    for (J = 0; J <= Ends.Count - 1; J++)
                    {
                        if (I == Ends[J].StartNum)
                        {
                            Roots.Add(Ends[J]);
                            Starts.Add(Ends[J]);
                            Del.Add(Ends[J]);
                        }
                    }

                    for (J = 0; J <= Del.Count - 1; J++)
                    {
                        Ends.Remove(Del[J]);
                    }
                    Del.Clear();
                    RootBlocksFound = true;
                }
                else
                {
                    for (J = 0; J <= Ends.Count - 1; J++)
                    {
                        if (I == Ends[J].StartNum)
                        {
                            for (K = 0; K <= Starts.Count - 1; K++)
                            {
                                if (Starts[K].Number < Ends[J].Number)
                                {
                                    Starts[K].Links.Add(Ends[J]);
                                }
                            }
                            Starts.Add(Ends[J]);
                            Del.Add(Ends[J]);
                        }
                    }
                    for (J = 0; J <= Del.Count - 1; J++)
                    {
                        Ends.Remove(Del[J]);
                    }
                    Del.Clear();
                }
            }
        }


        private void RowToBlocks(List<MatrixCellData> Row)
        {
            int I, NumberOfBlock, Start, J;
            Block B;
            bool BlockIsStarted;

            NumberOfBlock = 0;
            Start = 0;
            BlockIsStarted = false;
            if (Row.Count == 1)
            {
                Mistakes = 24;
                EndCount = true;
                return;
            }
            else
            {
                for (I = 0; I <= Row.Count - 2; I++)
                {
                    if ((!BlockIsStarted) && (ToNumber(Row[I]).Color == NumberColor.Black))
                    {
                        BlockIsStarted = true;
                        Start = I;
                    }

                    if (BlockIsStarted && ((ToNumber(Row[I + 1]).Num != (ToNumber(Row[I]).Num + 1)) || (ToNumber(Row[I + 1]).Color == NumberColor.Red)))
                    {
                        B = new Block();
                        B.Number = NumberOfBlock;
                        B.StartNum = ToNumber(Row[Start]).Num;
                        B.StartPos = Start;
                        B.EndPos = I;
                        B.Links = new List<Block>();
                        Blocks.Add(B);
                        NumberOfBlock++;
                        BlockIsStarted = false;
                    }

                    if (I == Row.Count - 2)
                    {
                        if (BlockIsStarted)
                        {
                            B = new Block();
                            B.Number = NumberOfBlock;
                            B.StartNum = ToNumber(Row[Start]).Num;
                            B.StartPos = Start;
                            B.EndPos = Row.Count - 1;
                            B.Links = new List<Block>();
                            Blocks.Add(B);
                            NumberOfBlock++;
                            BlockIsStarted = false;
                        }
                        else
                        {
                            B = new Block();
                            B.Number = NumberOfBlock;
                            B.StartNum = 25;
                            B.StartPos = Row.Count - 1;
                            B.EndPos = Row.Count - 1;
                            B.Links = new List<Block>();
                            Blocks.Add(B);
                            NumberOfBlock++;
                            BlockIsStarted = false;
                        }
                    }
                }
            }
        }

        private Number ToNumber(MatrixCellData S)
        {
            Number Num = new Number();
            if (S.Color == ColorCell.Red)
                Num.Color = NumberColor.Red;
            else
                Num.Color = NumberColor.Black;
            Num.Num = S.Number;
            return Num;
        }

        public class Block
        {
            public int Number { get; set; }
            public int StartNum { get; set; }
            public int StartPos { get; set; }
            public int EndPos { get; set; }
            public List<Block> Links { get; set; }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\OldStrategiesCalculateResults\CalculateResultsForQ2.cs


using System;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2.OldStrategiesCalculateResults
{
    class CalculateResultsForQ2
    {
        private List<Block> Roots;
        private List<Block> Blocks;
        private int Mistakes;
        private bool RootBlocksFound;
        private bool EndCount;

        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            int I;
            Mistakes = 23;
            RootBlocksFound = false;
            EndCount = false;
            Roots = new List<Block>();
            Blocks = new List<Block>();

            RowToBlocks(_results);
            if (!EndCount)
            {
                FillLinks();
                for (I = 0; I <= Roots.Count - 1; I++)
                {
                    Recurse(Roots[I].StartPos, Roots[I]);
                }
            }

            var results = new Dictionary<string, object>() { ["Ряд"] = _results, ["Ошибки"] = Mistakes };
            return results;
        }

        private void Recurse(int S, Block Block)
        {
            int I, M;

            if (Block.Links.Count != 0)
            {
                for (I = 0; I <= Block.Links.Count - 1; I++)
                {
                    M = Block.Links[I].StartPos - Block.EndPos - 1;

                    if (Block.Links[I].StartNum >= (Block.StartNum + Block.StartPos - Block.EndPos))
                    {
                        M = M + Block.Links[I].StartNum - Block.StartNum - Block.StartPos + Block.EndPos + 1;
                    }
                    M = Math.Max(M, Math.Abs(Block.Links[I].StartNum - Block.StartNum + Block.EndPos - Block.StartPos + 1));
                    Recurse(S + M, Block.Links[I]);
                }
            }
            else
            {
                if (S < Mistakes)
                {
                    Mistakes = S;
                }
            }
        }



        private void FillLinks()
        {
            int I, J, K;
            List<Block> Starts = new List<Block>();
            List<Block> Ends = new List<Block>();
            List<Block> Del = new List<Block>();

            for (I = 0; I <= Blocks.Count - 1; I++)
            {
                Ends.Add(Blocks[I]);
            }

            for (I = 24; I >= 1; I--)
            {
                if (!RootBlocksFound)
                {
                    for (J = 0; J <= Ends.Count - 1; J++)
                    {
                        if (I == Ends[J].StartNum)
                        {
                            Roots.Add(Ends[J]);
                            Starts.Add(Ends[J]);
                            Del.Add(Ends[J]);
                        }
                    }

                    for (J = 0; J <= Del.Count - 1; J++)
                    {
                        Ends.Remove(Del[J]);
                    }
                    Del.Clear();
                    RootBlocksFound = true;
                }
                else
                {
                    for (J = 0; J <= Ends.Count - 1; J++)
                    {
                        if (I == Ends[J].StartNum)
                        {
                            for (K = 0; K <= Starts.Count - 1; K++)
                            {
                                if (Starts[K].Number < Ends[J].Number)
                                {
                                    Starts[K].Links.Add(Ends[J]);
                                }
                            }
                            Starts.Add(Ends[J]);
                            Del.Add(Ends[J]);
                        }
                    }
                    for (J = 0; J <= Del.Count - 1; J++)
                    {
                        Ends.Remove(Del[J]);
                    }
                    Del.Clear();
                }
            }
        }


        private void RowToBlocks(List<MatrixCellData> Row)
        {
            int I, NumberOfBlock, Start, J;
            Block B;
            bool BlockIsStarted;

            NumberOfBlock = 0;
            Start = 0;
            BlockIsStarted = false;
            Blocks = new List<Block>();
            if (Row.Count == 1)
            {
                Mistakes = 23;
                EndCount = true;
                return;
            }
            else
            {
                for (I = 0; I <= Row.Count - 2; I++)
                {
                    if ((!BlockIsStarted) && (ToNumber(Row[I]).Color == NumberColor.Red))
                    {
                        BlockIsStarted = true;
                        Start = I;
                    }

                    if (BlockIsStarted && ((ToNumber(Row[I + 1]).Num != (ToNumber(Row[I]).Num - 1)) || (ToNumber(Row[I + 1]).Color == NumberColor.Black)))
                    {
                        B = new Block();
                        B.Number = NumberOfBlock;
                        B.StartNum = ToNumber(Row[Start]).Num;
                        B.StartPos = Start;
                        B.EndPos = I;
                        B.Links = new List<Block>();
                        Blocks.Add(B);
                        NumberOfBlock++;
                        BlockIsStarted = false;
                    }

                    if (I == Row.Count - 2)
                    {
                        if (BlockIsStarted)
                        {
                            B = new Block();
                            B.Number = NumberOfBlock;
                            B.StartNum = ToNumber(Row[Start]).Num;
                            B.StartPos = Start;
                            B.EndPos = Row.Count - 1;
                            B.Links = new List<Block>();
                            Blocks.Add(B);
                            NumberOfBlock++;
                            BlockIsStarted = false;
                        }
                        else
                        {
                            B = new Block();
                            B.Number = NumberOfBlock;
                            B.StartNum = 1;
                            B.StartPos = Row.Count - 1;
                            B.EndPos = Row.Count - 1;
                            B.Links = new List<Block>();
                            Blocks.Add(B);
                            NumberOfBlock++;
                            BlockIsStarted = false;
                        }
                    }
                }
            }
        }

        private Number ToNumber(MatrixCellData S)
        {
            Number Num = new Number();
            if (S.Color == ColorCell.Red)
            {
                Num.Color = NumberColor.Red;
                Num.Num = S.Number / 2;
            }
            else
            {
                Num.Color = NumberColor.Black;
                Num.Num = S.Number;
            }

            return Num;
        }

        public class Block
        {
            public int Number { get; set; }
            public int StartNum { get; set; }
            public int StartPos { get; set; }
            public int EndPos { get; set; }
            public List<Block> Links { get; set; }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\SwitchAttention2\OldStrategiesCalculateResults\CalculateResultsForQ3Q4.cs


using System;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.SwitchAttention2.OldStrategiesCalculateResults
{
    class CalculateResultsForQ3Q4
    {
        private List<MatrixCellData> Row;
        private List<Block> Roots;
        private int Mistakes = 0;
        private List<Block> Blocks;
        private bool RootBlocksFound;
        private bool EndCount;
        public Dictionary<string, object> Calculate(List<MatrixCellData> _results)
        {
            int I;
            Mistakes = 48;

            RootBlocksFound = false;
            Roots = new List<Block>();
            Blocks = new List<Block>();
            Row = _results;

            FindBlocks();
            if (!EndCount)
            {
                FillLinks();
                for (I = 0; I <= Roots.Count - 1; I++)
                {
                    Recurse(Roots[I].StartPos, Roots[I]);
                }
            }
            var results = new Dictionary<string, object>() { ["Ряд"] = _results, ["Ошибки"] = Mistakes };
            return results;
        }

        private Number ToNumber(MatrixCellData S)
        {
            Number Num = new Number();
            if (S.Color == ColorCell.Red)
            {
                Num.Color = NumberColor.Red;
                Num.Num = S.Number / 2;
            }
            else
            {
                Num.Color = NumberColor.Black;
                Num.Num = S.Number;
            }
            return Num;
        }

        private void FindBlocks()
        {
            int I, NumberOfBlock, J, Start, BlockSum;
            bool BlockIsStarted;

            NumberOfBlock = 0;
            Start = 0;
            Blocks = new List<Block>();
            BlockIsStarted = false;
            BlockSum = 0;

            if (Row.Count < 3)
            {
                Mistakes = 49 - Row.Count;
                EndCount = true;
                return;
            }
            else
            {
                for (I = 0; I <= Row.Count - 3; I++)
                {
                    if (!BlockIsStarted)
                    {
                        BlockIsStarted = true;
                        Start = I;
                        if ((ToNumber(Row[I]).Color == NumberColor.Black) && (ToNumber(Row[I + 1]).Color == NumberColor.Red))
                        {
                            BlockSum = ToNumber(Row[I]).Num + ToNumber(Row[I + 1]).Num;
                        }

                        if ((ToNumber(Row[I]).Color == NumberColor.Red) && (ToNumber(Row[I + 1]).Color == NumberColor.Black))
                        {
                            BlockSum = ToNumber(Row[I]).Num + ToNumber(Row[I + 1]).Num - 1;
                        }
                    }

                    if (BlockIsStarted)
                    {
                        if (I == Start && (!(((ToNumber(Row[I]).Color == NumberColor.Black) &&
                            (ToNumber(Row[I + 1]).Color == NumberColor.Red) &&
                            (ToNumber(Row[I + 2]).Color == NumberColor.Black) &&
                            (ToNumber(Row[I]).Num + ToNumber(Row[I + 1]).Num) == BlockSum &&
                            ((ToNumber(Row[I + 1]).Num + ToNumber(Row[I + 2]).Num) == BlockSum + 1)) ||

                            ((ToNumber(Row[I]).Color == NumberColor.Red) &&
                            (ToNumber(Row[I + 1]).Color == NumberColor.Black) &&
                            (ToNumber(Row[I + 2]).Color == NumberColor.Red) &&
                            ((ToNumber(Row[I]).Num + ToNumber(Row[I + 1]).Num) == BlockSum + 1) &&
                            (ToNumber(Row[I + 1]).Num + ToNumber(Row[I + 2]).Num == BlockSum)))))
                        {
                            Blocks.Add(Block_Create(NumberOfBlock, BlockSum, Start, I, Row[Start], Row[I]));
                            NumberOfBlock++;
                            BlockIsStarted = false;
                        }

                        if ((I != Start) && (!(((ToNumber(Row[I]).Color == NumberColor.Black) &&
                          (ToNumber(Row[I + 1]).Color == NumberColor.Red) &&
                          ((ToNumber(Row[I]).Num + ToNumber(Row[I + 1]).Num) == BlockSum)) ||
                          ((ToNumber(Row[I]).Color == NumberColor.Red) &&
                          (ToNumber(Row[I + 1]).Color == NumberColor.Black) &&
                          ((ToNumber(Row[I]).Num + ToNumber(Row[I + 1]).Num) == BlockSum + 1)))))
                        {
                            Blocks.Add(Block_Create(NumberOfBlock, BlockSum,Start, I, Row[Start], Row[I]));
                            NumberOfBlock++;
                            BlockIsStarted = false;
                        }
                    }

                    if (I == Row.Count - 3)
                        if (BlockIsStarted)
                        {
                            if (Row[I].Color == ColorCell.Black && Row[I].Number == 24)
                            {
                                Blocks.Add(Block_Create(NumberOfBlock, BlockSum, Start, Row.Count - 1, Row[Start], new MatrixCellData(ColorCell.Black, 25, 0)));
                                NumberOfBlock++;
                                BlockIsStarted = false;
                            }
                            else
                            {
                                Blocks.Add(Block_Create(NumberOfBlock, BlockSum, Start, Row.Count - 2, Row[Start], Row[Row.Count - 2]));
                                NumberOfBlock++;
                                BlockIsStarted = false;

                                Blocks.Add(Block_Create(NumberOfBlock, 0, Row.Count - 1, Row.Count - 1, new MatrixCellData(ColorCell.Black, 25, 0), new MatrixCellData(ColorCell.Black, 25, 0)));
                                NumberOfBlock++;
                                BlockIsStarted = false;
                            }
                        }
                        else
                        {
                            if (Row[I + 1].Color == ColorCell.Red && Row[I + 1].Number == 1)
                            {
                                Blocks.Add(Block_Create(NumberOfBlock, 25, Row.Count - 2, Row.Count - 1, new MatrixCellData(ColorCell.Red, 1, 0), new MatrixCellData(ColorCell.Black, 25, 0)));
                                NumberOfBlock++;
                                BlockIsStarted = false;
                            }
                            else
                            {
                                Blocks.Add(Block_Create(NumberOfBlock, 0, Row.Count - 2, Row.Count - 1, Row[Row.Count - 2], Row[Row.Count - 2]));
                                NumberOfBlock++;
                                BlockIsStarted = false;


                                Blocks.Add(Block_Create(NumberOfBlock, 0, Row.Count - 1, Row.Count - 1, new MatrixCellData(ColorCell.Black, 25, 0), new MatrixCellData(ColorCell.Black, 25, 0)));
                                NumberOfBlock++;
                                BlockIsStarted = false;
                            }
                        }
                    }
            }
        }

        private void FillLinks()
        {
            int I, J, K;

            var Starts = new List<Block>();
            var Ends = new List<Block>();
            var Del = new List<Block>();

            for (I = 0; I <= Blocks.Count - 1; I++)
            {
                Ends.Add(Blocks[I]);
            }

            for (I = 1; I <= 49; I++)
            {
                if (!RootBlocksFound)
                {
                    for (J = 0; J <= Ends.Count - 1; J++)
                    {
                        if (I == Ends[J].StartNum)
                        {
                            Roots.Add(Ends[J]);
                            Starts.Add(Ends[J]);
                            Del.Add(Ends[J]);
                           
                        }
                    }

                    for (J = 0; J <= Del.Count - 1; J++)
                    {
                        Ends.Remove(Del[J]);
                    }
                    Del.Clear();
                    RootBlocksFound = true;
                }
                else
                {
                    for (J = 0; J <= Ends.Count - 1; J++)
                    {
                        if (I == Ends[J].StartNum)
                        {
                            for (K = 0; K <= Starts.Count - 1; K++)
                            {
                                if (Starts[K].Number < Ends[J].Number)
                                {
                                    Starts[K].Links.Add(Ends[J]);
                                }
                            }
                            Starts.Add(Ends[J]);
                            Del.Add(Ends[J]);
                        }
                    }

                    for (J = 0; J <= Del.Count - 1; J++)
                    {
                        Ends.Remove(Del[J]);
                    }
                    Del.Clear();
                }
            }
        }

        private void Recurse(int S, Block Block)
        {
            int I, M;

            if (Block.Links.Count != 0)
            {
                for (I = 0; I <= Block.Links.Count - 1; I++)
                {
                    M = Block.Links[I].StartPos - Block.EndPos - 1;

                    if (Block.Links[I].StartNum <= (Block.StartNum - Block.StartPos + Block.EndPos))
                    {
                        M = M + Block.StartNum - Block.StartPos + Block.EndPos - Block.Links[I].StartNum + 1;
                    }
                    M = Math.Max(M, Math.Abs(Block.Links[I].StartNum - Block.StartNum - Block.EndPos + Block.StartPos - 1));

                    if ((Math.Abs(25 - Block.Links[I].Sum) > Math.Abs(25 - Block.Sum)) && (Block.Links[I].Sum > 0) && (Block.Sum > 0))
                    {
                        M = M + 1;
                    }
                    Recurse(S + M, Block.Links[I]);
                }
            }
            else
            {
                if (S < Mistakes)
                {
                    Mistakes = S;
                }
            }
        }

        private Block Block_Create(int N, int S, int SP, int EP, MatrixCellData SN, MatrixCellData EN)
        {
            var block = new Block();
            block.Number = N;

            if (ToNumber(SN).Color == NumberColor.Black)
            {
                block.StartNum = 2 * ToNumber(SN).Num-1;
            }
            else
            {
                block.StartNum = 50 - 2 * ToNumber(SN).Num;
            }

            block.StartPos = SP;

            if (ToNumber(EN).Color == NumberColor.Black)
            {
                block.EndNum = 2 * ToNumber(EN).Num-1;
            }
            else
            {
                block.EndNum = 50 - 2 * ToNumber(EN).Num;
            }

            block.EndPos = EP;

            block.Links = new List<Block>();

            if (block.EndPos - block.StartPos > 0)
            {
                block.Sum = S;
            }
            else
                block.Sum = 0;

            return block;
        }

        class Block
        {
            public int Number { get; set; }
            public int Sum { get; set; }
            public int StartNum { get; set; }
            public int StartPos { get; set; }
            public int EndNum { get; set; }
            public int EndPos { get; set; }
            public List<Block> Links { get; set; }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Tepping310\Tepping310Control.cs


using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.Tepping310
{
    public class Tepping310Control : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler<bool> LedControling;
        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private Visibility _messageVisible = Visibility.Visible;

        public Visibility MessageVisible
        {
            get { return _messageVisible; }
            set 
            {
                _messageVisible = value;
                OnPropertyChanged();
            }
        }


        DispatcherTimer _timer = new DispatcherTimer();
        public Tepping310Control(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
                MessageVisible = Visibility.Hidden;
        }

        public void Start()
        {
            _timer.Interval = TimeSpan.FromSeconds(3);
            _timer.Tick += _timer_Tick;
            _timer.Start();
        }
        private int countSamples = 0;
        private bool _teppingIsActive = false;
        private List<int> TouchesIn10SecondIntervals = new List<int>();
        private void _timer_Tick(object sender, EventArgs e)
        {
            if (_teppingIsActive)
            {
                _teppingIsActive = false;
                LedControling(this, _teppingIsActive);
                TouchesIn10SecondIntervals.Add(countTouches);
                countTouches = 0;
                countSamples++;
                _timer.Interval = TimeSpan.FromSeconds(5);
                if (countSamples == 6)
                {
                    Stop();
                    ReturnResults();
                }
            }
            else
            {
                _timer.Interval = TimeSpan.FromSeconds(10);
                _teppingIsActive = true;
                LedControling(this, _teppingIsActive);
            }
        }

        private void ReturnResults()
        {
            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Количество касаний на 1-ом временном интервале"] = TouchesIn10SecondIntervals[0],
                ["Количество касаний на 2-ом временном интервале"] = TouchesIn10SecondIntervals[1],
                ["Количество касаний на 3-ом временном интервале"] = TouchesIn10SecondIntervals[2],
                ["Количество касаний на 4-ом временном интервале"] = TouchesIn10SecondIntervals[3],
                ["Количество касаний на 5-ом временном интервале"] = TouchesIn10SecondIntervals[4],
                ["Количество касаний на 6-ом временном интервале"] = TouchesIn10SecondIntervals[5]
            });
        }

        private int countTouches = 0;
        public void Touch()
        {
            if (_teppingIsActive)
                countTouches++;
        }

        public void Stop()
        {
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Tepping310\Tepping310ViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.Tepping310
{
    public class Tepping310ViewModel : TestBase
    {
        public override event EventHandler<Results> Results;
        private PultTepping Tepping;
        private PultLed Led;
        private Tepping310Control control;
        public Tepping310ViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            Manager.TraningTime = Common.GetSeconds(35);
            SetInstructions("tepping310");
        }

        public override FrameworkElement GetTestControl()
        {
            return new Tepping310Control(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new Tepping310Control(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            control = new Tepping310Control();
            TestCurrentView = control;
            Tepping = Pult as Pult.PultTepping;
            Tepping.TeppingValueChanged += Tepping_TeppingValueChanged;
            Tepping.Disconnected += Disconnected;
            Led = AdditionalPult as PultLed;
            Led.Disconnected += Disconnected;
            control.LedControling += Control_LedControling;
            Tepping.Start();
            control.Start();
        }

        public override void Start()
        {
            control = new Tepping310Control();
            TestCurrentView = control;
            Tepping = Pult as Pult.PultTepping;
            Tepping.TeppingValueChanged += Tepping_TeppingValueChanged;
            Tepping.Disconnected += Disconnected;
            Led = AdditionalPult as Pult.PultLed;
            Led.Disconnected += Disconnected;
            control.LedControling += Control_LedControling;
            Tepping.Start();
            control.Results += Control_Results;
            control.Start();
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Exception = e;
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Disconnected(object sender, DisconnectedEventArgs e)
        {
            Exception = e.Exception;
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) {Exception=e.Exception });
        }

        private void Control_LedControling(object sender, bool e)
        {
            try
            {
                Led.LedState = e;
            }
            catch (Exception ex)
            {
                Exception = ex;
                Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = new PultException("Ошибка пульта") });
            }

            if (e)
                Tepping.Start();
            else
                Tepping.Stop();
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Tepping_TeppingValueChanged(object sender, Pult.TeppingChangedEventArgs e)
        {
            if (e.Value)
                control.Touch();
        }

        public override void Stop()
        {
            base.Stop();
            if (Led != null)
            {
                if (Exception == null)
                    Led.LedState = false;
                Led.Disconnected -= Disconnected;
            }
            if (Tepping != null)
            {
                Tepping.Disconnected -= Disconnected;
                Tepping.TeppingValueChanged -= Tepping_TeppingValueChanged;
                Tepping.Stop();
            }
            if (control != null)
            {
                control.Results -= Control_Results;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Tepping310\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Tepping310"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:Tepping310Control">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Tepping310Control">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <tests:MessageBoxControl Visibility="{Binding MessageVisible,
                                                                          RelativeSource={RelativeSource 
                                                                          AncestorType={x:Type local:Tepping310Control}}}"
                                                             Message="Следите за светодиодом"/>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:Tepping310Control}}}">
                                    <ContentPresenter.Resources>
                                        <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                            <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                        </DataTemplate>
                                    </ContentPresenter.Resources>
                                </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:Tepping310ViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Tepping310ViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:Tepping310ViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TeppingTest\TeppingTestControl.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.TeppingTest
{
    public class TeppingTestControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private Visibility _messageVisible = Visibility.Visible;

        public Visibility MessageVisible
        {
            get { return _messageVisible; }
            set
            {
                _messageVisible = value;
                OnPropertyChanged();
            }
        }

        DispatcherTimer _timer = new DispatcherTimer();
        public TeppingTestControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
                MessageVisible = Visibility.Hidden;
        }

        public void Start()
        {
            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick += _timer_Tick;
            _timer.Start();
        }

        private int countSeconds;
        private List<int> TouchesIn5SecondIntervals = new List<int>();
        private List<int> TouchesIn10SecondIntervals = new List<int>();
        private void _timer_Tick(object sender, EventArgs e)
        {
            countSeconds++;
            if (countSeconds != 0 && countSeconds % 10 == 0)
            {
                if (TouchesIn10SecondIntervals.Count != 0)
                {
                    var lastValue = TouchesIn10SecondIntervals.Sum();
                    TouchesIn10SecondIntervals.Add(countTouches - lastValue);
                }
                else
                    TouchesIn10SecondIntervals.Add(countTouches);
            }

            if (countSeconds != 0 && countSeconds % 5 == 0)
            {
                if (TouchesIn5SecondIntervals.Count != 0)
                {
                    var lastValue = TouchesIn5SecondIntervals.Sum();
                    TouchesIn5SecondIntervals.Add(countTouches - lastValue);
                }
                else
                    TouchesIn5SecondIntervals.Add(countTouches);
            }
            if (countSeconds == 30)
            {
                Stop();
                ReturnResults();
            }
        }

        private void ReturnResults()
        {
            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Касания каждые 10 секунд"] = TouchesIn10SecondIntervals.ToArray(),
                ["Касания каждые 5 секунд"] = TouchesIn5SecondIntervals.ToArray()
            });
        }

        private int countTouches = 0;
        public void Touch()
        {
            countTouches++;
        }

        public void Stop()
        {
            _timer.Tick -= _timer_Tick;
            _timer.Stop();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TeppingTest\TeppingTestViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Threading;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.TeppingTest
{
    public class TeppingTestViewModel : TestBase
    {
        public override event EventHandler<Results> Results;
        
        private PultTepping Tepping;
        private PultLed Led;
        private TeppingTestControl control; 
        private DispatcherTimer timer = new DispatcherTimer();
        public TeppingTestViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            Manager.TraningTime = Common.GetSeconds(25);
            SetInstructions("teppingTest");
        }
        public override FrameworkElement GetTestControl()
        {
            return new TeppingTestControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new TeppingTestControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            control = new TeppingTestControl();
            TestCurrentView = control;
            Tepping = Pult as Pult.PultTepping;
            Tepping.TeppingValueChanged += Tepping_TeppingValueChanged;
            Tepping.Disconnected += Disconnected;
            Led = AdditionalPult as Pult.PultLed;
            Led.Disconnected += Disconnected;
            timer.Interval = TimeSpan.FromSeconds(3);
            timer.Tick += Timer_Tick;
            timer.Start();
        }

        public override void Start()
        {
            control = new TeppingTestControl();
            TestCurrentView = control;
            Tepping = Pult as Pult.PultTepping;
            Tepping.TeppingValueChanged += Tepping_TeppingValueChanged;
            Led = AdditionalPult as Pult.PultLed;
            Led.Disconnected += Disconnected;
            control.Results += Control_Results;
            timer.Interval = TimeSpan.FromSeconds(3);
            timer.Tick += Timer_Tick;
            timer.Start();
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Exception = e;
            Results?.Invoke(this, new Psychophysical.Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Disconnected(object sender, Pult.DisconnectedEventArgs e)
        {
            Exception = e.Exception;
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        private void StartTest()
        {
            Tepping.TeppingValueChanged += Tepping_TeppingValueChanged;
            Tepping.Disconnected += Disconnected;
            timer.Stop();
            try
            {
                Led.LedState = true;
            }
            catch (Exception ex)
            {
                Exception = ex;
                Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = new PultException("Ошибка пульта") });
            }
            Tepping.Start();
            control.Start();
        }

        private void Timer_Tick(object sender, EventArgs e)
        {
            StartTest();
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            try
            {
                Led.LedState = false;
            }
            catch (Exception ex)
            {
                Exception = ex;
                Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = new PultException("Ошибка пульта") });
            }
            Results?.Invoke(this, new Results(e));
        }
        
        private void Tepping_TeppingValueChanged(object sender, Pult.TeppingChangedEventArgs e)
        {
            if (e.Value)
                control.Touch();
        }

        public override void Stop()
        {
            base.Stop();
            if (Led != null)
            {
                if (Exception == null)
                    Led.LedState = false;
                Led.Disconnected -= Disconnected;
            }
            if (Tepping != null)
            {
                Tepping.Disconnected -= Disconnected;
                Tepping.TeppingValueChanged -= Tepping_TeppingValueChanged;
                Tepping.Stop();
            }
            if (control != null)
            {
                control.Results -= Control_Results;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TeppingTest\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.TeppingTest"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:TeppingTestControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TeppingTestControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <tests:MessageBoxControl  Visibility="{Binding MessageVisible,
                                                                          RelativeSource={RelativeSource 
                                                                          AncestorType={x:Type local:TeppingTestControl}}}"
                                                              Message="Следите за светодиодом"/>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:TeppingTestControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:TeppingTestViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TeppingTestViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:TeppingTestViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestForMotorableCoherence\RectIndicator.cs


using System.Windows;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.TestForMotorableCoherence
{
    public class RectIndicator:NotifyViewModelBase
    {
        public ColorRect Color
        {
            get { return (ColorRect)GetValue(ColorProperty); }
            set { SetValue(ColorProperty, value); }
        }

        public static readonly DependencyProperty ColorProperty =
            DependencyProperty.Register("Color", typeof(ColorRect), typeof(RectIndicator), new PropertyMetadata(ColorRect.None, ColorChanged));

        private static void ColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            (d as RectIndicator).ControlBrush = (d as RectIndicator).GetBrush((ColorRect)e.NewValue);
            if ((ColorRect)e.NewValue == ColorRect.Default)
            {
                (d as RectIndicator).Opacity = 0.0;
            }
            else
                (d as RectIndicator).Opacity = 1.0;
        }

        private Brush GetBrush(ColorRect color)
        {
            switch (color)
            {
                case ColorRect.Default: return Brushes.Transparent;
                case ColorRect.Red: return Common.Drawing.GetColor(Common.ColorsCircle.Red);
                case ColorRect.Greeen: return Common.Drawing.GetColor(Common.ColorsCircle.Green);
                default: return null;
            }
        }

        private Brush _controlBrush;
        public Brush ControlBrush
        {
            get { return _controlBrush; }
            set
            {
                _controlBrush = value;
                OnPropertyChanged();
            }
        }
    }
    public enum ColorRect
    {
        None,
        Default,
        Red,
        Greeen
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestForMotorableCoherence\TestForMotorableCoherenceControl.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.TestForMotorableCoherence
{
    public class TestForMotorableCoherenceControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private List<RectIndicator> _leftIndicators = new List<RectIndicator>();
        private List<RectIndicator> _rightIndicators = new List<RectIndicator>();
        private int _currentGreenRectLeftIndex;
        private int _currentGreenRectRightIndex;

        private int? _currentRedRectLeftIndex;
        private int? _currentRedRectRightIndex;

        private double _heightWidth = 1000;

        DispatcherTimer _timerNoCoherence = new DispatcherTimer();//если этот таймер сработал засчитать неодновременность
        DispatcherTimer _timerTranslate = new DispatcherTimer();//переход к следующим красным квадратикам
        private DateTime? _startTime = null;
        public TestForMotorableCoherenceControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
            {
                GenerateScene();
                _leftTimer.Interval = TimeSpan.FromMilliseconds(50);
                _rightTimer.Interval = TimeSpan.FromMilliseconds(67);
                _leftTimer.Tick += _leftTimer_Tick;
                _rightTimer.Tick += _rightTimer_Tick;
                TestMethods.Add("MoveGreenRects", () => MoveGreenRects());
                TestMethods.Add("ShowRedRects1", () => ShowRedRects1());
                TestMethods.Add("ShowRedRects2", () => ShowRedRects2());
            }
        }

        private void _rightTimer_Tick(object sender, EventArgs e)
        {
            RightRectMoveUp();
        }

        private void _leftTimer_Tick(object sender, EventArgs e)
        {
            LeftRectMoveUp();
        }

        private DispatcherTimer _leftTimer = new DispatcherTimer(DispatcherPriority.Render);
        private DispatcherTimer _rightTimer = new DispatcherTimer(DispatcherPriority.Render);
        private RectIndicator _leftIndicator = null;
        private RectIndicator _rightIndicator = null;
        private void LeftRectMoveUp()
        {
            if (_leftIndicator == null)
                _leftIndicator = _leftIndicators[24];
            _leftIndicator.Color = ColorRect.Default;
            int index = _leftIndicators.IndexOf(_leftIndicator);
            if (index <= 4)
            {
                index = 4;
                _leftIndicator = _leftIndicators[index];
                _leftIndicator.Color = ColorRect.Greeen;
                _leftTimer.Stop();
            }
            else
            {
                if (index < _rightIndicators.Count && index > 0)
                    index--;
                _leftIndicator = _leftIndicators[index];
                _leftIndicator.Color = ColorRect.Greeen;
            }
        }

        private void RightRectMoveUp()
        {
            if (_rightIndicator == null)
                _rightIndicator = _rightIndicators[24];
            _rightIndicator.Color = ColorRect.Default;
            int index = _rightIndicators.IndexOf(_rightIndicator);
            if (index <= 9)
            {
                index = 9;
                _rightIndicator = _rightIndicators[index];
                _rightIndicator.Color = ColorRect.Greeen;
                _rightTimer.Stop();
            }
            else
            {
                if (index < _rightIndicators.Count && index > 0)
                    index--;
                _rightIndicator = _rightIndicators[index];
                _rightIndicator.Color = ColorRect.Greeen;
            } 
        }

        private void MoveGreenRects()
        {
            _leftTimer.Start();
            _rightTimer.Start();
        }

        private void ShowRedRects1()
        {
            _leftIndicators[4].Color = ColorRect.Red;
            _rightIndicators[9].Color = ColorRect.Red;
        }

        private void ShowRedRects2()
        {
            _leftIndicators[9].Color = ColorRect.Red;
            _rightIndicators[4].Color = ColorRect.Red;
        }

        public void Start()
        {
            _timerNoCoherence.Interval = TimeSpan.FromSeconds(1.5);
            _timerNoCoherence.Tick += _timerNoCoherence_Tick;
            _timerTranslate.Tick += _timerTranslate_Tick;
            GenerateScene();
            _timerTranslate.Interval = TimeSpan.FromSeconds(4.0);
            _timerTranslate.Start();
        }

        private int countPresentsRedRects = -1;
        private void _timerTranslate_Tick(object sender, EventArgs e)
        {

            if (_startTime == null)
            {
                _startTime = DateTime.Now;
                _timerTranslate.Interval = TimeSpan.FromSeconds(2.0);
            }
            NoCoherenceStop();
            isChangePositionRects = false;
            countPresentsRedRects++;
            if (countPresentsRedRects == 25)
                ReturnResults();
            else
            {
                GenerateRedRects();
                _timerTranslate.Stop();
            }
        }

        private void ReturnResults()
        {
            Stop();
            var time = DateTime.Now - _startTime;
            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Общее время выполнения"] = (float)time.Value.TotalSeconds,
                ["Количество превышений интервала неодновременности"] = countUnsynchronizedHands,
                ["Начало движения левой рукой"] = countLeftHand,
                ["Начало движения правой рукой"] = countRightHand
            });
        }

        private bool generatedRedRects = false;
        private void GenerateRedRects()
        {
            while (true)
            {
                int indexLeft = Common._rnd.Next(0, _leftIndicators.Count);
                if (indexLeft != _currentGreenRectLeftIndex)
                {
                    _currentRedRectLeftIndex = indexLeft;
                    _leftIndicators[_currentRedRectLeftIndex.Value].Color = ColorRect.Red;
                    break;
                }
            }

            while (true)
            {
                int indexRight = Common._rnd.Next(0, _rightIndicators.Count);
                if (indexRight != _currentGreenRectRightIndex)
                {
                    _currentRedRectRightIndex = indexRight;
                    _rightIndicators[_currentRedRectRightIndex.Value].Color = ColorRect.Red;
                    break;
                }
            }
            currentIsUnsyncronized = false;
            if (!generatedRedRects)
            generatedRedRects = true;
        }

        private int countUnsynchronizedHands = 0;
        private bool currentIsUnsyncronized = true;
        private void _timerNoCoherence_Tick(object sender, EventArgs e)
        {
            if (!currentIsUnsyncronized)
            {
                countUnsynchronizedHands++;
                Debug.WriteLine($"{countUnsynchronizedHands}");
                NoCoherenceStop();
                currentIsUnsyncronized = true;
            }
        }

        public void Stop()
        {
            _leftTimer.Stop();
            _rightTimer.Stop();
            _leftTimer.Tick -= _leftTimer_Tick;
            _rightTimer.Tick -= _rightTimer_Tick;
            _timerNoCoherence.Tick -= _timerNoCoherence_Tick;
            NoCoherenceStop();
            _timerTranslate.Tick -= _timerTranslate_Tick;
            _timerTranslate.Stop();
        }

        private void GenerateScene()
        {
            var canvas = new Canvas();
            canvas.Height = 1000;
            canvas.Width = 1000;
            var heightRect = _heightWidth / 25;
            var widthRect = heightRect * 1.25;
            var leftColumnXPosition = ((_heightWidth / 2) / 2) - (widthRect / 2);
            for (int i = 0; i < 25; i++)
            {
                var rect = new RectIndicator();
                rect.Color = ColorRect.Default;
                rect.Width = widthRect;
                rect.Height = heightRect;
                rect.SetValue(Canvas.TopProperty, i * heightRect);
                rect.SetValue(Canvas.LeftProperty, leftColumnXPosition);
                canvas.Children.Add(rect);
                _leftIndicators.Add(rect);
            }

            var rightColumnXPosition = (_heightWidth / 2) + ((_heightWidth / 2) / 2) - (widthRect / 2);
            for (int i = 0; i < 25; i++)
            {
                var rect = new RectIndicator();
                rect.Color = ColorRect.Default;
                rect.Width = widthRect;
                rect.Height = heightRect;
                rect.SetValue(Canvas.TopProperty, i * heightRect);
                rect.SetValue(Canvas.LeftProperty, rightColumnXPosition);
                canvas.Children.Add(rect);
                _rightIndicators.Add(rect);
            }

            var line = new Line();
            line.Height = _heightWidth;
            line.Width = 4;
            line.X1 = 2;
            line.X2 = 2;
            line.Y1 = 0;
            line.Y2 = _heightWidth;
            line.StrokeThickness = 2;
            line.Stroke = Brushes.Black;
            line.SetValue(Canvas.LeftProperty, (_heightWidth / 2) - line.Width / 2);
            line.SetValue(Canvas.TopProperty, 0.0);
            canvas.Children.Add(line);
            Canva = canvas;

            _currentGreenRectLeftIndex = _leftIndicators.Count - 1;
            _leftIndicators[_currentGreenRectLeftIndex].Color = ColorRect.Greeen;
            _currentGreenRectRightIndex = _rightIndicators.Count - 1;
            _rightIndicators[_currentGreenRectRightIndex].Color = ColorRect.Greeen;
        }

        private int? oldValueLeft = null;
        private int? oldValueRight = null;
        private bool isChangePositionRects = false;
        private int countLeftHand = 0;
        private int countRightHand = 0;

        /// <summary>
        /// Изменение позиций зеленых квадратов
        /// </summary>
        public void GreenRectsPositionChanged(int rectIndexLeft, int rectIndexRight)
        {
                if (oldValueLeft != null && oldValueRight != null&& generatedRedRects)
                {
                    if (oldValueLeft != rectIndexLeft && !isChangePositionRects)
                    {
                        countLeftHand++;
                        isChangePositionRects = true;
                    }
                    else if (oldValueRight != rectIndexRight && !isChangePositionRects)
                    {
                        countRightHand++;
                        isChangePositionRects = true;
                    }

                    if ((oldValueLeft == rectIndexLeft && oldValueRight != rectIndexRight && !_noCoherenceEnabled) ||
                            (oldValueLeft != rectIndexLeft && oldValueRight == rectIndexRight && !_noCoherenceEnabled))
                        NoCoherenceStart();
                    else if (oldValueLeft != rectIndexLeft && oldValueRight != rectIndexRight && _noCoherenceEnabled)
                    {
                        NoCoherenceStop();
                        Debug.WriteLine("Timer NoCoherence Stop pos changed");
                    }
                }

                oldValueLeft = rectIndexLeft;
                oldValueRight = rectIndexRight;

                MoveRects(rectIndexLeft, rectIndexRight);
            

            if (_currentRedRectLeftIndex != null && _currentRedRectRightIndex != null)
                if (_currentGreenRectLeftIndex == _currentRedRectLeftIndex && _currentGreenRectRightIndex == _currentRedRectRightIndex)
                {
                    _timerTranslate.Start();
                    if (_noCoherenceEnabled)
                        NoCoherenceStop();
                }
                else
                {
                    _timerTranslate.Stop();
                    if (_currentGreenRectLeftIndex != _currentRedRectLeftIndex)
                        _leftIndicators[_currentRedRectLeftIndex.Value].Color = ColorRect.Red;
                    if (_currentGreenRectRightIndex != _currentRedRectRightIndex)
                        _rightIndicators[_currentRedRectRightIndex.Value].Color = ColorRect.Red;
                }

        }

        private void MoveRects(int rectIndexLeft, int rectIndexRight)
        {
            _leftIndicators[_currentGreenRectLeftIndex].Color = ColorRect.Default;
            var rectLeft = _leftIndicators[rectIndexLeft - 1];
            rectLeft.Color = ColorRect.Greeen;
            _currentGreenRectLeftIndex = rectIndexLeft - 1;

            _rightIndicators[_currentGreenRectRightIndex].Color = ColorRect.Default;
            var rectRight = _rightIndicators[rectIndexRight - 1];
            rectRight.Color = ColorRect.Greeen;
            _currentGreenRectRightIndex = rectIndexRight - 1;
        }

        private bool _noCoherenceEnabled = false;
        private void NoCoherenceStart()
        {
            if (!currentIsUnsyncronized)
            {
                Debug.WriteLine("Timer NoCoherence Start");
                _noCoherenceEnabled = true;
                _timerNoCoherence.Start();
            }
        }

        private void NoCoherenceStop()
        {
            _noCoherenceEnabled = false;
            _timerNoCoherence.Stop();
        }

    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestForMotorableCoherence\TestForMotorableCoherenceViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.TestForMotorableCoherence
{
    public class TestForMotorableCoherenceViewModel : TestBase
    {
        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                OnPropertyChanged();
            }
        }

        public override event EventHandler<Results> Results;
        
        private Pult.PultResistors Resistors;
        private TestForMotorableCoherenceControl control;
        public TestForMotorableCoherenceViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            Manager.TraningTime = Common.GetSeconds(80);
            SetInstructions("testForMotorableCoherence");
        }

        public override FrameworkElement GetTestControl()
        {
            return new TestForMotorableCoherenceControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new TestForMotorableCoherenceControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            _isMessageShowed = false;
            _isPretreatment = false;
            control = new TestForMotorableCoherenceControl();
            TestCurrentView = control;
            Resistors = Pult as PultResistors;
            Resistors.NotifyOnChange = false;
            Resistors.ResistorsValuesChanged += Resistors_ResistorsValuesChanged;
            Resistors.Disconnected += Resistors_Disconnected;
            Resistors.Start();
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Resistors_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        public override void Start()
        {
            _isMessageShowed = false;
            _isPretreatment = false;
            control = new TestForMotorableCoherenceControl();
            TestCurrentView = control;
            Resistors = Pult as Pult.PultResistors;
            Resistors.NotifyOnChange = false;
            Resistors.ResistorsValuesChanged += Resistors_ResistorsValuesChanged;
            Resistors.Disconnected += Resistors_Disconnected;
            Resistors.Start();
            control.Results += Control_Results;
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private bool _isMessageShowed = false;
        private bool _isPretreatment = false;
        private int? oldLeft = null;
        private int? oldRight = null;
        private void Resistors_ResistorsValuesChanged(object sender, Pult.ResistorsValueChangedEventArgs e)
        {
            if (e.Values[0] != 0 || e.Values[1] != 0)
            {
                if (!_isMessageShowed)
                {
                    Message = "Установите ручки в положение 0";
                    _isMessageShowed = true;
                }
            }
            else if (!_isPretreatment)
            {
                _isPretreatment = true;
                _isMessageShowed = true;
                Message = null;
                control.Start();
            }
            if (_isPretreatment)
            {
                var oneRect = 255 / 25;
                var left = 25 - (e.Values[0] / oneRect);
                if (left == 0)
                    left = 1;

                var right = 25 - (e.Values[1] / oneRect);
                if (right == 0)
                    right = 1;

                if (oldLeft != null && oldRight != null)
                {
                    if (oldLeft.Value != left || oldRight.Value != right)
                        control.GreenRectsPositionChanged(left, right);
                }
                else
                    control.GreenRectsPositionChanged(left, right);

                oldLeft = left;
                oldRight = right;
            }
        }

        public override void Stop()
        {
            base.Stop();
            if (Resistors != null)
            {
                Resistors.Disconnected -= Resistors_Disconnected;
                Resistors.ResistorsValuesChanged -= Resistors_ResistorsValuesChanged;
                Resistors.Stop();
            }
            if (control != null)
            {
                control.Results -= Control_Results;
                control.Stop();
            }
            
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestForMotorableCoherence\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.TestForMotorableCoherence"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels" xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Converters">
    <Style TargetType="local:TestForMotorableCoherenceControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TestForMotorableCoherenceControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox>
                                <ContentControl Focusable="False"
                                                Margin="5"
                                                Content="{Binding Canva,
                                                          RelativeSource={RelativeSource FindAncestor,
                                                          AncestorType={x:Type local:TestForMotorableCoherenceControl}}}"/>
                            </Viewbox>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:TestForMotorableCoherenceControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:TestForMotorableCoherenceViewModel">
        <Style.Resources>
            <converters:StringOrEmptyConverter x:Key="StringOrEmptyConverter"/>
        </Style.Resources>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TestForMotorableCoherenceViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <tests:MessageBoxControl x:Name="mBox" Message="{Binding Message, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:TestForMotorableCoherenceViewModel}}}" />
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:TestForMotorableCoherenceViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Message,
                                                   RelativeSource={RelativeSource Self},
                                                   Converter={StaticResource StringOrEmptyConverter}}" Value="true">
                            <Setter TargetName="mBox" Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:RectIndicator">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:RectIndicator">
                    <ContentControl>
                        <Border Background="{Binding ControlBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:RectIndicator}}}" BorderBrush="Black" BorderThickness="1"/>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestOfMotorableCoherence_M\CombinePult.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.TestOfMotorableCoherence_M
{
    public class CombinePult : IPult,IDisposable
    {
        public event EventHandler<ButtonPressedEventArgs> ButtonPressed;
        public event EventHandler<DisconnectedEventArgs> Disconnected;
        private PultButtons _buttons;
        public bool IsRunning { get; protected set; } = false;

        public CombinePult(PultButtons buttons)
        {
            _buttons = buttons;
        }
        public void Dispose()
        {
            IsRunning = false;

            if (_buttons != null)
            {
                _buttons.Disconnected -= _buttons_Disconnected;
                _buttons.ButtonPressed -= Buttons_ButtonPressed;
                _buttons.Stop();
            }
        }

        public void Initialize()
        {
            _buttons.Disconnected += _buttons_Disconnected;
            _buttons.ButtonPressed += Buttons_ButtonPressed;
        }

        private void _buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Disconnected?.Invoke(this, e);
        }

        public void Start()
        {
            _buttons.Start();
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            ButtonPressed?.Invoke(sender, e);
        }

        public void Stop()
        {
            IsRunning = false;

            if (_buttons != null)
            {
                _buttons.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestOfMotorableCoherence_M\RectIndicator.cs


using System.Windows;
using System.Windows.Media;

namespace Updk7.Tests.Wpf.Psychophysical.TestOfMotorableCoherence_M
{
    public class RectIndicator:NotifyViewModelBase
    {
        public ColorRect Color
        {
            get { return (ColorRect)GetValue(ColorProperty); }
            set { SetValue(ColorProperty, value); }
        }

        public static readonly DependencyProperty ColorProperty =
            DependencyProperty.Register("Color", typeof(ColorRect), typeof(RectIndicator), new PropertyMetadata(ColorRect.None, ColorChanged));

        private static void ColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            (d as RectIndicator).ControlBrush = (d as RectIndicator).GetBrush((ColorRect)e.NewValue);
            if ((ColorRect)e.NewValue == ColorRect.Default)
            {
                (d as RectIndicator).Opacity = 0.0;
            }
            else
                (d as RectIndicator).Opacity = 1.0;
        }

        private Brush GetBrush(ColorRect color)
        {
            switch (color)
            {
                case ColorRect.Default: return Brushes.Transparent;
                case ColorRect.Red: return Common.Drawing.GetColor(Common.ColorsCircle.Red);
                case ColorRect.Greeen: return Common.Drawing.GetColor(Common.ColorsCircle.Green);
                default: return null;
            }
        }

        private Brush _controlBrush;
        public Brush ControlBrush
        {
            get { return _controlBrush; }
            set
            {
                _controlBrush = value;
                OnPropertyChanged();
            }
        }
    }
    public enum ColorRect
    {
        None,
        Default,
        Red,
        Greeen
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestOfMotorableCoherence_M\TestForMotorableCoherence_MControl.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Windows.Threading;
using Updk7.Tests.Pult;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.TestOfMotorableCoherence_M
{
    public class TestOfMotorableCoherence_MControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler<bool> ButtonsOnOff;
        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }

        private Brush _circleFill;

        public Brush CircleFill
        {
            get { return _circleFill; }
            set
            {
                _circleFill = value;
                OnPropertyChanged();
            }
        }

        private int _countPresentsRedRects;

        public int CountPresentsRedRects
        {
            get { return _countPresentsRedRects; }
            set 
            {
                _countPresentsRedRects = value;
                OnPropertyChanged();
            }
        }

        private int _countPresentsCenterSignal;

        public int CountPresentsCenterSignal
        {
            get { return _countPresentsCenterSignal; }
            set 
            {
                _countPresentsCenterSignal = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private Brush _defaultBrush = Brushes.Gray;

        private Dictionary<int, int> _signals;

        private List<RectIndicator> _leftIndicators = new List<RectIndicator>();
        private List<RectIndicator> _rightIndicators = new List<RectIndicator>();
        private int _currentGreenRectLeftIndex;
        private int _currentGreenRectRightIndex;

        private int? _currentRedRectLeftIndex;
        private int? _currentRedRectRightIndex;

        private double _heightWidth = 1000;

        DispatcherTimer _timerNoCoherence = new DispatcherTimer();//если этот таймер сработал засчитать неодновременность
        DispatcherTimer _timerTranslate = new DispatcherTimer();//переход с следующим красным квадратикам
        DispatcherTimer _timerPultSignal = new DispatcherTimer();//by event Tick to add in value of 2 seconds to the results
        DispatcherTimer _timerPreviewCenterSignal = new DispatcherTimer();//отсчитывает время до показа сигнала в центре экрана
        private DateTime? _startTime = null;
        private bool _isButtonsActive = false;
        private bool _isResistorsActive = false;
        private List<double> timeReactionsLampSignals = new List<double>();

        public TestOfMotorableCoherence_MControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
            {
                GenerateScene();
                _leftTimer.Interval = TimeSpan.FromMilliseconds(50);
                _rightTimer.Interval = TimeSpan.FromMilliseconds(67);
                _leftTimer.Tick += _leftTimer_Tick;
                _rightTimer.Tick += _rightTimer_Tick;
                TestMethods.Add("MoveGreenRects", () => MoveGreenRects());
                TestMethods.Add("ShowRedSignal", () => ShowRedSignal());
                TestMethods.Add("ShowGreenSignal", () => ShowGreenSignal());
                TestMethods.Add("HideSignal", () => HideSignal());
                TestMethods.Add("ShowRedRects1", () => ShowRedRects1());
                TestMethods.Add("ShowRedRects2", () => ShowRedRects2());
            }
        }

        private void ShowGreenSignal()
        {
            CircleFill = Common.Drawing.GetColor(Common.ColorsCircle.Green);
        }

        private void ShowRedSignal()
        {
            CircleFill = Common.Drawing.GetColor(Common.ColorsCircle.Red);
        }

        private void HideSignal()
        {
            CircleFill = _defaultBrush;
        }

        private void _rightTimer_Tick(object sender, EventArgs e)
        {
            RightRectMoveUp();
        }

        private void _leftTimer_Tick(object sender, EventArgs e)
        {
            LeftRectMoveUp();
        }

        private DispatcherTimer _leftTimer = new DispatcherTimer(DispatcherPriority.Render);
        private DispatcherTimer _rightTimer = new DispatcherTimer(DispatcherPriority.Render);
        private RectIndicator _leftIndicator = null;
        private RectIndicator _rightIndicator = null;
        private void LeftRectMoveUp()
        {
            if (_leftIndicator == null)
                _leftIndicator = _leftIndicators[24];
            _leftIndicator.Color = ColorRect.Default;
            int index = _leftIndicators.IndexOf(_leftIndicator);
            if (index <= 4)
            {
                index = 4;
                _leftIndicator = _leftIndicators[index];
                _leftIndicator.Color = ColorRect.Greeen;
                _leftTimer.Stop();
            }
            else
            {
                if (index < _rightIndicators.Count && index > 0)
                    index--;
                _leftIndicator = _leftIndicators[index];
                _leftIndicator.Color = ColorRect.Greeen;
            }
        }

        private void RightRectMoveUp()
        {
            if (_rightIndicator == null)
                _rightIndicator = _rightIndicators[24];
            _rightIndicator.Color = ColorRect.Default;
            int index = _rightIndicators.IndexOf(_rightIndicator);
            if (index <= 9)
            {
                index = 9;
                _rightIndicator = _rightIndicators[index];
                _rightIndicator.Color = ColorRect.Greeen;
                _rightTimer.Stop();
            }
            else
            {
                if (index < _rightIndicators.Count && index > 0)
                    index--;
                _rightIndicator = _rightIndicators[index];
                _rightIndicator.Color = ColorRect.Greeen;
            }
        }

        private void MoveGreenRects()
        {
            _leftTimer.Start();
            _rightTimer.Start();
        }

        private void ShowRedRects1()
        {
            _leftIndicators[4].Color = ColorRect.Red;
            _rightIndicators[9].Color = ColorRect.Red;
        }

        private void ShowRedRects2()
        {
            _leftIndicators[9].Color = ColorRect.Red;
            _rightIndicators[4].Color = ColorRect.Red;
        }



        public void Start()
        {
            _timerPultSignal.Interval = TimeSpan.FromSeconds(2.0);
            _timerPultSignal.Tick += _timerPultSignal_Tick;
            _timerNoCoherence.Interval = TimeSpan.FromSeconds(1.5);
            _timerNoCoherence.Tick += _timerNoCoherence_Tick;
            _timerTranslate.Tick += _timerTranslate_Tick;
            GenerateScene();
            _timerTranslate.Interval = TimeSpan.FromSeconds(3.0);
            _timerPreviewCenterSignal.Tick += _timerPreviewCenterSignal_Tick;
            _timerPreviewCenterSignal.Interval = TimeSpan.FromSeconds(2.0);
            _isResistorsActive = true;
            _timerTranslate.Start();
        }

        private void _timerPreviewCenterSignal_Tick(object sender, EventArgs e)
        {
            _isButtonsActive = true;
            _timerPreviewCenterSignal.Stop();
            SwitchPult(true);
            var color = _signals.FirstOrDefault(f => f.Key == countPresentsRedRects + 2).Value;
            CircleFill = color == 0 ? Common.Drawing.GetColor(Common.ColorsCircle.Red) : Common.Drawing.GetColor(Common.ColorsCircle.Green);
            CountPresentsCenterSignal++;
        }

        private void SwitchPult(bool resistors_buttons)
        {
            if (resistors_buttons)
            {
                ButtonsOnOff?.Invoke(this, true);
                _timerPultSignal.Start();
            }
            else
            {
                _isButtonsActive = false;
                _isResistorsActive = true;
                ButtonsOnOff?.Invoke(this, false);
                _timerPultSignal.Stop();
                if (countPresentsRedRects == 24)
                    ReturnResults();
                else
                {
                    GenerateRedRects();
                    _timerTranslate.Stop();
                }
            }
        }

        private void _timerPultSignal_Tick(object sender, EventArgs e)
        {
            timeReactionsLampSignals.Add(2.0);
            SwitchPult(false);
            usedSignal = false;
            CircleFill = _defaultBrush;
        }

        private int countPresentsRedRects = -1;
        private bool usedSignal = false;
        private void _timerTranslate_Tick(object sender, EventArgs e)
        {
            if (_startTime == null)
            {
                _startTime = DateTime.Now;
                _timerTranslate.Interval = TimeSpan.FromSeconds(2.0);
            }
            NoCoherenceStop();
            isChangePositionRects = false;

            if (_signals.Keys.Any(a => a == countPresentsRedRects+1))
                usedSignal = true;
            
            if (usedSignal)
            {
                _isResistorsActive = false;
                _timerTranslate.Stop();
                _timerPreviewCenterSignal.Start();
            }
            else
            {
                if (countPresentsRedRects == 24)
                    ReturnResults();
                else
                {
                    GenerateRedRects();
                    _timerTranslate.Stop();
                }
            }
        }

        private int _countErrors = 0;
        public void AddSignalResult(TimeSpan result, PultButton button)
        {
            if (_isButtonsActive)
            {
                if ((CircleFill.ToString() == Common.Drawing.GetColor(Common.ColorsCircle.Green).ToString() && button == PultButton.Green) ||
                    (CircleFill.ToString() == Common.Drawing.GetColor(Common.ColorsCircle.Red).ToString() && button == PultButton.Red))
                {
                    timeReactionsLampSignals.Add(result.TotalSeconds);
                }
                else if ((CircleFill.ToString() == Common.Drawing.GetColor(Common.ColorsCircle.Green).ToString() && button != PultButton.Green) ||
                   (CircleFill.ToString() == Common.Drawing.GetColor(Common.ColorsCircle.Red).ToString() && button != PultButton.Red))
                {
                    _countErrors++;
                    timeReactionsLampSignals.Add(2.0);
                }
                SwitchPult(false);
                CircleFill = _defaultBrush;
                usedSignal = false;
                _isButtonsActive = false;
            }
        }

        private void ReturnResults()
        {
            Stop();
            var time = DateTime.Now - _startTime;
            var countMiss = timeReactionsLampSignals.Where(s => s == 2.0).Count();
            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Общее время выполнения"] = (float)time.Value.TotalSeconds,
                ["Количество превышений интервала неодновременности"] = countUnsynchronizedHands,
                ["Начало движения левой рукой"] = countLeftHand,
                ["Начало движения правой рукой"] = countRightHand,
                ["Среднее время реакции на появление сигналов в центре экрана"] = (float)(timeReactionsLampSignals.Sum(s=>s)/timeReactionsLampSignals.Count),
                ["Количество ошибок реагирования на сигналы в центре экрана"]= _countErrors,
                ["Количество пропусков сигналов в центре экрана"] = countMiss
            });
        }

        private bool generatedRedRects = false;
        private void GenerateRedRects()
        {
            while (true)
            {
                int indexLeft = Common._rnd.Next(0, _leftIndicators.Count);
                if (indexLeft != _currentGreenRectLeftIndex)
                {
                    _currentRedRectLeftIndex = indexLeft;
                    _leftIndicators[_currentRedRectLeftIndex.Value].Color = ColorRect.Red;
                    break;
                }
            }

            while (true)
            {
                int indexRight = Common._rnd.Next(0, _rightIndicators.Count);
                if (indexRight != _currentGreenRectRightIndex)
                {
                    _currentRedRectRightIndex = indexRight;
                    _rightIndicators[_currentRedRectRightIndex.Value].Color = ColorRect.Red;
                    break;
                }
            }
            currentIsUnsyncronized = false;
            if (!generatedRedRects)
            generatedRedRects = true;
            countPresentsRedRects++;
            CountPresentsRedRects = countPresentsRedRects + 1;
        }

        private int countUnsynchronizedHands = 0;
        private bool currentIsUnsyncronized = true;
        private void _timerNoCoherence_Tick(object sender, EventArgs e)
        {
            if (!currentIsUnsyncronized)
            {
                countUnsynchronizedHands++;
                Debug.WriteLine($"{countUnsynchronizedHands}");
                NoCoherenceStop();
                currentIsUnsyncronized = true;
            }
        }

        public void Stop()
        {
            _leftTimer.Tick -= _leftTimer_Tick;
            _leftTimer.Stop();
            _rightTimer.Tick -= _rightTimer_Tick;
            _rightTimer.Stop();
            _timerNoCoherence.Tick -= _timerNoCoherence_Tick;
            NoCoherenceStop();
            _timerTranslate.Tick -= _timerTranslate_Tick;
            _timerTranslate.Stop();
            _timerPultSignal.Tick -= _timerPultSignal_Tick;
            _timerPultSignal.Stop();
        }

        private void GenerateScene()
        {
            var canvas = new Canvas
            {
                Height = 1000,
                Width = 1000
            };
            var heightRect = _heightWidth / 25;
            var widthRect = heightRect * 3;
            var leftColumnXPosition = ((_heightWidth / 2) / 2) - (widthRect / 2);
            for (int i = 0; i < 25; i++)
            {
                var rect = new RectIndicator();
                rect.Color = ColorRect.Default;
                rect.Width = widthRect;
                rect.Height = heightRect;
                rect.SetValue(Canvas.TopProperty, i * heightRect);
                rect.SetValue(Canvas.LeftProperty, leftColumnXPosition);
                canvas.Children.Add(rect);
                _leftIndicators.Add(rect);
            }

            var rightColumnXPosition = (_heightWidth / 2) + ((_heightWidth / 2) / 2) - (widthRect / 2);
            for (int i = 0; i < 25; i++)
            {
                var rect = new RectIndicator();
                rect.Color = ColorRect.Default;
                rect.Width = widthRect;
                rect.Height = heightRect;
                rect.SetValue(Canvas.TopProperty, i * heightRect);
                rect.SetValue(Canvas.LeftProperty, rightColumnXPosition);
                canvas.Children.Add(rect);
                _rightIndicators.Add(rect);
            }

            var line = new Line();
            line.Height = _heightWidth;
            line.Width = 4;
            line.X1 = 2;
            line.X2 = 2;
            line.Y1 = 0;
            line.Y2 = _heightWidth;
            line.StrokeThickness = 2;
            line.Stroke = Brushes.Black;
            line.SetValue(Canvas.LeftProperty, (_heightWidth / 2) - line.Width / 2);
            line.SetValue(Canvas.TopProperty, 0.0);
            canvas.Children.Add(line);
            Canva = canvas;

            _currentGreenRectLeftIndex = _leftIndicators.Count - 1;
            _leftIndicators[_currentGreenRectLeftIndex].Color = ColorRect.Greeen;
            _currentGreenRectRightIndex = _rightIndicators.Count - 1;
            _rightIndicators[_currentGreenRectRightIndex].Color = ColorRect.Greeen;


            CircleFill = _defaultBrush;
            _signals = GetNumberSignals();
        }

        private Dictionary<int, int> GetNumberSignals()
        {
            var allSignals = new int[] { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 };
            var selectedSignals = new Dictionary<int, int>();
            for (int i = 0; i < 12; i++)
            {
                while (true)
                {
                    var possibleSignal = allSignals[Common._rnd.Next(0, allSignals.Length)];
                    if (!selectedSignals.Any(f => f.Key == possibleSignal))
                    {
                        var colorNumber = Common._rnd.Next(0, 2);
                        selectedSignals.Add(possibleSignal, colorNumber);
                        break;
                    }
                }
            }
            return selectedSignals;
        }

        private int? oldValueLeft = null;
        private int? oldValueRight = null;
        private bool isChangePositionRects = false;
        private int countLeftHand = 0;
        private int countRightHand = 0;


        public void UpdateOldValues(int oldValueLeft, int oldValueRight)
        {
            this.oldValueLeft = oldValueLeft;
            this.oldValueRight = oldValueRight;
        }

        /// <summary>
        /// Изменение позиций зеленых квадратов
        /// </summary>
        public void GreenRectsPositionChanged(int rectIndexLeft, int rectIndexRight)
        {
            if (_isResistorsActive)
            {
                if (oldValueLeft != null && oldValueRight != null && generatedRedRects)
                {
                    if (oldValueLeft != rectIndexLeft && !isChangePositionRects)
                    {
                        countLeftHand++;
                        isChangePositionRects = true;
                    }
                    else if (oldValueRight != rectIndexRight && !isChangePositionRects)
                    {
                        countRightHand++;
                        isChangePositionRects = true;
                    }

                    if ((oldValueLeft == rectIndexLeft && oldValueRight != rectIndexRight && !_noCoherenceEnabled) ||
                            (oldValueLeft != rectIndexLeft && oldValueRight == rectIndexRight && !_noCoherenceEnabled))
                        NoCoherenceStart();
                    else if (oldValueLeft != rectIndexLeft && oldValueRight != rectIndexRight && _noCoherenceEnabled)
                    {
                        NoCoherenceStop();
                        Debug.WriteLine("Timer NoCoherence Stop pos changed");
                    }
                }

                oldValueLeft = rectIndexLeft;
                oldValueRight = rectIndexRight;

                MoveRects(rectIndexLeft, rectIndexRight);


                if (_currentRedRectLeftIndex != null && _currentRedRectRightIndex != null)
                    if (_currentGreenRectLeftIndex == _currentRedRectLeftIndex && _currentGreenRectRightIndex == _currentRedRectRightIndex)
                    {
                        _timerTranslate.Start();
                        if (_noCoherenceEnabled)
                            NoCoherenceStop();
                    }
                    else
                    {
                        _timerTranslate.Stop();
                        if (_currentGreenRectLeftIndex != _currentRedRectLeftIndex)
                            _leftIndicators[_currentRedRectLeftIndex.Value].Color = ColorRect.Red;
                        if (_currentGreenRectRightIndex != _currentRedRectRightIndex)
                            _rightIndicators[_currentRedRectRightIndex.Value].Color = ColorRect.Red;
                    }
            }

        }

        private void MoveRects(int rectIndexLeft, int rectIndexRight)
        {
            _leftIndicators[_currentGreenRectLeftIndex].Color = ColorRect.Default;
            var rectLeft = _leftIndicators[rectIndexLeft - 1];
            rectLeft.Color = ColorRect.Greeen;
            _currentGreenRectLeftIndex = rectIndexLeft - 1;

            _rightIndicators[_currentGreenRectRightIndex].Color = ColorRect.Default;
            var rectRight = _rightIndicators[rectIndexRight - 1];
            rectRight.Color = ColorRect.Greeen;
            _currentGreenRectRightIndex = rectIndexRight - 1;
        }

        private bool _noCoherenceEnabled = false;
        private void NoCoherenceStart()
        {
            if (!currentIsUnsyncronized)
            {
                Debug.WriteLine("Timer NoCoherence Start");
                _noCoherenceEnabled = true;
                _timerNoCoherence.Start();
            }
        }

        private void NoCoherenceStop()
        {
            _noCoherenceEnabled = false;
            _timerNoCoherence.Stop();
        }

    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestOfMotorableCoherence_M\TestForMotorableCoherence_MViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.TestOfMotorableCoherence_M
{
    public class TestOfMotorableCoherence_MViewModel : TestBase
    {
        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                OnPropertyChanged();
            }
        }

        public override event EventHandler<Results> Results;
        
        private PultResistors Resistors;
        private PultButtons Buttons;

        private TestOfMotorableCoherence_MControl control;
        public TestOfMotorableCoherence_MViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            Manager.TraningTime = Common.GetSeconds(80);
            SetInstructions("testForMotorableCoherenceM");
        }

        public override FrameworkElement GetTestControl()
        {
            return new TestOfMotorableCoherence_MControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new TestOfMotorableCoherence_MControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            _isMessageShowed = false;
            _isPretreatment = false;
            control = new TestOfMotorableCoherence_MControl();
            TestCurrentView = control;

            Buttons = AdditionalPult as PultButtons;
            Buttons.ButtonPressed += ButtonPressed;
            Buttons.Disconnected += Disconnected;
            
            Resistors = Pult as PultResistors;
            Resistors.NotifyOnChange = false;
            Resistors.ResistorsValuesChanged += Resistors_ResistorsValuesChanged;
            Resistors.Disconnected += Disconnected;
            Resistors.Start();
            control.ButtonsOnOff += Control_ButtonsOnOff;
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        public override void Start()
        {
            _isMessageShowed = false;
            _isPretreatment = false;
            control = new TestOfMotorableCoherence_MControl();
            TestCurrentView = control;

            Buttons = AdditionalPult as PultButtons;
            Buttons.ButtonPressed += ButtonPressed;
            Buttons.Disconnected += Disconnected;

            Resistors = Pult as PultResistors;
            Resistors.NotifyOnChange = false;
            Resistors.ResistorsValuesChanged += Resistors_ResistorsValuesChanged;
            Resistors.Disconnected += Disconnected;
            control.Results += Control_Results;
            control.ButtonsOnOff += Control_ButtonsOnOff;
            Resistors.Start();
            
        }

        private bool reCalculate = false;
        private void Control_ButtonsOnOff(object sender, bool e)
        {
            if (e)
            {
                Resistors.Stop();
                Buttons.Start();
            }
            else
            {
                Buttons.Stop();
                reCalculate = true;
                Resistors.Start();
            }
        }

        private void ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Red|| e.Button == PultButton.Green)
            {
                var reaction = TimeSpan.FromSeconds(e.Time / 10000.0);
                control.AddSignalResult(reaction, e.Button);
            }
        }

        private void Control_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private bool _isMessageShowed = false;
        private bool _isPretreatment = false;
        private int? oldLeft = null;
        private int? oldRight = null;
        private void Resistors_ResistorsValuesChanged(object sender, ResistorsValueChangedEventArgs e)
        {
            if (e.Values[0] != 0 || e.Values[1] != 0)
            {
                if (!_isMessageShowed)
                {
                    Message = "Установите ручки в положение 0";
                    _isMessageShowed = true;
                }
            }
            else if (!_isPretreatment)
            {
                _isPretreatment = true;
                _isMessageShowed = true;
                Message = null;
                control.Start();
            }
            if (_isPretreatment)
            {
                var oneRect = 255 / 25;
                var left = 25 - (e.Values[0] / oneRect);
                if (left == 0)
                    left = 1;

                var right = 25 - (e.Values[1] / oneRect);
                if (right == 0)
                    right = 1;

                if (oldLeft != null && oldRight != null)
                {
                    if (oldLeft.Value != left || oldRight.Value != right)
                        control.GreenRectsPositionChanged(left, right);
                }
                else
                    control.GreenRectsPositionChanged(left, right);

                oldLeft = left;
                oldRight = right;
            }

            if (reCalculate)
            {
                var oneRect = 255 / 25;
                var left = 25 - (e.Values[0] / oneRect);
                if (left == 0)
                    left = 1;

                var right = 25 - (e.Values[1] / oneRect);
                if (right == 0)
                    right = 1;

                if (oldLeft != null && oldRight != null)
                {
                    if (oldLeft.Value != left || oldRight.Value != right)
                        control.GreenRectsPositionChanged(left, right);
                }
                else
                    control.GreenRectsPositionChanged(left, right);

                oldLeft = left;
                oldRight = right;
                control.UpdateOldValues(oldLeft.Value, oldRight.Value);
                reCalculate = false;
            }
        }

        public override void Stop()
        {
            base.Stop();
           
            if (Buttons != null)
            {
                Buttons.Disconnected -= Disconnected;
                Buttons.ButtonPressed -= ButtonPressed;
                Buttons.Stop();
            }
            if (Resistors != null)
            {
                Resistors.Disconnected -= Disconnected;
                Resistors.ResistorsValuesChanged -= Resistors_ResistorsValuesChanged;
                Resistors.Stop();
            }
            if (control != null)
            {
                control.ButtonsOnOff -= Control_ButtonsOnOff;
                control.Results -= Control_Results;
                control.Stop();
            }
            
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\TestOfMotorableCoherence_M\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.TestOfMotorableCoherence_M"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels" 
                    xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Converters">
    <Style TargetType="local:TestOfMotorableCoherence_MControl">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TestOfMotorableCoherence_MControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox>
                                <ContentControl Focusable="False"
                                                Margin="5"
                                                Content="{Binding Canva,
                                    RelativeSource={RelativeSource FindAncestor,
                                    AncestorType={x:Type local:TestOfMotorableCoherence_MControl}}}"/>
                            </Viewbox>
                            <Ellipse VerticalAlignment="Center"
                                     HorizontalAlignment="Center"
                                     Height="2cm"
                                     Width="2cm"
                                     StrokeThickness="2"
                                     Fill="{Binding CircleFill,
                                RelativeSource={RelativeSource FindAncestor,
                                AncestorType={x:Type local:TestOfMotorableCoherence_MControl}}}"/>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:TestOfMotorableCoherence_MControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:TestOfMotorableCoherence_MViewModel">
        <Style.Resources>
            <converters:StringOrEmptyConverter x:Key="StringOrEmptyConverter"/>
        </Style.Resources>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TestOfMotorableCoherence_MViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <tests:MessageBoxControl x:Name="mBox"
                                                     Message="{Binding Message, 
                                                               RelativeSource={RelativeSource FindAncestor,
                                                               AncestorType={x:Type local:TestOfMotorableCoherence_MViewModel}}}" />
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:TestOfMotorableCoherence_MViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Message,
                                               RelativeSource={RelativeSource Self},
                                               Converter={StaticResource StringOrEmptyConverter}}" Value="true">
                            <Setter TargetName="mBox" Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:RectIndicator">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:RectIndicator">
                    <ContentControl>
                        <Border Background="{Binding ControlBrush,
                            RelativeSource={RelativeSource FindAncestor,
                            AncestorType={x:Type local:RectIndicator}}}"
                                BorderBrush="Black"
                                BorderThickness="1"/>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Tremor3\Tremor3Control.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Threading;
using Microsoft.Expression.Shapes;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;

namespace Updk7.Tests.Wpf.Psychophysical.Tremor3
{
    public class Tremor3Control : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> RegisteredResults;
        public event EventHandler<bool> TremorStartStop;
        public event EventHandler<bool> LedStartStop;
        private string _Message;
        public string Message
        {
            get { return _Message; }
            set
            {
                _Message = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsingElements = new List<FrameworkElement>();

        private Visibility _contentVisibility;
        public Visibility ContentVisibility
        {
            get { return _contentVisibility; }
            set
            {
                _contentVisibility = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private bool _isTestStart = false;
        public Tremor3Control(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            if (Mode == TestMode.Manual)
                Initialize();
        }

        public Tremor3Control(bool isTestStart, TestMode mode = TestMode.Normal)
        {
            _isTestStart = isTestStart;
            Mode = mode;
            if (Mode == TestMode.Manual)
                Initialize();
        }

        private Dictionary<int, List<double>> _timeTapsCollection;
        private DispatcherTimer _timer;
        private List<Ellipse> _holesCollection;
        private void Initialize()
        {
            _timeTapsCollection = new Dictionary<int, List<double>>();
            _holesCollection = new List<Ellipse>
            {
                UsingElements.FirstOrDefault(f=>f.Name=="el1") as Ellipse,
                UsingElements.FirstOrDefault(f=>f.Name=="el2") as Ellipse,
                UsingElements.FirstOrDefault(f=>f.Name=="el3") as Ellipse
            };

            for (int i = 1; i <= 3; i++)
                _timeTapsCollection.Add(i, new List<double>());

            _timer = new DispatcherTimer
            {
                Interval = new TimeSpan(0, 0, 3)
            };
            if (Mode != TestMode.Manual)
                StartProgressAnimation(10);
            _timer.Tick += _timer_Tick;
        }

        private int _numberHole = 1;
        private bool _isTransitionToNextHole;
        private void _timer_Tick(object sender, EventArgs e)
        {
            if (_isTransitionToNextHole)
            {
                TremorStartStop?.Invoke(this, false);
                LedStartStop?.Invoke(this, false);

                ProgressBarAnimation.Stop();

                _numberHole++;
                if (_numberHole <= 3)
                {
                    Message = $"Опустите шуп в отверстие номер {_numberHole}";
                    _timer.Interval = new TimeSpan(0, 0, 3);
                    _isTransitionToNextHole = false;
                    StartAnimation(_holesCollection[_numberHole - 1]);
                }
                else
                {
                    _timer.Stop();
                    var messageTbx = UsingElements.FirstOrDefault(f => f.Name == "messageTbx") as TextBlock;
                    if (messageTbx != null)
                    {
                        messageTbx.SetValue(Grid.RowProperty, 0);
                        messageTbx.SetValue(Grid.RowSpanProperty, 2);
                    }

                    ContentVisibility = Visibility.Collapsed;
                    if(!_isTestStart)
                    Message = "Тест завершен";
                    ReturnResults();
                }
            }
            else
            {
                _timer.Interval = new TimeSpan(0, 0, 10);
                Message = "";
                _isTransitionToNextHole = true;
                StopAnimation();
                if (_currentHole != null)
                    _currentHole.Stroke = Brushes.Red;
                _startCurrentTap = null;//сбрасывает время начала касания (стенки или дна тремора), если произошло касание и состояние не изменилось после на Tap = false
                TremorStartStop?.Invoke(this, true);
                LedStartStop?.Invoke(this, true);
                ProgressBarAnimation.Begin();
            }
        }

        private Storyboard ProgressBarAnimation;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="time">Время в секундах</param>
        private void StartProgressAnimation(double time)
        {
            DoubleAnimationUsingKeyFrames ArcAnimation = new DoubleAnimationUsingKeyFrames();
            EasingDoubleKeyFrame edkf = new EasingDoubleKeyFrame
            {
                Value = 0,
                KeyTime = TimeSpan.FromSeconds(0)
            };

            EasingDoubleKeyFrame edkf1 = new EasingDoubleKeyFrame
            {
                Value = 360,
                KeyTime = TimeSpan.FromSeconds(time)
            };
            ArcAnimation.KeyFrames.Add(edkf);
            ArcAnimation.KeyFrames.Add(edkf1);
            Storyboard.SetTarget(ArcAnimation, UsingElements.FirstOrDefault(f => f.Name == "progressArc") as Arc);
            Storyboard.SetTargetProperty(ArcAnimation, new PropertyPath(Arc.EndAngleProperty));
            ProgressBarAnimation = new Storyboard
            {
                Children = new TimelineCollection() { ArcAnimation }
            };
        }

        private DateTime? _startCurrentTap;
        public void TapChanged(bool IsTap)
        {
            if (IsTap)
                _startCurrentTap = DateTime.Now;
            else
            {
                if (_startCurrentTap != null)
                {
                    var timeTap = (DateTime.Now - _startCurrentTap.Value).TotalSeconds;
                    var _currentTumeCollection = _timeTapsCollection.FirstOrDefault(f => f.Key == _numberHole);
                    _currentTumeCollection.Value.Add(timeTap);
                    _startCurrentTap = null;
                }
            }
        }

        private void ReturnResults()
        {
            var results = new Dictionary<string, object>();
            foreach (var kvp in _timeTapsCollection)
            {
                results.Add($"Отвестие номер {kvp.Key} Количество касаний", kvp.Value.Count);
                results.Add($"Отвестие номер {kvp.Key} Сумма", (float)kvp.Value.Sum());
            }
            RegisteredResults?.Invoke(this, results);
        }

        private Storyboard currentAnimation;
        private Ellipse _currentHole;
        private void StartAnimation(Ellipse ellipse)
        {
            ColorAnimationUsingKeyFrames cAUKF = new ColorAnimationUsingKeyFrames();
            EasingColorKeyFrame eCKF = new EasingColorKeyFrame((Color)ColorConverter.ConvertFromString("#FFCFCFCF"), TimeSpan.FromSeconds(0));
            EasingColorKeyFrame eCKF1 = new EasingColorKeyFrame(Brushes.Orange.Color, TimeSpan.FromSeconds(0.2));
            cAUKF.KeyFrames.Add(eCKF);
            cAUKF.KeyFrames.Add(eCKF1);
            Storyboard.SetTarget(cAUKF, ellipse);
            Storyboard.SetTargetProperty(cAUKF, new PropertyPath("(Ellipse.Fill).(SolidColorBrush.Color)"));
            currentAnimation = new Storyboard
            {
                Children = new TimelineCollection() { cAUKF }
            };
            currentAnimation.AutoReverse = true;
            currentAnimation.RepeatBehavior = RepeatBehavior.Forever;
            currentAnimation.Begin();
            if (_currentHole != null)
                _currentHole.Stroke = Brushes.Black;
            _currentHole = ellipse;
        }
        private void StopAnimation()
        {
            if (currentAnimation != null)
                currentAnimation.Stop();
        }

        public void Start()
        {
            Initialize();
            _timer.Start();
            StartAnimation(_holesCollection[_numberHole - 1]);
            Message = $"Опустите шуп в отверстие номер {_numberHole}";
        }

        /// <summary>
        /// Останавливает все и приводит к изначальному состоянию
        /// </summary>
        public void Stop()
        {
            TremorStartStop?.Invoke(this, false);
            LedStartStop?.Invoke(this, false);
            if (_timer != null)
            {
                _timer.Stop();
                _timer.Tick -= _timer_Tick;
            }
            _numberHole = 1;
            Message = "";

            var messageTbx = UsingElements.FirstOrDefault(f => f.Name == "messageTbx") as TextBlock;
            if (messageTbx != null)
            {
                messageTbx.SetValue(Grid.RowProperty, 1);
                messageTbx.SetValue(Grid.RowSpanProperty, 1);
            }

            ContentVisibility = Visibility.Visible;
            if (currentAnimation != null)
                currentAnimation?.Stop();
            ProgressBarAnimation?.Stop();
            if (_currentHole != null)
                _currentHole.Stroke = Brushes.Black;
        }
    }

    public class Tremor3ControlEx
    {
        public static FrameworkElement GetAddElement(DependencyObject obj)
        {
            return (FrameworkElement)obj.GetValue(AddElementProperty);
        }

        public static void SetAddElement(DependencyObject obj, FrameworkElement value)
        {
            obj.SetValue(AddElementProperty, value);
        }

        public static readonly DependencyProperty AddElementProperty =
            DependencyProperty.RegisterAttached("AddElement", typeof(FrameworkElement), typeof(Tremor3ControlEx), new PropertyMetadata(null, AddElementFieldChanged));

        private static void AddElementFieldChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue != null && e.NewValue is FrameworkElement)
            {
                var existingElements = ((d as FrameworkElement).TemplatedParent as Tremor3Control).UsingElements.Any(a => a == (e.NewValue as FrameworkElement));
                if (!existingElements)
                    ((d as FrameworkElement).TemplatedParent as Tremor3Control).UsingElements.Add(e.NewValue as FrameworkElement);
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Tremor3\Tremor3ViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.Tremor3
{
    public class Tremor3ViewModel : TestBase
    {
        public override event EventHandler<Results> Results;
        private PultTremor Tremor;
        private PultLed Led;
        private Tremor3Control control;

        public Tremor3ViewModel(PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            SetInstructions("tremor3");
            Manager.TraningTime = TimeSpan.FromSeconds(60);
        }

        public override FrameworkElement GetTestControl()
        {
            return new Tremor3Control(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            Manager.TraningTime = TimeSpan.FromSeconds(60);
            control = new Tremor3Control(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void TestStart()
        {
            Manager.TraningTime = TimeSpan.FromSeconds(25);
            control = new Tremor3Control(true);
            Tremor = Pult as PultTremor;
            Led = AdditionalPult as PultLed;
            Led.Disconnected += Disconnected;
            Tremor.TeppingChanged += Tremor_TeppingChanged;
            Tremor.Disconnected += Disconnected;
            control.RegisteredResults += TestExerciseEnd;
            control.TremorStartStop += Control_TremorStartStop;
            control.LedStartStop += Control_LedStartStop;
            control.Loaded += Control_Loaded;
            TestCurrentView = control;
        }

        private void TestExerciseEnd(object sender, Dictionary<string, object> e)
        {
            Manager.ToActionMenu();
        }

        public override void Start()
        {
            control = new Tremor3Control();
            Tremor = Pult as PultTremor;
            Led = AdditionalPult as PultLed;
            Led.Disconnected += Disconnected;
            Tremor.TeppingChanged += Tremor_TeppingChanged;
            Tremor.Disconnected += Disconnected;
            control.RegisteredResults += Control_RegisteredResults;
            control.TremorStartStop += Control_TremorStartStop;
            control.LedStartStop += Control_LedStartStop;
            control.Loaded += Control_Loaded;
            TestCurrentView = control;
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Exception = e;
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Disconnected(object sender, DisconnectedEventArgs e)
        {
            Exception = e.Exception;
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception});
        }

        private void Control_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            control.Loaded -= Control_Loaded;
            control.Start();
        }

        private void Control_LedStartStop(object sender, bool e)
        {
            try
            {
                Led.LedState = e;
            }
            catch (Exception ex)
            {
                Exception = ex;
                Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = new PultException("Ошибка пульта") });
            }
        }

        private void Control_TremorStartStop(object sender, bool e)
        {
            if (e)
                Tremor.Start();
            else
                Tremor.Stop();
        }

        private void Control_RegisteredResults(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Tremor_TeppingChanged(object sender, TeppingChangedEventArgs e)
        {
            control?.TapChanged(e.Value);
        }

        public override void Stop()
        {
            base.Stop();
            if (Tremor != null)
            {
                Tremor.Disconnected -= Disconnected;
                Tremor.TeppingChanged -= Tremor_TeppingChanged;
                Tremor.Stop();
            }
            if (Led != null)
            {
                if (Exception == null)
                    Led.LedState = false;
                Led.Disconnected -= Disconnected;
            }
            if (control != null)
            {
                control.Loaded -= Control_Loaded;
                control.RegisteredResults -= TestExerciseEnd;
                control.RegisteredResults -= Control_RegisteredResults;
                control.TremorStartStop -= Control_TremorStartStop;
                control.LedStartStop -= Control_LedStartStop;
                control.Stop();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\Tremor3\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.Tremor3"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels" >
    <Style TargetType="local:Tremor3Control">
        <Setter Property="Background" Value="#FF49505B"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Tremor3Control">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Grid x:Name="rootGrid">
                                        <Grid.RowDefinitions>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <Viewbox Visibility="{Binding ContentVisibility,
                                                              RelativeSource={RelativeSource FindAncestor,
                                                              AncestorType={x:Type local:Tremor3Control}}}"
                                                 Margin="5">
                                            <Canvas Width="106" Height="106">
                                                <Ellipse x:Name="rootEl"  Height="100" Width="100" Canvas.Left="3" Canvas.Top="3" Fill="#FFBFBEBE" Stroke="Black"/>
                                                <ed:Arc x:Name="progressArc"
                                                        local:Tremor3ControlEx.AddElement="{Binding ElementName=progressArc}"
                                                        ArcThickness="2"
                                                        ArcThicknessUnit="Pixel"
                                                        EndAngle="0" Fill="#FF15EE28"
                                                        Stretch="None"
                                                        StartAngle="0"
                                                        Width="106"
                                                        Height="106"/>
                                                <Ellipse x:Name="el1"
                                                         local:Tremor3ControlEx.AddElement="{Binding ElementName=el1}"
                                                         Height="35"
                                                         Width="35"
                                                         Canvas.Top="58"
                                                         Canvas.Left="35.5"
                                                         Fill="#FFCFCFCF" 
                                                         Stroke="Black"/>
                                                <TextBlock Width="15"
                                                           Height="15"
                                                           Canvas.Left="45"
                                                           Canvas.Top="67"
                                                           Text="1"
                                                           TextAlignment="Center"/>
                                                <Ellipse x:Name="el2"
                                                         local:Tremor3ControlEx.AddElement="{Binding ElementName=el2}"
                                                         Height="28" 
                                                         Width="28"
                                                         Fill="#FFCFCFCF"
                                                         Canvas.Left="55"
                                                         Canvas.Top="15" 
                                                         Stroke="Black"/>
                                                <TextBlock Width="15"
                                                           Height="15"
                                                           Canvas.Left="61"
                                                           Canvas.Top="21"
                                                           Text="2" 
                                                           TextAlignment="Center"/>
                                                <Ellipse x:Name="el3"
                                                         local:Tremor3ControlEx.AddElement="{Binding ElementName=el3}"
                                                         Height="20"
                                                         Width="20"
                                                         Fill="#FFCFCFCF"
                                                         Canvas.Top="19"
                                                         Canvas.Left="23"
                                                         Stroke="Black"/>
                                                <TextBlock Width="15"
                                                           Height="15"
                                                           Canvas.Left="25.5"
                                                           Canvas.Top="21"
                                                           Text="3"
                                                           TextAlignment="Center"/>
                                            </Canvas>
                                        </Viewbox>
                                        <TextBlock x:Name="messageTbx" local:Tremor3ControlEx.AddElement="{Binding ElementName=messageTbx}"
                                                   Grid.Row="1" 
                                                   FontSize="35" 
                                                   HorizontalAlignment="Center"
                                                   VerticalAlignment="Center"
                                                   Foreground="White"
                                                   Text="{Binding Message,
                                                          RelativeSource={RelativeSource FindAncestor,
                                                          AncestorType={x:Type local:Tremor3Control}}}" />
                                    </Grid>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:Tremor3Control}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:Tremor3ViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Tremor3ViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:Tremor3ViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\VigilanceAssessment\Indicator.cs


using System.Windows;
using System.Windows.Media;
using static Updk7.Tests.Wpf.Psychophysical.Common;

namespace Updk7.Tests.Wpf.Psychophysical.VigilanceAssessment
{
    public class Indicator : NotifyViewModelBase
    {
        public Brush Stroke
        {
            get { return (Brush)GetValue(StrokeProperty); }
            set { SetValue(StrokeProperty, value); }
        }
        
        public static readonly DependencyProperty StrokeProperty =
            DependencyProperty.Register("Stroke", typeof(Brush), typeof(Indicator), new PropertyMetadata(null));

        private Brush _IndicationColor;
        public Brush IndicationColor
        {
            get { return _IndicationColor; }
            set
            {
                _IndicationColor = value;
                OnPropertyChanged();
            }
        }

        private ColorsCircle _color;
        public ColorsCircle Color
        {
            get { return _color; }
            set
            {
                _color = value;
                OnPropertyChanged();
            }
        }

        public double Angle { get; set; }

        private bool _IsEnabledIndicator;
        public bool IsEnabledIndicator
        {
            get { return _IsEnabledIndicator; }
            set
            {
                _IsEnabledIndicator = value;
                OnPropertyChanged();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\VigilanceAssessment\ISignals.cs


using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.VigilanceAssessment
{
    public interface ISignals
    {
        List<RowSignal> SignalsData { get; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\VigilanceAssessment\Signals.cs


using System;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Psychophysical.VigilanceAssessment
{
    public class Signals : ISignals
    {
        public List<RowSignal> SignalsData { get; private set; } = new List<RowSignal>()
        {
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,6)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,15)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,30)),
            new RowSignal(TypeSignals.RedSignal,new TimeSpan(0,0,35)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,42)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,51)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,63)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,69)),
            new RowSignal(TypeSignals.RedSignal,new TimeSpan(0,0,74)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,81)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,87)),
            new RowSignal(TypeSignals.RedSignal,new TimeSpan(0,0,95)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,105)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,111)),
            new RowSignal(TypeSignals.RedSignal,new TimeSpan(0,0,125)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,135)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,141)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,159)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,165)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,177)),
            new RowSignal(TypeSignals.RedSignal,new TimeSpan(0,0,188)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,198)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,201)),
            new RowSignal(TypeSignals.Alarm,new TimeSpan(0,0,213)),
            new RowSignal(TypeSignals.RedSignal,new TimeSpan(0,0,219)),
            new RowSignal(TypeSignals.AttentionSignal,new TimeSpan(0,0,225)),
            new RowSignal(TypeSignals.SignalWithWarning,new TimeSpan(0,0,231))
        };

        public Signals()
        {
            GenerateSignals();
        }

        private void GenerateSignals()
        {
            List<RowSignal> baseSignals = SignalsData;

            List<RowSignal> AllSignals = new List<RowSignal>();

            for (int cycle = 0; cycle < 5; cycle++)
            {
                var timePlus = cycle * 240;
                for (int i = 0; i < baseSignals.Count; i++)
                {
                    var signal = new RowSignal(baseSignals[i].Type, baseSignals[i].Time.Add(TimeSpan.FromSeconds(timePlus)));
                    AllSignals.Add(signal);
                }
            }
            SignalsData = AllSignals;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\VigilanceAssessment\Views.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tests="clr-namespace:Updk7.Tests.Wpf.Psychophysical"
                    xmlns:local="clr-namespace:Updk7.Tests.Wpf.Psychophysical.VigilanceAssessment"
                    xmlns:panels="clr-namespace:Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels">
    <Style TargetType="local:VigilanceAssessmentControl">
        <Setter Property="Background" Value="#FF727171"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:VigilanceAssessmentControl">
                    <ContentControl>
                        <Border Background="{TemplateBinding Background}">
                            <Viewbox>
                                <Grid Width="1920"
                                      Height="1080">
                                    <Viewbox Height="1000" Width="1000">
                                        <ContentControl Focusable="False" Margin="5" Content="{Binding Canva,
                                                                                               RelativeSource={RelativeSource FindAncestor,
                                                                                               AncestorType={x:Type local:VigilanceAssessmentControl}}}"/>
                                    </Viewbox>
                                    <tests:MessageBoxControl Message="{Binding Message, 
                                                                       RelativeSource={RelativeSource FindAncestor,
                                                                       AncestorType={x:Type local:VigilanceAssessmentControl}}}"/>
                                    <ContentPresenter
                                        Grid.ColumnSpan="3"
                                        Content="{Binding LearningPanel,
                                                  RelativeSource={RelativeSource 
                                                  AncestorType={x:Type local:VigilanceAssessmentControl}}}">
                                        <ContentPresenter.Resources>
                                            <DataTemplate DataType="{x:Type panels:CanvasPanelViewModel}">
                                                <panels:CanvasPanelView Margin="5"
                                                                        DataContext="{Binding}"
                                                                        Background="{Binding Background}"
                                                                        BorderBrush="{Binding BorderBrush}"
                                                                        BorderThickness="{Binding BorderThickness}"/>
                                            </DataTemplate>
                                        </ContentPresenter.Resources>
                                    </ContentPresenter>
                                </Grid>
                            </Viewbox>
                        </Border>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:VigilanceAssessmentViewModel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:VigilanceAssessmentViewModel">
                    <ContentControl>
                        <Grid>
                            <ContentControl Focusable="False" Content="{TemplateBinding TestCurrentView}"/>
                            <tests:LearningTaskHeaderView 
                                Visibility="{TemplateBinding LearningTaskHeaderVisibility}"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"/>
                            <ContentPresenter Content="{Binding ContinueViewModel,
                                                        RelativeSource={RelativeSource FindAncestor,
                                                        AncestorType={x:Type local:VigilanceAssessmentViewModel}}}"/>
                        </Grid>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <SolidColorBrush x:Key="DefaultBrushIndicator" Color="#FF535151"/>
    <Style TargetType="{x:Type local:Indicator}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Indicator}">
                    <ContentControl>
                        <Ellipse x:Name="el" StrokeThickness="1" Stroke="{TemplateBinding Stroke}" Fill="{StaticResource DefaultBrushIndicator}"/>
                    </ContentControl>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsEnabledIndicator,RelativeSource={RelativeSource Self}}" Value="false">
                            <Setter TargetName="el" Property="Fill" Value="{StaticResource DefaultBrushIndicator}"/>
                            <Setter TargetName="el" Property="StrokeThickness" Value="1"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsEnabledIndicator, RelativeSource={RelativeSource Self}}" Value="true">
                            <Setter TargetName="el" Property="Fill" Value="{Binding IndicationColor, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Indicator}}}"/>
                            <Setter TargetName="el" Property="Margin" Value="-1"/>
                            <Setter TargetName="el" Property="Stroke" Value="#FFF4F4F4"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\VigilanceAssessment\VigilanceAssessmentControl.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Media;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension;
using Updk7.Tests.Wpf.Psychophysical.LearningTasksExtension.Panels;
using static Updk7.Tests.Wpf.Psychophysical.Common;
using static Updk7.Tests.Wpf.Psychophysical.Common.Drawing;

namespace Updk7.Tests.Wpf.Psychophysical.VigilanceAssessment
{
    public class VigilanceAssessmentControl : NotifyViewModelBase, ILearning
    {
        public event EventHandler<Dictionary<string, object>> Results;
        public event EventHandler ResetTimer;

        private string _message;
        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                if (_isShowedMessages)
                {
                    if (_message != "")
                    {
                        _isButtonsEnabled = false;
                        _timer.Stop();
                        _messageTimer.Start();
                    }
                    OnPropertyChanged();
                }
            }
        }
        private bool _isButtonsEnabled = true;
        private bool _isShowedMessages = false;

        private DispatcherTimer _messageTimer = new DispatcherTimer();

        private Canvas _canva;
        public Canvas Canva
        {
            get { return _canva; }
            set
            {
                _canva = value;
                OnPropertyChanged();
            }
        }
        private List<Indicator> _indicators = new List<Indicator>();
        private Indicator _centerCircle = null;
        private NeuroTimer _timer = new NeuroTimer();
        private SoundPlayer _player = new SoundPlayer();
        private DispatcherTimer _timeOutTimer = new DispatcherTimer();

        private List<RowSignal> _signals;
        public List<RowSignal> SignalsTable
        {
            get { return _signals; }
            set
            {
                _signals = value;
                OnPropertyChanged();
            }
        }

        private int _currentIndexIndicator = 0;
        public int CurrentIndexIndicator
        {
            get { return _currentIndexIndicator; }
            set
            {
                _currentIndexIndicator = value;
                OnPropertyChanged();
            }
        }

        private TimeSpan _time = new TimeSpan(0, 0, 0);
        public TimeSpan Time
        {
            get { return _time; }
            set
            {
                _time = value;
                OnPropertyChanged();
            }
        }

        public List<FrameworkElement> UsedElements { get; set; } = new List<FrameworkElement>();
        public TestMode Mode { get; set; }
        public Dictionary<string, Action> TestMethods { get; set; } = new Dictionary<string, Action>();
        private CanvasPanelViewModel _learningPanel;
        public CanvasPanelViewModel LearningPanel
        {
            get { return _learningPanel; }
            set
            {
                _learningPanel = value;
                OnPropertyChanged();
            }
        }

        private SynchronizationContext _context;
        public VigilanceAssessmentControl(ISignals signals)
        {
            SignalsTable = signals.SignalsData;
            _context = SynchronizationContext.Current;
        }

        public VigilanceAssessmentControl(TestMode mode = TestMode.Normal)
        {
            Mode = mode;
            Initialize();
            if (Mode == TestMode.Manual)
            {
                TestMethods.Add("NextCircle", () => NextCircle());
                TestMethods.Add("Jump", () => Jump());
                TestMethods.Add("YellowSignal", () => YellowSignalActive());
                TestMethods.Add("RedSignal", () => RedSignalActive());
                TestMethods.Add("HideSignal", () => HideSignal());
            }
        }

        private void NextCircle()
        {
            _indicators[CurrentIndexIndicator].IsEnabledIndicator = false;
            CheckIndexIndicator();
            _indicators[CurrentIndexIndicator].IsEnabledIndicator = true;
        }

        private void HideSignal()
        {
            _centerCircle.IsEnabledIndicator = false;
        }

        private MemoryStream _ms;
        public void Start(bool isTestQuest = false)
        {
            _isShowedMessages = isTestQuest;
            if (_isShowedMessages)
            {
                _messageTimer.Tick += _messageTimer_Tick;
                _messageTimer.Interval = TimeSpan.FromSeconds(1.5);
            }

            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick += _timer_Tick;

            _timeOutTimer.Tick += _timeOutTimer_Tick;

            var byteArray =
             SoundResources.GetSoundArray("pack://application:,,,/Updk7.Tests.Wpf;component/Source/Psychophysical/Sounds/beep.wav");
            _ms = new MemoryStream(byteArray);
            _player.Stream = _ms;

            Initialize();
            _indicators[CurrentIndexIndicator].IsEnabledIndicator = true;
            _timer.Start();

            OnPropertyChanged(nameof(CurrentIndexIndicator));
            OnPropertyChanged(nameof(SignalsTable));
        }

        private void Initialize()
        {
            Canva = new Canvas();
            Canva.Width = 500;
            Canva.Height = 500;
            generateCircles(new Size(Canva.Width, Canva.Height));
        }

        private void _messageTimer_Tick(object sender, EventArgs e)
        {
            Message = "";
            _messageTimer.Stop();
            _timer.Start();
            _isButtonsEnabled = true;
        }

        public void Stop()
        {
            _player.Stop();
            _player.Dispose();
            _timeOutTimer.Stop();
            _timeOutTimer.Tick -= _timeOutTimer_Tick;
            _timer.Tick -= _timer_Tick;
        }

        private TypeSignals? _currentSignal = null;
        Stopwatch sw = new Stopwatch();
        private void _timer_Tick(object sender, EventArgs e)
        {
            _context.Post(_ =>
            {
                sw.Restart();
                Time = Time.Add(new TimeSpan(0, 0, 1));
                var rowSignal = _signals.FirstOrDefault(f => f.Time.TotalSeconds == Time.TotalSeconds);

                if (rowSignal != null)
                {
                    var signal = rowSignal.Type;
                    switch (signal)
                    {
                        case TypeSignals.Alarm:
                            Jump();
                            _currentSignal = TypeSignals.Alarm;
                            _timeOutTimer.Interval = TimeSpan.FromSeconds(4);
                            _timeOutTimer.Start();
                            ResetTimer?.Invoke(this, new EventArgs());
                            break;
                        case TypeSignals.SignalWithWarning:
                            Jump();
                            _currentSignal = TypeSignals.SignalWithWarning;
                            _timeOutTimer.Interval = TimeSpan.FromSeconds(1);
                            _timeOutTimer.Start();
                            ResetTimer?.Invoke(this, new EventArgs());
                            break;
                        case TypeSignals.RedSignal:
                            RedSignalActive();
                            _currentSignal = TypeSignals.RedSignal;
                            _timeOutTimer.Interval = TimeSpan.FromSeconds(1.5);
                            _timeOutTimer.Start();
                            ResetTimer?.Invoke(this, new EventArgs());
                            _indicators[CurrentIndexIndicator].IsEnabledIndicator = false;
                            CheckIndexIndicator();
                            _indicators[CurrentIndexIndicator].IsEnabledIndicator = true;
                            _timer.Interval = TimeSpan.FromSeconds(1);
                            break;
                        case TypeSignals.AttentionSignal:
                            YellowSignalActive();
                            _currentSignal = TypeSignals.AttentionSignal;
                            _indicators[CurrentIndexIndicator].IsEnabledIndicator = false;
                            CheckIndexIndicator();
                            _indicators[CurrentIndexIndicator].IsEnabledIndicator = true;
                            _timer.Interval = TimeSpan.FromSeconds(1);
                            _timeOutTimer.Interval = TimeSpan.FromSeconds(2);
                            _timeOutTimer.Start();
                            break;
                    }
                }
                else
                {
                    _indicators[CurrentIndexIndicator].IsEnabledIndicator = false;
                    CheckIndexIndicator();
                    _indicators[CurrentIndexIndicator].IsEnabledIndicator = true;
                    _timer.Interval = TimeSpan.FromSeconds(1);
                }


                if (Time.TotalSeconds == 1200)
                {
                    _timer.Stop();
                    ReturtResult();
                }
                Console.WriteLine($"Tick value{sw.ElapsedMilliseconds}");
            }, null);

            PlaySound();
        }

        private void CheckIndexIndicator()
        {
            var curIndex = CurrentIndexIndicator + 1;
            if (curIndex == _indicators.Count)
                CurrentIndexIndicator = 0;
            else
                CurrentIndexIndicator = curIndex;
        }

        private void ReturtResult()
        {
            var Alarms_Average = _reactionsAlarm.Count > 0 ? _reactionsAlarm.Average() : 0.0;
            var SignalsWithWarning_Average = _reactionsSignalWithWarning.Count > 0 ? _reactionsSignalWithWarning.Average() : 0.0;
            var RedSignals_Average = _reactionsRedSignal.Count > 0 ? _reactionsRedSignal.Average() : 0.0;

            Results?.Invoke(this, new Dictionary<string, object>()
            {
                ["Среднеарифметическое время реагирования на экстренные сигналы"] = (float)Alarms_Average,
                ["Среднеарифметическое время реагирования на сигналы с предупреждением"] = (float)SignalsWithWarning_Average,
                ["Среднеарифметическое время реагирования на красные сигналы"] = (float)RedSignals_Average,
                ["Количество пропусков экстренных сигналов"] = _signalAlarmPasses,
                ["Количество пропусков сигналов с предупреждением"] = _signalWithWarningPasses,
                ["Количество пропусков красных сигналов"] = _redPasses,
                ["Количество неправильных нажатий на экстренные сигналы"] = _countErrorsAlarm,
                ["Количество неправильных нажатий на сигналы с предупреждением"] = _countErrorsSignalWithWarning,
                ["Количество неправильных нажатий на красные сигналы"] = _countErrorsRedSignal,
                ["Показатель бдительности"] = (float)(Alarms_Average - SignalsWithWarning_Average),
                ["Общее количество пропусков"] = _redPasses + _signalAlarmPasses + _signalWithWarningPasses,
                ["Общее количество неправильных нажатий"] = _countErrorsAlarm + _countErrorsSignalWithWarning + _countErrorsRedSignal
            });
        }

        private int _redPasses = 0;
        private int _signalWithWarningPasses = 0;
        private int _signalAlarmPasses = 0;

        private void _timeOutTimer_Tick(object sender, EventArgs e)
        {
            switch (_currentSignal.Value)
            {
                case TypeSignals.Alarm:
                    Message = "Был пропущен перескок";
                    _signalAlarmPasses++;
                    break;
                case TypeSignals.SignalWithWarning:
                    Message = "Был пропущен перескок";
                    _signalWithWarningPasses++;
                    break;
                case TypeSignals.RedSignal:
                    Message = "Вы не отреагировали на красный сигнал";
                    _redPasses++;
                    _centerCircle.IsEnabledIndicator = false;
                    break;
                case TypeSignals.AttentionSignal:
                    _centerCircle.IsEnabledIndicator = false;
                    break;
            }
            _currentSignal = TypeSignals.NoActive;
            _timeOutTimer.Stop();
        }

        private void RedSignalActive()
        {
            _centerCircle.IndicationColor = GetColor(ColorsCircle.Red);
            _centerCircle.IsEnabledIndicator = true;
        }

        private void YellowSignalActive()
        {
            _centerCircle.IndicationColor = GetColor(ColorsCircle.Yellow);
            _centerCircle.IsEnabledIndicator = true;
        }

        private int _countErrorsAlarm = 0;
        private int _countErrorsSignalWithWarning = 0;
        private int _countErrorsRedSignal = 0;

        private List<double> _reactionsAlarm = new List<double>();
        private List<double> _reactionsSignalWithWarning = new List<double>();
        private List<double> _reactionsRedSignal = new List<double>();

        public void PressButtton(Buttons button, int time)
        {
            _context.Post(_ =>
            {
                if (_isButtonsEnabled)
                {
                    if (_currentSignal != TypeSignals.NoActive && _currentSignal != TypeSignals.AttentionSignal)
                    {
                        if (button == Buttons.Green)
                        {
                            if (_currentSignal == TypeSignals.Alarm)
                            {
                                _timer.Tick -= _timer_Tick;
                                var curTime = time / 10000.0;
                                _reactionsAlarm.Add(curTime);
                                _indicators[CurrentIndexIndicator].IsEnabledIndicator = false;
                                CurrentIndexIndicator = CurrentIndexIndicator - 1;
                                if (CurrentIndexIndicator < 0)
                                    CurrentIndexIndicator = _indicators.Count - 1;
                                _indicators[CurrentIndexIndicator].IsEnabledIndicator = true;
                                _timer.Interval = TimeSpan.FromSeconds(1);
                                _currentSignal = TypeSignals.NoActive;
                                _timeOutTimer.Stop();
                                _timer.Tick += _timer_Tick;
                                Console.WriteLine($"Alarm {curTime}");
                            }
                            else if (_currentSignal == TypeSignals.SignalWithWarning)
                            {
                                _timer.Tick -= _timer_Tick;
                                var curTime = time / 10000.0;
                                _reactionsSignalWithWarning.Add(curTime);
                                _indicators[CurrentIndexIndicator].IsEnabledIndicator = false;
                                CurrentIndexIndicator = CurrentIndexIndicator - 1;
                                if (CurrentIndexIndicator < 0)
                                    CurrentIndexIndicator = _indicators.Count - 1;
                                _indicators[CurrentIndexIndicator].IsEnabledIndicator = true;
                                _timer.Interval = TimeSpan.FromSeconds(1);
                                _currentSignal = TypeSignals.NoActive;
                                _timeOutTimer.Stop();
                                _timer.Tick += _timer_Tick;
                                Console.WriteLine($"SignalWithWarning {curTime}");
                            }
                            else if (_currentSignal == TypeSignals.RedSignal)
                            {
                                _countErrorsRedSignal++;
                            }
                        }
                        else if (button == Buttons.Red)
                        {
                            if (_currentSignal == TypeSignals.RedSignal)
                            {
                                var curTime = time / 10000.0;
                                _reactionsRedSignal.Add(curTime);
                                _centerCircle.IsEnabledIndicator = false;
                                _currentSignal = TypeSignals.NoActive;
                                _timeOutTimer.Stop();
                                Console.WriteLine($"RedSignal {curTime}");
                            }
                            else if (_currentSignal == TypeSignals.Alarm)
                                _countErrorsAlarm++;
                            else if (_currentSignal == TypeSignals.SignalWithWarning)
                                _countErrorsSignalWithWarning++;
                        }
                    }
                }
            }, null);
        }

        private void Jump()
        {
            _indicators[CurrentIndexIndicator].IsEnabledIndicator = false;
            CurrentIndexIndicator = CurrentIndexIndicator + 2;
            if (CurrentIndexIndicator == _indicators.Count)
                CurrentIndexIndicator = 0;
            else if (CurrentIndexIndicator > _indicators.Count)
                CurrentIndexIndicator = 1;
            _indicators[CurrentIndexIndicator].IsEnabledIndicator = true;
        }

        private void PlaySound()
        {
            _player.Play();
        }

        private void ModificationTableSignalTimePlus(TimeSpan timePlus)
        {
            foreach (var rowSignal in _signals)
                rowSignal.Time = rowSignal.Time.Add(timePlus);
            OnPropertyChanged("SignalsTable");
        }

        public void CloseRes()
        {
            _player.Dispose();
            _timer.Stop();
            _timer.Dispose();
            if (_ms != null)
                _ms.Dispose();
        }

        #region generator

        private void generateCircles(Size canvasSize, int countCircles = 60)
        {
            var center = Canva.Height / 2;
            var angle = 360 / countCircles;
            Point centerPoint = new Point(center, 0);
            Size indicatorSize = new Size(15, 15);

            for (int i = 270; i < 360; i = i + angle)
                SetIndicator(canvasSize, centerPoint, indicatorSize, i);

            for (int i = 0; i < 270; i = i + angle)
                SetIndicator(canvasSize, centerPoint, indicatorSize, i);

            var cCircle = new Indicator();
            cCircle.Height = cCircle.Width = indicatorSize.Height * 2;
            cCircle.SetValue(Canvas.LeftProperty, (Canva.Width / 2) - cCircle.Width / 2);
            cCircle.SetValue(Canvas.TopProperty, (Canva.Height / 2) - cCircle.Height / 2);
            Canva.Children.Add(cCircle);
            cCircle.Stroke = Brushes.White;
            _centerCircle = cCircle;
        }

        private void SetIndicator(Size canvasSize, Point centerPoint, Size indicatorSize, int i)
        {
            var color = ColorsCircle.Green;
            var indicator = generateCircle(centerPoint, indicatorSize, i, canvasSize, GetColor(color, true));
            indicator.Color = color;
            Canva.Children.Add(indicator);
            _indicators.Add(indicator);
        }

        private Vector rotateVector(Point centerPoint, double angle)
        {
            double vX = (centerPoint.X * Math.Cos(Mathematic.ToRadians(angle))) - (centerPoint.Y * Math.Sin(Mathematic.ToRadians(angle)));
            double vY = (centerPoint.X * Math.Sin(Mathematic.ToRadians(angle))) + (centerPoint.Y * Math.Cos(Mathematic.ToRadians(angle)));
            return new Vector(vX, vY);
        }

        private Indicator generateCircle(Point centerpoint, Size size, double angle, Size canvasSize, Brush fill)
        {
            var v = rotateVector(centerpoint, angle);
            var elli = new Indicator() { Height = size.Height, Width = size.Width, IndicationColor = fill };

            //Сдвигаем точку, т. к. вектор строится от нуля
            v.X = (v.X + canvasSize.Width / 2);
            v.Y = (v.Y + canvasSize.Height / 2);

            elli.SetValue(Canvas.LeftProperty, v.X - elli.Width / 2);
            elli.SetValue(Canvas.TopProperty, v.Y - elli.Height / 2);
            elli.Angle = angle;
            return elli;
        }
        #endregion
    }

    public enum Buttons
    {
        Green,
        Red
    }

    public class RowSignal
    {
        public TypeSignals Type { get; set; }
        public TimeSpan Time { get; set; }
        public RowSignal(TypeSignals type, TimeSpan time)
        {
            Type = type;
            Time = time;
        }
        private int? _randomFrom;
        private int? _randomTo;
        public RowSignal(TypeSignals type, int randomSecondsFrom, int randomSecondsTo)
        {
            _randomFrom = randomSecondsFrom;
            _randomTo = randomSecondsTo;
            Type = type;
        }

        /// <summary>
        /// Генерирует время сигнала(использовать только после конструктора с рандомайзером)
        /// </summary>
        public void GenerateTime()
        {
            Time = TimeSpan.FromSeconds(_rnd.Next(_randomFrom.Value, _randomTo.Value + 1));
        }
    }

    public enum TypeSignals
    {
        Alarm,            //экстренный сигнал
        SignalWithWarning,//сигнал с предупреждением
        RedSignal,        //красный сигнал (центральная точка в круге)
        AttentionSignal,//жёлтый предупреждающий сигнал (центральная точка в круге)
        NoActive//Нет активности (сигнала)
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\VigilanceAssessment\VigilanceAssessmentViewModel.cs


using System;
using System.Collections.Generic;
using System.Windows;
using Updk7.Tests.Pult;

namespace Updk7.Tests.Wpf.Psychophysical.VigilanceAssessment
{
    public class VigilanceAssessmentViewModel : TestBase
    {
        public override event EventHandler<Results> Results;
        
        private Pult.PultButtons Buttons;
        public VigilanceAssessmentControl control;
        private ISignals _signals;
        public VigilanceAssessmentViewModel(ISignals signals, EnumTests testType, PultButtons instructionPult, IPult pult = null, IPult additionalPult = null) : base(instructionPult, pult, additionalPult)
        {
            TestType = testType;
            _signals = signals;
            Manager.TraningTime = TimeSpan.FromSeconds(95);
            SetInstructions("vigilanceAssessment");
        }

        public override FrameworkElement GetTestControl()
        {
            return new VigilanceAssessmentControl(mode: LearningTasksExtension.TestMode.Manual);
        }
        public override void TestManual()
        {
            control = new VigilanceAssessmentControl(mode: LearningTasksExtension.TestMode.Manual);
            Manager.TestProxy = new TestProxy();
            Manager.TestProxy.SetTest(control);
        }

        public override void ToDefault()
        {
            base.ToDefault();
            TestCurrentView = control;
        }

        public override void TestStart()
        {
            control = new VigilanceAssessmentControl(_signals);
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.UpdateInterval = TimeSpan.FromMilliseconds(20);
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start(true);
        }

        public override void DisconnectedPult(Exception e)
        {
            base.DisconnectedPult(e);
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e });
        }

        private void Buttons_Disconnected(object sender, DisconnectedEventArgs e)
        {
            Results?.Invoke(this, new Results(new Dictionary<string, object>()) { Exception = e.Exception });
        }

        public override void Start()
        {
            control = new VigilanceAssessmentControl(_signals);
            TestCurrentView = control;
            Buttons = Pult as PultButtons;
            Buttons.UpdateInterval = TimeSpan.FromMilliseconds(20);
            Buttons.ButtonPressed += Buttons_ButtonPressed;
            Buttons.Disconnected += Buttons_Disconnected;
            control.Results += TestCurrentView_Results;
            control.ResetTimer += Control_ResetTimer;
            Buttons.Start();
            control.Start();
        }

        private void Control_ResetTimer(object sender, EventArgs e)
        {
            Buttons.Start();
        }

        private void TestCurrentView_Results(object sender, Dictionary<string, object> e)
        {
            Results?.Invoke(this, new Results(e));
        }

        private void Buttons_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            if (e.Button == PultButton.Green)
                control.PressButtton(VigilanceAssessment.Buttons.Green,e.Time);
            else if (e.Button == PultButton.Red)
                control.PressButtton(VigilanceAssessment.Buttons.Red,e.Time);
        }

        public override void Stop()
        {
            base.Stop();
            if (Buttons != null)
            {
                Buttons.Disconnected -= Buttons_Disconnected;
                Buttons.ButtonPressed -= Buttons_ButtonPressed;
                Buttons.Stop();
            }
            if (control != null)
            {
                control.Results -= TestCurrentView_Results;
                control.ResetTimer -= Control_ResetTimer;
                control.Stop();
                control.CloseRes();
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Psychophysical\VigilanceAssessmentM\Signals.cs


using System;
using System.Collections.Generic;
using Updk7.Tests.Wpf.Psychophysical.VigilanceAssessment;

namespace Updk7.Tests.Wpf.Psychophysical.VigilanceAssessmentM
{
    public class Signals : ISignals
    {
        public List<RowSignal> SignalsData { get; private set; } = new List<RowSignal>()
        {
            new RowSignal(TypeSignals.Alarm,6,9),
            new RowSignal(TypeSignals.Alarm,15,20),
            new RowSignal(TypeSignals.Alarm,28,32),
            new RowSignal(TypeSignals.RedSignal,35,38),
            new RowSignal(TypeSignals.Alarm,42,46),
            new RowSignal(TypeSignals.Alarm,51,55),
            new RowSignal(TypeSignals.AttentionSignal,60,62),
            new RowSignal(TypeSignals.SignalWithWarning,65,67),
            new RowSignal(TypeSignals.RedSignal,73,77),
            new RowSignal(TypeSignals.AttentionSignal,80,82),
            new RowSignal(TypeSignals.SignalWithWarning,85,87),
            new RowSignal(TypeSignals.RedSignal,94,99),
            new RowSignal(TypeSignals.AttentionSignal,103,106),
            new RowSignal(TypeSignals.SignalWithWarning,109,111),
            new RowSignal(TypeSignals.RedSignal,122,127),
            new RowSignal(TypeSignals.AttentionSignal,135,137),
            new RowSignal(TypeSignals.SignalWithWarning,140,142),
            new RowSignal(TypeSignals.AttentionSignal,157,159),
            new RowSignal(TypeSignals.SignalWithWarning,162,165),
            new RowSignal(TypeSignals.Alarm,175,179),
            new RowSignal(TypeSignals.RedSignal,186,190),
            new RowSignal(TypeSignals.AttentionSignal,195,197),
            new RowSignal(TypeSignals.SignalWithWarning,200,203),
            new RowSignal(TypeSignals.Alarm,210,213),
            new RowSignal(TypeSignals.RedSignal,217,220),
            new RowSignal(TypeSignals.AttentionSignal,224,227),
            new RowSignal(TypeSignals.SignalWithWarning,230,233)
        };

        public Signals()
        {
            GenerateSignals();
        }

        private void GenerateSignals()
        {
            List<RowSignal> baseSignals = SignalsData;

            List<RowSignal> AllSignals = new List<RowSignal>();

            for (int cycle = 0; cycle < 5; cycle++)
            {
                var timePlus = cycle * 240;
                for (int i = 0; i < baseSignals.Count; i++)
                {
                    baseSignals[i].GenerateTime();
                    var signal = new RowSignal(baseSignals[i].Type, baseSignals[i].Time.Add(TimeSpan.FromSeconds(timePlus)));
                    AllSignals.Add(signal);
                }
            }
            
            SignalsData = AllSignals;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\CustomQuestionnairesRepository.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;

namespace Updk7.Tests.Wpf.Questionnaires
{
    public class CustomQuestionnairesRepository : ITestsRepository
    {
        private Lazy<Views.CustomQuestionnairesView> _view = new Lazy<Views.CustomQuestionnairesView>(() => new Views.CustomQuestionnairesView());
        private Dictionary<TestType, Uri> _resolveDictionary;

        public CustomQuestionnairesRepository()
        {
            _resolveDictionary = createResolveDictionary();
        }
         
        public bool Contains(TestType testType)
        {
            var result = _resolveDictionary.ContainsKey(testType);
            return result;
        }

        public ITest GetTest(TestType testType, Pult.IDataTransport controlDeviceTransport)
        {
            var viewModel = new ViewModels.CustomQuestionnairesViewModel(testType);
            viewModel.Questionnaire = GetTestData(testType);
            return viewModel;
        }

        public FrameworkElement GetView(TestType testType)
        {
            return _view.Value;
        }

        public Data.Questionnaire GetTestData(TestType testType)
        {
            Debug.Assert(Contains(testType));
            var testDictionary = new ResourceDictionary() { Source = _resolveDictionary[testType] };
            var test = testDictionary["Test"] as Data.Questionnaire;

            return test;
        }

        private Uri createQuestionnaireUri(string dictionaryName)
        {
            return new Uri($"/Updk7.Tests.Wpf;component/Resources/Questionnaires/{dictionaryName}.xaml",
                UriKind.Relative);
        }

        private Dictionary<TestType, Uri> createResolveDictionary()
        {
            var dictionary = new Dictionary<TestType, Uri>();

            dictionary[TestType.Опросник_САН] =
                createQuestionnaireUri("Опросник_САН");

            dictionary[TestType.Тест_Стиль_руководства_СР] =
                createQuestionnaireUri("Стиль_руководства");

            dictionary[TestType.Ценностные_ориентации_Рокич] =
                createQuestionnaireUri("Ценностные_ориентации_Рокич");

            dictionary[TestType.Тест_Люшера] =
                createQuestionnaireUri("Тест_Люшера");

            return dictionary;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\QuestionnairesRepository.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;

namespace Updk7.Tests.Wpf.Questionnaires
{
    public class QuestionnairesRepository : ITestsRepository
    {
        private Lazy<Views.QuestionnaireView> _view = new Lazy<Views.QuestionnaireView>(() => new Views.QuestionnaireView());
        private Lazy<ViewModels.QuestionnaireViewModel> _viewModel = new Lazy<ViewModels.QuestionnaireViewModel>(() => new ViewModels.QuestionnaireViewModel());
        private Dictionary<TestType, Uri> _resolveDictionary;

        public QuestionnairesRepository()
        {
            _resolveDictionary = createResolveDictionary();
        }

        public bool Contains(TestType testType)
        {
            return _resolveDictionary.ContainsKey(testType);
        }

        public ITest GetTest(TestType testType, Pult.IDataTransport controlDeviceTransport)
        {
            _viewModel.Value.Questionnaire = GetTestData(testType);
            return _viewModel.Value;
        }

        public FrameworkElement GetView(TestType testType)
        {
            return _view.Value;
        }

        public Data.Questionnaire GetTestData(TestType testType)
        {
            Debug.Assert(Contains(testType));
            var testDictionary = new ResourceDictionary() { Source = _resolveDictionary[testType] };
            var test = testDictionary["Test"] as Data.Questionnaire;

            return test;
        }

        private Uri createQuestionnaireUri(string dictionaryName)
        {
            return new Uri($"/Updk7.Tests.Wpf;component/Resources/Questionnaires/{dictionaryName}.xaml",
                UriKind.Relative);
        }

        private Dictionary<TestType, Uri> createResolveDictionary()
        {
            var dictionary = new Dictionary<TestType, Uri>();

            dictionary[TestType.Методика_диагностики_уровня_агрессии_Басс_Дарки] =
                createQuestionnaireUri("Дигностика_уровня_агрессии_Басс_Дарки");

            dictionary[TestType.Тест_опросник_на_исследование_волевой_саморегуляции_ИВС] =
                createQuestionnaireUri("Исследование_волевой_саморегуляции");

            dictionary[TestType.Тест_опросник_Индекс_жизненного_стиля_ИЖС] =
                createQuestionnaireUri("Индекс_жизненного_стиля");

            dictionary[TestType.Сокращенный_многопрофильный_опросник_личности_СМОЛ] =
                createQuestionnaireUri("СМОЛ");

            dictionary[TestType.Тест_опросник_Склонность_к_зависимому_поведению_ЗП] =
                createQuestionnaireUri("Склонность_к_зависимому_поведению");

            dictionary[TestType.Тест_антиципационной_состоятельности_АС] =
                createQuestionnaireUri("Антиципационная_состоятельность");

            dictionary[TestType.Диагностики_мотивации_к_достижению_успеха_Элерса_МДУ] =
                createQuestionnaireUri("МДУ_Элерс");

            dictionary[TestType.Диагностика_степени_готовности_склонности_к_риску_Шуберт] =
                createQuestionnaireUri("Склонность_к_риску_Шуберт");

            dictionary[TestType.Методика_Аналогии] =
                createQuestionnaireUri("Аналогии");

            dictionary[TestType.Опросник_Личностный_профиль_ЛП] =
                createQuestionnaireUri("Личностный_профиль");

            dictionary[TestType.Комплексная_оценка_психологического_состояния_КОПС] =
                createQuestionnaireUri("КОПС");

            dictionary[TestType.Методика_ДОРС] =
                createQuestionnaireUri("ДОРС");

            dictionary[TestType.Оценка_нервно_психической_устойчивости_НПУ] =
               createQuestionnaireUri("Оценка_нервно_психической_устойчивости_НПУ");

            dictionary[TestType.Тест_Томаса_Конфликтность] =
                createQuestionnaireUri("Тест_Томаса");

            dictionary[TestType.Структура_темперамента_Смирнов] =
               createQuestionnaireUri("Структура_темперамента_Смирнов");

            dictionary[TestType.Адаптивность] =
                createQuestionnaireUri("Адаптивность");

            dictionary[TestType.Тест_Уровень_субъективного_контроля_УСК] =
                createQuestionnaireUri("Уровень_субъективного_контроля");

            dictionary[TestType.Тест_Айзенка_EPQ] =
                createQuestionnaireUri("Тест_Айзенка");

            dictionary[TestType.Тест_уровня_тревожности_Тейлор] =
                createQuestionnaireUri("Уровень_тревожности_по_Тейлору");

            dictionary[TestType.Тест_Спилберга] =
                createQuestionnaireUri("Тест_Спилбергера");

            dictionary[TestType.Тест_Лири] =
                createQuestionnaireUri("Тест_Лири");

            dictionary[TestType.Тест_MMPI_Березина] =
                createQuestionnaireUri("Тест_MMPI_Березина");

            dictionary[TestType.Q_Сортировка] =
                createQuestionnaireUri("Q_Сортировка");

            dictionary[TestType.Опроснок_профессиональных_предпочтений_Голланд] =
                createQuestionnaireUri("Голланд");

            dictionary[TestType.Тест_Потребность_в_достижении_ПД] =
                createQuestionnaireUri("Потребность_в_достижении");

            dictionary[TestType.Тест_Кетелла] =
                createQuestionnaireUri("Тест_Кеттелла");

            dictionary[TestType.Диагностики_мотивации_к_избеганию_неудач_Элерса_МИН] =
                createQuestionnaireUri("Мотивация_к_избеганию_неудач_Элерс");

            dictionary[TestType.Тест_Зунга] =
                createQuestionnaireUri("Зунг");

            dictionary[TestType.Тип_акцентуации_личности_Шмишека_Леонгарда] =
                createQuestionnaireUri("Шмишек_Леонгард");

            dictionary[TestType.Аддикция_и_аддиктивное_поведение] =
               createQuestionnaireUri("Аддикция_и_аддиктивное_поведение");

            return dictionary;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Answer.cs


using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Questionnaires.Data
{
    [ContentProperty(nameof(Content))]
    public class Answer
    {
        public Answer()
        {
        }

        public object Content { get; internal set; }

        public bool IsSelected { get; set; }

        public string EnteredText { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\AnswersCollection.cs


using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Questionnaires.Data
{
    public class AnswersCollection : List<Answer>
    {
        public AnswersCollection()
        {
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\AnswersType.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data
{
    public enum AnswersType
    {
        SingleChoice,
        MultiChoice,
        Text
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Question.cs


using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Questionnaires.Data
{
    [ContentProperty(nameof(Answers))]
    public class Question
    {
        public Question()
        {
        }

        public string Text { get; set; }

        public AnswersType AnswersType { get; internal set; }

        public AnswersCollection Answers { get; internal set; } = new AnswersCollection();
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Questionnaire.cs


using System;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Questionnaires.Data
{
    [ContentProperty(nameof(Questions))]
    public class Questionnaire
    {
        public Questionnaire()
        {
        }

        public string Title { get; internal set; }

        public object Instruction { get; internal set; }

        public TimeSpan TestDuration { get; internal set; }

        public Keys.IQuestionnaireKeys Keys { get; internal set; }

        public QuestionsCollection Questions { get; internal set; } = new QuestionsCollection();
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\QuestionsCollection.cs


using System.Linq;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Questionnaires.Data
{
    public class QuestionsCollection : List<Question>
    {
        public QuestionsCollection()
        {
        }

        /// <summary>
        /// Возвращает перечисление вопросов с заданными номерами
        /// </summary>
        /// <remarks>
        /// Нумерация вопросов начинается с 1!
        /// </remarks>
        /// <param name="questionNumbers">Номера вопросов (нумерация с 1)</param>
        /// <returns>Перечисление вопросов</returns>
        public IEnumerable<Question> SelectQuestions(int[] questionNumbers)
        {
            foreach (var number in questionNumbers)
                yield return this[number - 1];
        }

        /// <summary>
        /// Возвращает перечисление вопросов с заданными номерами и заданным номером выбранного
        /// ответа
        /// </summary>
        /// <param name="answerNumber">Номер выбранного ответа в вопросе (начинается с 1)</param>
        /// <param name="questionNumbers">Номера вопросов (нумерация с 1)</param>
        /// <returns></returns>
        public IEnumerable<Question> SelectQuestions(int answerNumber, int[] questionNumbers)
        {
            return SelectQuestions(questionNumbers)
                .Where(q => q.Answers[answerNumber - 1].IsSelected);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\IQuestionnaireKeys.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public interface IQuestionnaireKeys
    {
        TestResults CalculateResults(Questionnaire questionnaire);
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Q_Сортировка.cs


using System.Linq;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Q_Сортировка: IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Зависимость = "Зависимость";
            public static readonly string Независимость = "Независимость";
            public static readonly string Общительность = "Общительность";
            public static readonly string Необщительность = "Необщительность";
            public static readonly string Боротьба = "Принятие «борьбы»";
            public static readonly string Неборотьба = "Избегание «борьбы»";
            public static readonly string Флаги = "Внутренняя конфликтность и нерешительность";
        }

        private const int Да = 1;
        private const int Сомневаюсь = 2;
        private const int Нет = 3;

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Q_Сортировка);

            var NumberQuestion_NumberAnswer = new Dictionary<int, int>();

            foreach (var question in questionnaire.Questions)
            {
                var numberQuestion = questionnaire.Questions.IndexOf(question) + 1;
                var numberAnswer = question.Answers.IndexOf(question.Answers.FirstOrDefault(f => f.IsSelected)) + 1;
                NumberQuestion_NumberAnswer.Add(numberQuestion, numberAnswer);
            }

            var scale_1 = GetScaleValues(NumberQuestion_NumberAnswer, new int[] { 3, 9, 15, 21, 27, 33, 39, 45, 51, 54 });
            var scale_2 = GetScaleValues(NumberQuestion_NumberAnswer, new int[] { 6, 12, 18, 24, 30, 36, 42, 48, 57, 60 });
            var scale_3 = GetScaleValues(NumberQuestion_NumberAnswer, new int[] { 5, 7, 13, 19, 25, 31, 37, 43, 49, 52 });
            var scale_4 = GetScaleValues(NumberQuestion_NumberAnswer, new int[] { 4, 10, 16, 22, 28, 34, 40, 46, 55, 58 });
            var scale_5 = GetScaleValues(NumberQuestion_NumberAnswer, new int[] { 1, 11, 17, 23, 29, 35, 41, 47, 56, 59 });
            var scale_6 = GetScaleValues(NumberQuestion_NumberAnswer, new int[] { 2, 8, 14, 20, 26, 32, 38, 44, 50, 53 });

            var scaleValues = new List<int[]> { scale_1, scale_2, scale_3, scale_4, scale_5, scale_6 };
            string flags = "";

            for (int i = 0; i <= 2; i++)
                if (scaleValues[2 * i][0] == scaleValues[2 * i + 1][0])
                    flags = flags + "1";
                else
                    flags = flags + "0";

            foreach (var scaleValue in scaleValues)
                if (scaleValue[2] > 2)
                    flags = flags + "1";
                else
                    flags = flags + "0";

            results.AddValue(new TestResultValue(ScaleKeys.Зависимость, scale_1[0] + scale_2[1]));
            results.AddValue(new TestResultValue(ScaleKeys.Независимость, scale_2[0] + scale_1[1]));

            results.AddValue(new TestResultValue(ScaleKeys.Общительность, scale_3[0] + scale_4[1]));
            results.AddValue(new TestResultValue(ScaleKeys.Необщительность, scale_4[0] + scale_3[1]));

            results.AddValue(new TestResultValue(ScaleKeys.Боротьба, scale_5[0] + scale_6[1]));
            results.AddValue(new TestResultValue(ScaleKeys.Неборотьба, scale_6[0] + scale_5[1]));

            results.AddValue(new TestResultValue(ScaleKeys.Флаги, flags));

            return results;
        }

        private bool IsConflict(int scaleYes1, int scaleYes2)
        {
            if (scaleYes1 == scaleYes2)
                return true;
            else return false;
        }

        private int[] GetScaleValues(Dictionary<int, int> answers, int[] questions)
        {
            //количество ответов Да
            int first = 0;
            //количество ответов Нет
            int second = 0;
            //количество ответов Сомневаюсь
            int three = 0;

            for (int i = 0; i < questions.Length; i++)
            {
                var answer = answers.FirstOrDefault(f => f.Key == questions[i]);
                if (answer.Value == Да)
                    first++;
                else if (answer.Value == Нет)
                    second++;
                else if (answer.Value == Сомневаюсь)
                    three++;
            }
            return new int[] { first, second, three };
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Адаптивность.cs


using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Адаптивность : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Veracity = "Достоверность";
            public static readonly string Neuropsychic_resistance = "Нервно-психическая устойчивость";
            public static readonly string Communicative_features = "Коммуникативные особенности";
            public static readonly string Moral_normativity = "Моральная нормативность";
            public static readonly string Adaptive_abilities = "Адаптивные способности";
            
            public static readonly string Neuropsychic_resistance_stens = "Нервно-психическая устойчивость (в стэнах)";
            public static readonly string Communicative_features_stens = "Коммуникативные особенности (в стэнах)";
            public static readonly string Moral_normativity_stens = "Моральная нормативность (в стэнах)";
            public static readonly string Adaptive_abilities_stens = "Адаптивные способности (в стэнах)";
        }

        private const int Yes = 1;
        private const int No = 2;

        public Адаптивность()
        {

        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Адаптивность);

            results.AddValue(new TestResultValue(ScaleKeys.Veracity, 0)
               .Add(questionnaire, No, 1, 10, 19, 31, 51, 69, 78, 92, 101, 116, 128, 138, 148));

            results.AddValue(new TestResultValue(ScaleKeys.Neuropsychic_resistance, 0)
              .Add(questionnaire, Yes, 4, 6, 7, 8, 11, 12, 15, 16, 17, 18, 20, 21, 28, 29,
                                       30, 37, 39, 40, 41, 47, 57, 60, 63, 65, 67, 68, 70, 71, 73, 75, 80, 82, 83,
                                       84, 86, 89, 94, 95, 96, 98, 102, 103, 108, 109, 110, 111, 112, 113, 115, 117,
                                       118, 119, 120, 122, 123, 124, 129, 131, 135, 136, 137, 139, 143, 146, 149,
                                       153, 154, 155, 156, 157, 158, 161, 162)
              .Add(questionnaire, No, 2, 3, 5, 23, 25, 32, 38, 44, 45, 49, 52, 53, 54, 55, 58, 62, 66, 87, 105, 127, 132, 134, 140));

            var NR_Stens = results.Values.FirstOrDefault(f => f.Key == ScaleKeys.Neuropsychic_resistance);
            results.AddValue(new TestResultValue(ScaleKeys.Neuropsychic_resistance_stens, GetNeuropsychicResistanceInStens(NR_Stens.Int)));

            results.AddValue(new TestResultValue(ScaleKeys.Communicative_features, 0)
              .Add(questionnaire, Yes, 9, 24, 27, 33, 46, 61, 64, 81, 88, 90, 99, 104, 106, 114, 121, 126, 133, 142, 151, 152)
              .Add(questionnaire, No, 26, 34, 35, 48, 74, 85, 107, 130, 144, 147, 159));

            var CF_Stens = results.Values.FirstOrDefault(f => f.Key == ScaleKeys.Communicative_features);
            results.AddValue(new TestResultValue(ScaleKeys.Communicative_features_stens, GetCommunicativeFeaturesInStens(CF_Stens.Int)));

            results.AddValue(new TestResultValue(ScaleKeys.Moral_normativity, 0)
             .Add(questionnaire, Yes, 14, 22, 36, 42, 50, 56, 59, 72, 77, 79, 91, 93, 125, 141, 145, 150, 164, 165)
             .Add(questionnaire, No, 13, 76, 97, 100, 160, 163));

            var MN_Stens = results.Values.FirstOrDefault(f => f.Key == ScaleKeys.Moral_normativity);
            results.AddValue(new TestResultValue(ScaleKeys.Moral_normativity_stens, GetMoralNormativityInStens(MN_Stens.Int)));

            results.AddValue(new TestResultValue(ScaleKeys.Adaptive_abilities, 0)
              .Add(questionnaire, Yes, 4, 6, 7, 8, 9, 11, 12, 14, 15, 16, 17, 18, 20, 21, 22,
                                       24, 27, 28, 29, 30, 33, 36, 37, 39, 40, 41, 42, 43, 46, 47, 50, 56, 57, 59, 60,
                                       61, 63, 64, 65, 67, 68, 70, 71, 72, 73, 75, 77, 79, 80, 81, 82, 83, 84, 86, 88,
                                       89, 90, 91, 93, 94, 60, 95, 96, 98, 99, 102, 103, 104, 106, 108, 109, 110, 111,
                                       112, 113, 114, 115, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 129, 131,
                                       133, 135, 136, 137, 139, 141, 142, 143, 145, 146, 149, 150, 151, 152, 153, 154,
                                       155, 156, 157, 158, 161, 162, 164, 165)
              .Add(questionnaire, No, 2, 3, 5, 13, 23, 25, 26, 32, 34, 35, 38, 44, 45, 48, 49, 52, 53, 54, 55, 58, 62,
                                      66, 74, 76, 85, 87, 97, 100, 105, 107, 127, 130, 132, 134, 140, 144, 147, 159, 160, 163));

            var AA_Stens = results.Values.FirstOrDefault(f => f.Key == ScaleKeys.Adaptive_abilities);
            results.AddValue(new TestResultValue(ScaleKeys.Adaptive_abilities_stens, GetAdaptiveAbilitiesInStens(AA_Stens.Int)));

            return results;
        }

        /// <summary>
        /// Возвращает Адаптивные способности в стэнах
        /// </summary>
        /// <param name="rawPoints"></param>
        /// <returns></returns>
        private int GetAdaptiveAbilitiesInStens(int rawPoints)
        {
            if (rawPoints >= 62)
                return 1;
            else if (rawPoints >= 51 && rawPoints <= 61)
                return 2;
            else if (rawPoints >= 40 && rawPoints <= 50)
                return 3;
            else if (rawPoints >= 33 && rawPoints <= 39)
                return 4;
            else if (rawPoints >= 28 && rawPoints <= 32)
                return 5;
            else if (rawPoints >= 22 && rawPoints <= 27)
                return 6;
            else if (rawPoints >= 16 && rawPoints <= 21)
                return 7;
            else if (rawPoints >= 11 && rawPoints <= 15)
                return 8;
            else if (rawPoints >= 6 && rawPoints <= 10)
                return 9;
            else if (rawPoints >= 1 && rawPoints <= 5)
                return 10;
            return 0;
        }

        /// <summary>
        /// Возвращает Нервно-психическую устойчивость в стэнах
        /// </summary>
        /// <param name="rawPoints"></param>
        /// <returns></returns>
        private int GetNeuropsychicResistanceInStens(int rawPoints)
        {
            if (rawPoints >= 46)
                return 1;
            else if (rawPoints >= 38 && rawPoints <= 45)
                return 2;
            else if (rawPoints >= 30 && rawPoints <= 37)
                return 3;
            else if (rawPoints >= 22 && rawPoints <= 29)
                return 4;
            else if (rawPoints >= 16 && rawPoints <= 21)
                return 5;
            else if (rawPoints >= 13 && rawPoints <= 15)
                return 6;
            else if (rawPoints >= 9 && rawPoints <= 12)
                return 7;
            else if (rawPoints >= 6 && rawPoints <= 8)
                return 8;
            else if (rawPoints >= 4 && rawPoints <= 5)
                return 9;
            else if (rawPoints >= 0 && rawPoints <= 3)
                return 10;
            return 0;
        }


        /// <summary>
        /// Возвращает Коммуникативные особенности в стэнах
        /// </summary>
        /// <param name="rawPoints"></param>
        /// <returns></returns>
        private int GetCommunicativeFeaturesInStens(int rawPoints)
        {
            if (rawPoints >= 27 && rawPoints <= 31)
                return 1;
            else if (rawPoints >= 22 && rawPoints <= 26)
                return 2;
            else if (rawPoints >= 17 && rawPoints <= 21)
                return 3;
            else if (rawPoints >= 13 && rawPoints <= 16)
                return 4;
            else if (rawPoints >= 10 && rawPoints <= 12)
                return 5;
            else if (rawPoints >= 7 && rawPoints <= 9)
                return 6;
            else if (rawPoints >= 5 && rawPoints <= 6)
                return 7;
            else if (rawPoints >= 3 && rawPoints <= 4)
                return 8;
            else if (rawPoints >= 1 && rawPoints <= 2)
                return 9;
            else if (rawPoints == 0)
                return 10;
            return 0;
        }


        /// <summary>
        /// Возвращает Моральную нормативность в стэнах
        /// </summary>
        /// <param name="rawPoints"></param>
        /// <returns></returns>
        private int GetMoralNormativityInStens(int rawPoints)
        {
            if (rawPoints >= 18)
                return 1;
            else if (rawPoints >= 15 && rawPoints <= 17)
                return 2;
            else if (rawPoints >= 12 && rawPoints <= 14)
                return 3;
            else if (rawPoints >= 10 && rawPoints <= 11)
                return 4;
            else if (rawPoints >= 7 && rawPoints <= 9)
                return 5;
            else if (rawPoints >= 5 && rawPoints <= 6)
                return 6;
            else if (rawPoints >= 3 && rawPoints <= 4)
                return 7;
            else if (rawPoints == 2)
                return 8;
            else if (rawPoints == 1)
                return 9;
            else if (rawPoints == 0)
                return 10;
            return 0;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Аддикция_и_аддиктивное_поведение.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Updk7.Tests.Wpf.Questionnaires.Data;
using Updk7.Tests.Wpf.Questionnaires.Data.Keys;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Аддикция_и_аддиктивное_поведение : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Уровень_проявления_аддикции = "Уровень проявления аддикции (УП)";
            public static readonly string Изменение_толерантности = "Изменение толерантности";
            public static readonly string Синдром_отмены = "Синдром отмены";
            public static readonly string Потеря_контроля = "Потеря контроля";
            public static readonly string Неудачные_попытки_воздержаться = "Неудачные попытки воздержаться";
            public static readonly string Употребление_несмотря_на = "Употребление «несмотря на…»";
            public static readonly string Отрицание_своей_зависимости = "Отрицание своей зависимости";
            public static readonly string Резкие_изменения_в_образе_жизни = "Резкие изменения в образе жизни";
            public static readonly string Степень_выраженности_аддикции = "Степень выраженности аддикции (СВ)";
        }

        private readonly Dictionary<int, int> answerScore = new Dictionary<int, int>() { [0] = 3, [1] = 2, [2] = 1, [3] = 0 };
        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Аддикция_и_аддиктивное_поведение);

            results.AddValue(new TestResultValue(ScaleKeys.Уровень_проявления_аддикции, 0)
              .Add(questionnaire, answerScore.Values.ToArray(), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32));
            results.AddValue(new TestResultValue(ScaleKeys.Изменение_толерантности, 0)
              .Add(questionnaire, answerScore.Values.ToArray(), 4, 6, 10, 16));
            results.AddValue(new TestResultValue(ScaleKeys.Синдром_отмены, 0)
              .Add(questionnaire, answerScore.Values.ToArray(), 11, 23, 28, 31, 32));
            results.AddValue(new TestResultValue(ScaleKeys.Потеря_контроля, 0)
              .Add(questionnaire, answerScore.Values.ToArray(), 3, 5, 14, 27, 29));
            results.AddValue(new TestResultValue(ScaleKeys.Неудачные_попытки_воздержаться, 0)
              .Add(questionnaire, answerScore.Values.ToArray(), 8, 19, 20, 21));
            results.AddValue(new TestResultValue(ScaleKeys.Употребление_несмотря_на, 0)
              .Add(questionnaire, answerScore.Values.ToArray(), 1, 2, 7, 9, 18));
            results.AddValue(new TestResultValue(ScaleKeys.Отрицание_своей_зависимости, 0)
              .Add(questionnaire, answerScore.Values.ToArray(), 13, 15, 17, 22));
            results.AddValue(new TestResultValue(ScaleKeys.Резкие_изменения_в_образе_жизни, 0)
              .Add(questionnaire, answerScore.Values.ToArray(), 12, 24, 25, 26, 30));


            var scaleValues = results.Values;
            var scaleMore5 = scaleValues.Where(w => w.Int > 5);

            var addictionLevel = 0;
            var scaleCount = scaleMore5.Count();
            if (scaleCount == 1)
                addictionLevel = 1;
            else if (scaleCount == 2 || scaleCount == 3)
                addictionLevel = 2;
            else if (scaleCount >= 4)
                addictionLevel = 3;

            results.AddValue(new TestResultValue(ScaleKeys.Степень_выраженности_аддикции, addictionLevel));
            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Аналогии.cs


using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Аналогии : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string VerbalIntelligence = "Уровень развития вербального интеллекта";
        }

        private const int А = 1;
        private const int Б = 2;
        private const int В = 3;
        private const int Г = 4;
        private const int Д = 5;

        private static readonly Dictionary<int, int> Keys = new Dictionary<int, int>()
        {
            [1] = А,  [2] = Г,  [3] = В,  [4] = А,  [5] = Б,  [6] = Д,  [7] = Б,  [8] = В,  [9] = А,  [10] = Г,
            [11] = В, [12] = Д, [13] = Б, [14] = Г, [15] = Б, [16] = В, [17] = Г, [18] = А, [19] = Д, [20] = Д,
            [21] = Б, [22] = В, [23] = Г, [24] = А, [25] = В, [26] = Г, [27] = Д, [28] = Г, [29] = Б, [30] = Д
        };

        public Аналогии()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Методика_Аналогии);

            results.AddValue(new TestResultValue(ScaleKeys.VerbalIntelligence, 0)
                .Add(questionnaire, Keys));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Антиципационная_состоятельность.cs


using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Антиципационная_состоятельность : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Common = "Общая АС";
            public static readonly string Personal = "Личностно-ситуативная АС";
            public static readonly string Spatial = "Пространственная АС";
            public static readonly string Temporary = "Временная АС";
        }

        private static readonly int[] ForwardQuestions = new int[] { 2, 6, 8, 9, 12, 14, 15, 17, 19, 20, 22, 24, 26, 29, 31, 32, 34, 36, 40, 41, 42, 43, 44, 47, 48, 49, 53, 55, 57, 58, 59, 61, 64, 65, 66, 68, 69, 70, 71, 72, 73, 75, 76, 78 };
        private static readonly int[] ForwardCosts = new int[] { 1, 2, 3, 4, 5 };
        private static readonly int[] InverseCosts = new int[] { 5, 4, 3, 2, 1 };

        private static readonly int[] PersonalQuestions = new int[] { 1, 3, 5, 7, 8, 10, 11, 15, 16, 17, 18, 20, 23, 25, 27, 30, 31, 33, 35, 37, 38, 39, 41, 42, 44, 46, 47, 48, 52, 53, 54, 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 80, 81 };
        private static readonly int[] SpatialQuestions = new int[] { 2, 6, 13, 21, 24, 28, 32, 34, 36, 40, 43, 45, 50, 51 };
        private static readonly int[] TemporaryQuestions = new int[] { 4, 9, 12, 14, 19, 22, 26, 29, 49, 55, 62, 72 };

        public Антиципационная_состоятельность()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var resuts = new TestResults(TestType.Тест_антиципационной_состоятельности_АС);

            var personalScore = getScaleValue(questionnaire.Questions, PersonalQuestions);
            resuts.AddValue(new TestResultValue(ScaleKeys.Personal, personalScore));

            var spatialScore = getScaleValue(questionnaire.Questions, SpatialQuestions);
            resuts.AddValue(new TestResultValue(ScaleKeys.Spatial, spatialScore));

            var temporaryScore = getScaleValue(questionnaire.Questions, TemporaryQuestions);
            resuts.AddValue(new TestResultValue(ScaleKeys.Temporary, temporaryScore));

            resuts.AddValue(new TestResultValue(ScaleKeys.Common, personalScore + spatialScore + temporaryScore));

            return resuts;
        }

        private int getScaleValue(QuestionsCollection questionsColelctions, int[] questionNumbers)
        {
            var score = 0;

            foreach (var questionNumber in questionNumbers)
            {
                var question = questionsColelctions[questionNumber - 1];
                var cost = ForwardQuestions.Contains(questionNumber)
                    ? ForwardCosts
                    : InverseCosts;

                var answer = question.Answers.FirstOrDefault(a => a.IsSelected);
                if (answer != null)
                    score += cost[question.Answers.IndexOf(answer)];
            }

            return score;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Голланд.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Updk7.Tests;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Голланд : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Type1 = "Реалистический тип";
            public static readonly string Type2 = "Интеллектуальный тип";
            public static readonly string Type3 = "Социальный тип";
            public static readonly string Type4 = "Конвенциальный тип";
            public static readonly string Type5 = "Предприимчивый тип";
            public static readonly string Type6 = "Артистический тип";
        }

        public class TestKeys
        {
            public static readonly Dictionary<int, int> Type1Keys = new Dictionary<int, int>() { [1] = 1, [2] = 1, [3] = 1, [4] = 1, [5] = 1, [16] = 1, [17] = 1, [18] = 1, [19] = 1, [21] = 1, [31] = 1, [32] = 1, [33] = 1, [34] = 1 };
            public static readonly Dictionary<int, int> Type2Keys = new Dictionary<int, int>() { [1] = 2, [6] = 1, [7] = 1, [8] = 1, [9] = 1, [16] = 2, [20] = 1, [22] = 1, [23] = 1, [24] = 1, [31] = 2, [35] = 1, [36] = 1, [37] = 1 };
            public static readonly Dictionary<int, int> Type3Keys = new Dictionary<int, int>() { [2] = 2, [6] = 2, [10] = 1, [11] = 1, [12] = 1, [17] = 2, [20] = 2, [25] = 1, [26] = 1, [27] = 1, [36] = 2, [38] = 1, [39] = 1, [41] = 2 };
            public static readonly Dictionary<int, int> Type4Keys = new Dictionary<int, int>() { [3] = 2, [7] = 2, [10] = 2, [13] = 1, [14] = 1, [18] = 2, [22] = 2, [25] = 2, [28] = 1, [29] = 1, [32] = 2, [38] = 2, [40] = 1, [42] = 1 };
            public static readonly Dictionary<int, int> Type5Keys = new Dictionary<int, int>() { [4] = 2, [8] = 2, [11] = 2, [13] = 2, [15] = 1, [23] = 2, [26] = 2, [28] = 2, [30] = 1, [33] = 2, [35] = 2, [37] = 2, [39] = 2, [40] = 2 };
            public static readonly Dictionary<int, int> Type6Keys = new Dictionary<int, int>() { [5] = 2, [9] = 2, [12] = 2, [14] = 2, [15] = 2, [19] = 2, [21] = 2, [24] = 2, [27] = 2, [29] = 2, [30] = 2, [34] = 2, [41] = 1, [42] = 2 };
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Опроснок_профессиональных_предпочтений_Голланд);

            var NumberQuestion_NumberAnswer = new Dictionary<int, int>();

            foreach (var question in questionnaire.Questions)
            {
                var numberQuestion = questionnaire.Questions.IndexOf(question) + 1;
                var numberAnswer = question.Answers.IndexOf(question.Answers.FirstOrDefault(f => f.IsSelected)) + 1;
                NumberQuestion_NumberAnswer.Add(numberQuestion, numberAnswer);
            }

            results.AddValue(new TestResultValue(ScaleKeys.Type1, GetPoints(NumberQuestion_NumberAnswer, TestKeys.Type1Keys)));
            results.AddValue(new TestResultValue(ScaleKeys.Type2, GetPoints(NumberQuestion_NumberAnswer, TestKeys.Type2Keys)));
            results.AddValue(new TestResultValue(ScaleKeys.Type3, GetPoints(NumberQuestion_NumberAnswer, TestKeys.Type3Keys)));
            results.AddValue(new TestResultValue(ScaleKeys.Type4, GetPoints(NumberQuestion_NumberAnswer, TestKeys.Type4Keys)));
            results.AddValue(new TestResultValue(ScaleKeys.Type5, GetPoints(NumberQuestion_NumberAnswer, TestKeys.Type5Keys)));
            results.AddValue(new TestResultValue(ScaleKeys.Type6, GetPoints(NumberQuestion_NumberAnswer, TestKeys.Type6Keys)));

            return results;
        }

        private int GetPoints(Dictionary<int, int> answers, Dictionary<int, int> keys)
        {
            int res = 0;
            foreach (var key in keys)
            {
                var answer = answers.FirstOrDefault(f => f.Key == key.Key);
                if (answer.Value==key.Value)
                    res++;
            }
            return res;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Дигностика_уровня_агрессии_Басс_Дарки.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Дигностика_уровня_агрессии_Басс_Дарки : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string AgressionIndex = "Индекс агрессии";
            public static readonly string HostilityIndex = "Индекс враждебности";
            public static readonly string PhysicalAgression = "Физическая агрессия";
            public static readonly string IndirectAgression = "Косвенная агрессия";
            public static readonly string Irritation = "Раздражение";
            public static readonly string Negativism = "Негативизм";
            public static readonly string Offense = "Обида";
            public static readonly string Suspicion = "Подозрительность";
            public static readonly string VerbalAgrgression = "Вербальная агрессия";
            public static readonly string Guilt = "Чувство вины";
        }

        const int Yes = 1;
        const int No = 2;

        public Дигностика_уровня_агрессии_Басс_Дарки()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Методика_диагностики_уровня_агрессии_Басс_Дарки);

            var physicalAgression = new TestResultValue(ScaleKeys.PhysicalAgression, 0)
                .Add(questionnaire, Yes, 1, 25, 33, 48, 55, 62, 68)
                .Add(questionnaire, No, 9, 17, 41);

            results.Values.Add(physicalAgression);

            var indirectAgression = new TestResultValue(ScaleKeys.IndirectAgression, 0)
                .Add(questionnaire, Yes, new int[] { 2, 18, 34, 42, 56, 63 })
                .Add(questionnaire, No, new int[] { 10, 26, 49 });

            results.Values.Add(indirectAgression);

            var irritation = new TestResultValue(ScaleKeys.Irritation, 0)
                .Add(questionnaire, Yes, 3, 19, 27, 43, 50, 57, 64, 72)
                .Add(questionnaire, No, 11, 35, 69);

            results.Values.Add(irritation);

            var negativism = new TestResultValue(ScaleKeys.Negativism, 0)
                .Add(questionnaire, Yes, 4, 12, 20, 23, 36);

            results.Values.Add(negativism);

            var offense = new TestResultValue(ScaleKeys.Offense, 0)
                .Add(questionnaire, Yes, 5, 13, 21, 29, 37, 51, 58)
                .Add(questionnaire, No, 44);

            results.Values.Add(offense);

            var suspicion = new TestResultValue(ScaleKeys.Suspicion, 0)
                .Add(questionnaire, Yes, 6, 14, 22, 30, 38, 45, 52, 59)
                .Add(questionnaire, No, 65, 70);

            results.Values.Add(suspicion);

            var verbalAgrgression = new TestResultValue(ScaleKeys.VerbalAgrgression, 0)
                .Add(questionnaire, Yes, 7, 15, 28, 31, 46, 53, 60, 71, 73)
                .Add(questionnaire, No, 39, 66, 74, 75);

            results.Values.Add(verbalAgrgression);

            var quilt = new TestResultValue(ScaleKeys.Guilt, 0)
                .Add(questionnaire, Yes, 8, 16, 24, 32, 40, 47, 54, 61, 67);

            results.Values.Add(quilt);

            var hostilityIndex = new TestResultValue(ScaleKeys.HostilityIndex, 0)
                .Add(offense)
                .Add(suspicion);

            results.Values.Add(hostilityIndex);

            var agressionIndex = new TestResultValue(ScaleKeys.AgressionIndex, 0)
                .Add(physicalAgression)
                .Add(irritation)
                .Add(verbalAgrgression);

            results.Values.Add(agressionIndex);

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\ДОРС.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class ДОРС : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Fatigue = "Утомление";
            public static readonly string Monotonically = "Монотония";
            public static readonly string Satiation = "Пресыщение";
            public static readonly string Stress = "Стресс";
        }

        private static readonly int[] Scores = new int[] { 1, 2, 3, 4 };

        public ДОРС()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Методика_ДОРС);

            results.AddValue(new TestResultValue(ScaleKeys.Fatigue, 0)
                .Add(questionnaire, Scores, 9, 11, 12, 21, 32)
                .Subtruct(questionnaire, Scores, 2, 10, 14, 27, 28)
                .Add(25));

            results.AddValue(new TestResultValue(ScaleKeys.Monotonically, 0)
                .Add(questionnaire, Scores, 5, 6, 23, 24, 33, 35)
                .Subtruct(questionnaire, Scores, 3, 25, 30)
                .Add(15));

            results.AddValue(new TestResultValue(ScaleKeys.Satiation, 0)
                .Add(questionnaire, Scores, 4, 13, 15, 19, 36, 39)
                .Subtruct(questionnaire, Scores, 1, 17, 20, 26)
                .Add(25));

            results.AddValue(new TestResultValue(ScaleKeys.Stress, 0)
                .Add(questionnaire, Scores, 7, 18, 22, 31, 34, 37, 40)
                .Subtruct(questionnaire, Scores, 8, 29, 38)
                .Add(15));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Зунг.cs


using System;
using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Зунг : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Score = "Баллы";
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Тест_Зунга);

            var NumberQuestion_NumberAnswer = new Dictionary<int, int>();

            foreach (var question in questionnaire.Questions)
            {
                var numberQuestion = questionnaire.Questions.IndexOf(question) + 1;
                var numberAnswer = question.Answers.IndexOf(question.Answers.FirstOrDefault(f => f.IsSelected)) + 1;
                NumberQuestion_NumberAnswer.Add(numberQuestion, numberAnswer);
            }

            var forwardQuestion = new int[] { 1, 3, 4, 7, 8, 9, 10, 13, 15, 19 };
            var reverseQuestion = new int[] { 2, 5, 6, 11, 12, 14, 16, 17, 18, 20 };

            int forwardScores = 0;
            for (int i = 0; i < forwardQuestion.Length; i++)
            {
                var answer = NumberQuestion_NumberAnswer[forwardQuestion[i]];
                forwardScores = forwardScores + answer;
            }

            int reverseScores = 0;
            for (int i = 0; i < reverseQuestion.Length; i++)
            {
                var answer = NumberQuestion_NumberAnswer[reverseQuestion[i]];
                switch (answer)
                {
                    case 1:
                        answer = 4;
                        break;
                    case 2:
                        answer = 3;
                        break;
                    case 3:
                        answer = 2;
                        break;
                    case 4:
                        answer = 1;
                        break;
                }
                reverseScores = reverseScores + answer;
            }

            var scores =(int)Math.Round(((forwardScores + reverseScores) / 80.0) * 100, 0);

            results.AddValue(new TestResultValue(ScaleKeys.Score, scores));
            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Индекс_жизненного_стиля.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Индекс_жизненного_стиля : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Negation = "Отрицание";
            public static readonly string Extrusion = "Вытеснение";
            public static readonly string Regression = "Самообладание";
            public static readonly string Compensation = "Компенсация";
            public static readonly string Projection = "Проекция";
            public static readonly string Replacement = "Замещение";
            public static readonly string Intellectualization = "Интеллектуализация";
            public static readonly string Reactive = "Реактивные образования";
        }

        const int Yes = 1;

        public Индекс_жизненного_стиля()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Тест_опросник_Индекс_жизненного_стиля_ИЖС);

            results.Values.Add(new TestResultValue(ScaleKeys.Negation, 0)
                .Add(questionnaire, Yes, 1, 16, 22, 28, 34, 42, 51, 61, 68, 77, 82, 90, 94));

            results.Values.Add(new TestResultValue(ScaleKeys.Extrusion, 0)
                .Add(questionnaire, Yes, 6, 11, 19, 25, 35, 43, 49, 59, 66, 75, 85, 89));

            results.Values.Add(new TestResultValue(ScaleKeys.Regression, 0)
                .Add(questionnaire, Yes, 2, 14, 18, 26, 33, 48, 50, 58, 69, 78, 86, 88, 93, 95));

            results.Values.Add(new TestResultValue(ScaleKeys.Compensation, 0)
                .Add(questionnaire, Yes, 3, 10, 24, 29, 37, 45, 52, 64, 65, 74));

            results.Values.Add(new TestResultValue(ScaleKeys.Projection, 0)
                .Add(questionnaire, Yes, 7, 9, 23, 27, 38, 41, 55, 63, 71, 73, 84, 92, 96));

            results.Values.Add(new TestResultValue(ScaleKeys.Replacement, 0)
                .Add(questionnaire, Yes, 8, 15, 20, 31, 40, 47, 54, 60, 67, 76, 83, 91, 97));

            results.Values.Add(new TestResultValue(ScaleKeys.Intellectualization, 0)
                .Add(questionnaire, Yes, 4, 13, 17, 30, 36, 44, 56, 62, 70, 80, 81, 87));

            results.Values.Add(new TestResultValue(ScaleKeys.Reactive, 0)
                .Add(questionnaire, Yes, 5, 12, 21, 32, 39, 46, 53, 57, 72, 79));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Исследование_волевой_саморегуляции.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Исследование_волевой_саморегуляции : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string CommonScale = "Общая шкала";
            public static readonly string Perseverance = "Настойчивость";
            public static readonly string SelfControl = "Самообладание";
        }

        const int Yes = 1;
        const int No = 2;

        public Исследование_волевой_саморегуляции()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Тест_опросник_на_исследование_волевой_саморегуляции_ИВС);

            results.Values.Add(new TestResultValue(ScaleKeys.CommonScale, 0)
                .Add(questionnaire, Yes, 2, 3, 4, 5, 7, 9, 11, 17, 18, 20, 24, 27)
                .Add(questionnaire, No, 1, 6, 10, 13, 14, 16, 21, 22, 25, 28, 29, 30));

            results.Values.Add(new TestResultValue(ScaleKeys.Perseverance, 0)
                .Add(questionnaire, Yes, 2, 5, 9, 11, 17, 18, 20, 24, 27)
                .Add(questionnaire, No, 1, 6, 10, 13, 16, 22, 25));

            results.Values.Add(new TestResultValue(ScaleKeys.SelfControl, 0)
                .Add(questionnaire, Yes, 3, 4, 5, 7, 24, 27)
                .Add(questionnaire, No, 13, 14, 16, 21, 28, 29, 30));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\КОПС.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class КОПС : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Operability = "Работоспособность";
            public static readonly string SelfConcept = "Самооценка";
            public static readonly string SocialDesirability = "Социальная желательность";
            public static readonly string Atypically = "Атипичность ответов";
        }

        private const int А = 1;
        private const int Б = 2;
        private const int В = 3;
        private const int Г = 4;
        private const int Д = 5;
        private const int Е = 6;

        private static readonly int[] AScore = new int[] { 5, 4, 3, 2, 1, 0 };
        private static readonly int[] EScore = new int[] { 0, 1, 2, 3, 4, 5 };

        public КОПС()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Комплексная_оценка_психологического_состояния_КОПС);

            results.AddValue(new TestResultValue(ScaleKeys.Operability, 0)
                .Add(questionnaire, EScore, 
                    2,  19, 37, 50, 65, 79, 5,  21, 39, 52, 
                    67, 80, 7,  23, 42, 54, 68, 82, 8,  25,
                    44, 56, 70, 83, 10, 27, 46, 58, 72, 85,
                    12, 30, 47, 61, 75, 86, 14, 33, 49, 63, 
                    77, 88, 16, 35));

            results.AddValue(new TestResultValue(ScaleKeys.SelfConcept, 0)
                .Add(questionnaire, AScore,
                    3,  24, 38, 53, 66, 81, 9,  26, 40, 55,
                    69, 84, 15, 28, 43, 57, 71, 87, 17, 31, 
                    45, 59, 74, 90, 20, 34, 48, 62, 78));

            results.AddValue(new TestResultValue(ScaleKeys.SocialDesirability, 0)
                .Add(questionnaire, EScore,
                    4,  18, 36, 51, 64, 73, 13, 29, 41));

            results.AddValue(new TestResultValue(ScaleKeys.Atypically, 0)
                .Add(questionnaire, А,
                    2,  5,  6,  7,  8,  10, 12, 13, 14, 16, 
                    19, 21, 23, 25, 27, 30, 32, 33, 35, 36,
                    37, 39, 42, 44, 46, 47, 49, 50, 51, 52,
                    54, 56, 58, 61, 63, 64, 65, 67, 68, 70, 
                    72, 75, 76, 77, 79, 80, 82, 83, 85, 86, 
                    88, 89)
                .Add(questionnaire, Б,
                    2,  5,  8,  12, 14, 21, 23, 25, 27, 30, 
                    33, 35, 42, 44, 46, 47, 49, 50, 51, 52, 
                    54, 56, 58, 61, 63, 65, 67, 70, 72, 75,
                    77, 79, 80, 82, 83, 85, 86, 88)
                .Add(questionnaire, В,
                    8, 27, 30, 52, 58, 63, 70)
                .Add(questionnaire, Г,
                    15, 17, 34, 40, 87)
                .Add(questionnaire, Д,
                    15, 17, 22, 24, 28, 31, 34, 38, 40, 43, 
                    45, 48, 53, 55, 57, 59, 62, 66, 69, 71, 
                    74, 78, 81, 87, 90)
                .Add(questionnaire, Е,
                    3,  9,  11, 15, 17, 20, 22, 24, 26, 28, 
                    31, 34, 38, 40, 43, 45, 48, 53, 55, 57, 
                    59, 62, 66, 69, 71, 74, 78, 81, 84, 87, 
                    90));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Личностный_профиль.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Личностный_профиль : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Activity = "Активность";
            public static readonly string Responsibility = "Ответственность";
            public static readonly string EmotionalEndurance = "Эмоциональная выносливость";
            public static readonly string SocialDesirability = "Социальная желательность";
            public static readonly string Atypically = "Атипичность ответов";
        }

        private const int A = 1;
        private const int G = 4;
        private static readonly int[] AScores = new int[] { 3, 2, 1, 0 };
        private static readonly int[] Scores = new int[] { 0, 1, 2, 3 };

        public Личностный_профиль()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Опросник_Личностный_профиль_ЛП);

            results.AddValue(new TestResultValue(ScaleKeys.Activity, 0)
                .Add(questionnaire, AScores, 1, 11, 20, 26, 35, 40, 45, 50, 53, 58, 62, 67, 70, 76, 83, 88, 95, 99));

            results.AddValue(new TestResultValue(ScaleKeys.Responsibility, 0)
                .Add(questionnaire, AScores, 54, 80, 100)
                .Add(questionnaire, Scores, 4, 8, 14, 18, 24, 31, 38, 47, 60, 68, 85, 91, 96));

            results.AddValue(new TestResultValue(ScaleKeys.EmotionalEndurance, 0)
                .Add(questionnaire, Scores, 2, 6, 7, 12, 16, 18, 21, 23, 25, 27, 31, 34, 39, 42, 44, 48, 55, 57, 61, 64, 69, 71, 74, 79, 81, 90, 92, 94, 98));

            results.AddValue(new TestResultValue(ScaleKeys.SocialDesirability, 0)
                .Add(questionnaire, Scores, 8, 15, 29, 37, 43, 52, 65, 75, 82, 89)
                .Add(questionnaire, AScores, 22));

            results.AddValue(new TestResultValue(ScaleKeys.Atypically, 0)
                .Add(questionnaire, A, 37, 69, 2, 23, 38, 51, 84, 6, 24, 39, 71, 7, 27, 55, 74, 90, 42, 57, 92, 44, 77, 94, 12, 31, 60, 78, 14, 32, 79, 98, 16, 48, 64, 18, 34, 81, 19, 68, 82)
                .Add(questionnaire, G, 1, 20, 50, 83, 70, 53, 87, 26, 40, 54, 72, 88, 9, 41, 10, 76, 11, 30, 58, 45, 95, 46, 62, 33, 80, 99, 67, 100, 36, 49));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\МДУ_Элерс.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class МДУ_Элерс : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Motivation = "Мотивация к достижению успеха";
        }

        const int Yes = 1;
        const int No = 2;

        public МДУ_Элерс()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Диагностики_мотивации_к_достижению_успеха_Элерса_МДУ);

            results.AddValue(new TestResultValue(ScaleKeys.Motivation, 0)
                .Add(questionnaire, Yes, 2, 3, 4, 5, 7, 8, 9, 10, 14, 15, 16, 17, 21, 22, 25, 26, 27, 28, 29, 30, 32, 37, 41)
                .Add(questionnaire, No, 6, 13, 18, 20, 24, 31, 36, 38, 39));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Мотивация_к_избеганию_неудач_Элерс.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Мотивация_к_избеганию_неудач_Элерс : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Scores = "Баллы";
        }

        public static readonly Dictionary<int, string> Keys = new Dictionary<int, string>()
        {
            [1] = "2",
            [2] = "1, 2",
            [3] = "1, 3",
            [4] = "3",
            [5] = "2",
            [6] = "3",
            [7] = "2, 3",
            [8] = "3",
            [9] = "1, 2",
            [10] = "2",
            [11] = "1, 2",
            [12] = "1, 3",
            [13] = "2, 3",
            [14] = "1",
            [15] = "1",
            [16] = "2",
            [17] = "3",
            [18] = "1",
            [19] = "1, 2",
            [20] = "1, 2",
            [21] = "1",
            [22] = "1",
            [23] = "1",
            [24] = "1, 2",
            [25] = "1",
            [26] = "2",
            [27] = "3",
            [28] = "1, 2",
            [29] = "1, 3",
            [30] = "2"
        };

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var score = 0;

            for (var i = 0; i < questionnaire.Questions.Count; i++)
            {
                var question = questionnaire.Questions[i];
                var answer = question.Answers.FirstOrDefault(a => a.IsSelected);
                if (answer != null)
                {
                    var answerNumber = question.Answers.IndexOf(answer) + 1;
                    var correctAnswer = Keys[i + 1];
                    if (correctAnswer.Contains(answerNumber.ToString()))
                        score++;
                }
            }

            return new TestResults(TestType.Диагностики_мотивации_к_избеганию_неудач_Элерса_МИН)
                .AddValue(new TestResultValue(ScaleKeys.Scores, score)); 
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Опросник_САН.cs


using System;
using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Опросник_САН : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Самочувствие = "Самочувствие";
            public static readonly string Активность = "Активность";
            public static readonly string Настроение = "Настроение";
            public static readonly string Гистограмма = "Гистограмма";
        }

        private Dictionary<int, int> KeysDirection = new Dictionary<int, int>()
        {
            [1] =  0,
            [2] = 0,
            [3] = 1,
            [4] = 1,
            [5] = 0,
            [6] = 0,
            [7] = 0,
            [8] = 0,
            [9] = 1,
            [10] = 1,
            [11] = 0,
            [12] = 0,
            [13] = 1,
            [14] = 0,
            [15] = 1,
            [16] = 1,
            [17] = 0,
            [18] = 0,
            [19] = 0,
            [20] = 0,
            [21] = 1,
            [22] = 1,
            [23] = 0,
            [24] = 0,
            [25] = 0,
            [26] = 0,
            [27] = 1,
            [28] = 1,
            [29] = 0,
            [30] = 0
        };

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var keyValues = new int[] { 1, 2, 3, 4, 5, 6, 7 };
            var keyValuesReverse = new int[] { 7, 6, 5, 4, 3, 2, 1 };

            var NumberQuestion_NumberAnswer = new Dictionary<int, int>();

            foreach (var question in questionnaire.Questions)
            {
                var numberQuestion = questionnaire.Questions.IndexOf(question) + 1;
                var numberAnswer = question.Answers.IndexOf(question.Answers.FirstOrDefault(f => f.IsSelected));
                NumberQuestion_NumberAnswer.Add(numberQuestion, numberAnswer);
            }

            var NumberQuestion_Scores = new Dictionary<int, int>();
            foreach (var NQA in NumberQuestion_NumberAnswer)
            {
                var direction = KeysDirection[NQA.Key];
                int[] scoresAnswer;
                if (direction == 0)
                    scoresAnswer = keyValuesReverse;
                else
                    scoresAnswer = keyValues;
                var score = scoresAnswer[NQA.Value];
                NumberQuestion_Scores.Add(NQA.Key, score);
            }

            float Самочувствие = GetScores(NumberQuestion_Scores,  1, 2, 7, 8, 13, 14, 19, 20, 25, 26 );
            float Активность = GetScores(NumberQuestion_Scores, 3, 4, 9, 10, 15, 16, 21, 22, 27, 28 );
            float Настроение = GetScores(NumberQuestion_Scores, 5, 6, 11, 12, 17, 18, 23, 24, 29, 30 );

            int[] Gistogramm = new int[] { 0, 0, 0, 0, 0, 0, 0 };

            var results = new TestResults(TestType.Опросник_САН);
            results.AddValue(new TestResultValue(ScaleKeys.Самочувствие, Самочувствие));
            results.AddValue(new TestResultValue(ScaleKeys.Активность, Активность));
            results.AddValue(new TestResultValue(ScaleKeys.Настроение, Настроение));
            results.AddValue(new TestResultValue(ScaleKeys.Гистограмма, Gistogramm));

            return results;
        }

        private float GetScores(Dictionary<int, int> numberQuestionScores, params int[] keys)
        {
            float result = 0;
            for (int i = 0; i < keys.Length; i++)
            {
                var value = numberQuestionScores[keys[i]];
                result = result + value;
            }

            result = (float)Math.Round(result / 10.0, 1);
            return result;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Оценка_нервно_психической_устойчивости_НПУ.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Оценка_нервно_психической_устойчивости_НПУ : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Falsity = "Неискренность";
            public static readonly string Stability = "Нервно-психическая устойчивость";
        }

        private const int Yes = 1;
        private const int No = 2;

        public Оценка_нервно_психической_устойчивости_НПУ()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Оценка_нервно_психической_устойчивости_НПУ);

            results.AddValue(new TestResultValue(ScaleKeys.Falsity, 0)
                .Add(questionnaire, No, 1, 4, 6, 8, 9, 11, 16, 17, 18, 22, 25, 31, 34, 36, 43));

            results.AddValue(new TestResultValue(ScaleKeys.Stability, 0)
                .Add(questionnaire, Yes, 3, 5, 7, 10, 15, 20, 26, 27, 29, 32, 33, 35, 37, 40, 41, 42, 44, 45, 47, 48, 49, 50, 51, 52, 53, 56, 57, 59, 60, 62, 63, 64, 65, 66, 67, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84)
                .Add(questionnaire, No, 2, 12, 13, 14, 19, 21, 23, 24, 28, 30, 38, 39, 46, 54, 55, 58, 61, 68));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Потребность_в_достижении.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Потребность_в_достижении : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Key = "Потребность в достижении";
        }

        private const int Yes = 1;
        private const int No = 2;
        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var rawResults = new TestResults(TestType.Тест_Потребность_в_достижении_ПД);

            var gender = questionnaire.Questions.First().Answers.IndexOf(questionnaire.Questions.First().Answers.FirstOrDefault(f => f.IsSelected)) + 1;

            questionnaire.Questions.Remove(questionnaire.Questions.First());

            rawResults.AddValue(new TestResultValue(ScaleKeys.Key, 0)
              .Add(questionnaire, Yes, 2, 6, 7, 8, 14, 16, 18, 19, 21, 22, 23)
              .Add(questionnaire, No, 1, 3, 4, 5, 9, 10, 11, 12, 13, 15, 17, 20));

            var rawSum = (rawResults.Values.First().Int * 60) / 23 + 20;
            var stens = GetStens(rawSum, gender);
            var results = new TestResults(TestType.Тест_Потребность_в_достижении_ПД);
            results.AddValue(new TestResultValue(ScaleKeys.Key, stens));
            return results;
        }

        private int GetStens(int rawSum, int gender)
        {
            int stens = 0;
            if (gender == 1)
                stens = StenKeys.stensRawPointsMen.FirstOrDefault(f => f.Value[0] >= rawSum && f.Value[1] <= rawSum).Key;
            if (gender == 2)
                stens = StenKeys.stensRawPointsWomen.FirstOrDefault(f => f.Value[0] >= rawSum && f.Value[1] <= rawSum).Key;
            return stens;
        }

        public class StenKeys
        {
            public static readonly Dictionary<int, int[]> stensRawPointsMen = new Dictionary<int, int[]>()
            {
                [1] = new int[] { 20, 41 },
                [2] = new int[] { 42, 47 },
                [3] = new int[] { 48, 50 },
                [4] = new int[] { 51, 52 },
                [5] = new int[] { 53, 55 },
                [6] = new int[] { 56, 57 },
                [7] = new int[] { 58, 60 },
                [8] = new int[] { 61, 63 },
                [9] = new int[] { 64, 67 },
                [10] = new int[] { 68, 80 }
            };

            public static readonly Dictionary<int, int[]> stensRawPointsWomen = new Dictionary<int, int[]>()
            {
                [1] = new int[] { 20, 44 },
                [2] = new int[] { 45, 47 },
                [3] = new int[] { 48, 50 },
                [4] = new int[] { 51, 52 },
                [5] = new int[] { 53, 55 },
                [6] = new int[] { 56, 58 },
                [7] = new int[] { 59, 61 },
                [8] = new int[] { 62, 63 },
                [9] = new int[] { 64, 66 },
                [10] = new int[] { 67, 80 }
            };
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Склонность_к_зависимому_поведению.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Склонность_к_зависимому_поведению : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string DrugAddiction = "Наркозависимость";
            public static readonly string AlcoholAddiction = "Алкогольная зависимость";
        }

        private static readonly int[] ForwardCosts = new int[] { 1, 2, 3, 4, 5 };
        private static readonly int[] InverseCosts = new int[] { 5, 4, 3, 2, 1 };

        public Склонность_к_зависимому_поведению()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Тест_опросник_Склонность_к_зависимому_поведению_ЗП);

            results.Values.Add(new TestResultValue(ScaleKeys.DrugAddiction, 0)
                .Add(questionnaire, ForwardCosts, 1, 3, 4, 16, 19, 24, 26, 48, 50, 52, 54, 59, 76, 79, 80, 89, 91, 96, 97, 100, 107, 110, 116)
                .Add(questionnaire, InverseCosts, 2, 12, 29, 30, 41, 45, 53, 61, 65, 67, 69, 72, 77, 78, 81, 86, 112, 114));

            results.Values.Add(new TestResultValue(ScaleKeys.AlcoholAddiction, 0)
                .Add(questionnaire, ForwardCosts, 3, 5, 14, 15, 16, 17, 19, 20, 24, 26, 30, 43, 48, 76, 79, 84, 91, 95, 97, 100, 107, 112, 113, 116)
                .Add(questionnaire, InverseCosts, 21, 29, 38, 41, 44, 64, 65, 67, 75, 77, 81));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Склонность_к_риску_Шуберт.cs


using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Склонность_к_риску_Шуберт : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string RiskAppetite = "Склонность к риску";
        }

        private static readonly int[] AnswersCost = new int[] { 2, 1, 0, -1, -2 };

        public Склонность_к_риску_Шуберт()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Диагностика_степени_готовности_склонности_к_риску_Шуберт);

            var questionsNumbers = Enumerable.Range(1, questionnaire.Questions.Count).ToArray();
            results.AddValue(new TestResultValue(ScaleKeys.RiskAppetite, 0)
                .Add(questionnaire, AnswersCost, questionsNumbers));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\СМОЛ.cs


using System;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class СМОЛ : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string L = "L";
            public static readonly string F = "F";
            public static readonly string K = "K";
            public static readonly string S1 = "1 (Hs)";
            public static readonly string S2 = "2 (D)";
            public static readonly string S3 = "3 (Hy)";
            public static readonly string S4 = "4 (Pd)";
            public static readonly string S6 = "6 (Pa)";
            public static readonly string S7 = "7 (Pt)";
            public static readonly string S8 = "8 (Se)";
            public static readonly string S9 = "9 (Ma)";
        }

        private const int Right = 1;
        private const int Wrong = 2;

        public СМОЛ()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = createResultScales(questionnaire);
            var isMale = true;

            initialResultsCorrection(results);
            if (isMale)
                maleResultsCorrection(results);
            else
                famaleResultsCorrection(results);

            return results;
        }

        private TestResults createResultScales(Questionnaire questionnaire)
        {
            var result = new TestResults(TestType.Сокращенный_многопрофильный_опросник_личности_СМОЛ);

            result.AddValue(new TestResultValue(ScaleKeys.L, 0)
                .Add(questionnaire, Wrong, 5, 11, 24, 47, 53));

            result.AddValue(new TestResultValue(ScaleKeys.F, 0)
                .Add(questionnaire, Wrong, 22, 24, 61)
                .Add(questionnaire, Right, 9, 12, 15, 19, 30, 38, 48, 49, 59, 64, 71));

            result.AddValue(new TestResultValue(ScaleKeys.K, 0)
                .Add(questionnaire, Wrong, 11, 23, 31, 33, 34, 36, 40, 41, 43, 51, 56, 61, 65, 67, 69, 70));

            result.AddValue( new TestResultValue(ScaleKeys.S1, 0)
                .Add(questionnaire, Wrong, 1, 2, 6, 37, 45)
                .Add(questionnaire, Right, 9, 18, 26, 32, 44, 46, 55, 62, 63));

            result.AddValue(new TestResultValue(ScaleKeys.S2, 0)
                .Add(questionnaire, Wrong, 1, 3, 6, 11, 28, 37, 40, 42, 60, 65, 61)
                .Add(questionnaire, Right, 9, 13, 11, 18, 22, 25, 36, 44));

            result.AddValue(new TestResultValue(ScaleKeys.S3, 0)
                .Add(questionnaire, Wrong, 1, 2, 3, 11, 23, 28, 29, 31, 33, 35, 37, 40, 41, 43, 45, 50, 56)
                .Add(questionnaire, Right, 9, 13, 18, 26, 44, 46, 55, 57, 62));

            result.AddValue(new TestResultValue(ScaleKeys.S4, 0)
                .Add(questionnaire, Wrong, 3, 28, 34, 35, 41, 43, 50, 65)
                .Add(questionnaire, Right, 7, 10, 13, 14, 15, 16, 22, 27, 52, 58, 71));

            result.AddValue(new TestResultValue(ScaleKeys.S6, 0)
                .Add(questionnaire, Wrong, 28, 29, 31, 67)
                .Add(questionnaire, Right, 5, 8, 10, 15, 30, 39, 63, 64, 66, 68));

            result.AddValue(new TestResultValue(ScaleKeys.S7, 0)
                .Add(questionnaire, Wrong, 2, 3, 42)
                .Add(questionnaire, Right, 5, 8, 13, 17, 22, 25, 27, 36, 44, 51, 57, 66, 68));

            result.AddValue(new TestResultValue(ScaleKeys.S8, 0)
                .Add(questionnaire, Wrong, 3, 42)
                .Add(questionnaire, Right, 5, 7, 8, 10, 13, 14, 15, 16, 17, 26, 30, 38, 39, 46, 57, 63, 64, 66));

            result.AddValue(new TestResultValue(ScaleKeys.S9, 0)
                .Add(questionnaire, Wrong, 43)
                .Add(questionnaire, Right, 4, 7, 8, 21, 29, 34, 38, 39, 54, 57, 60));

            return result;
        }

        private void initialResultsCorrection(TestResults results)
        {
            var K = results[ScaleKeys.K];
            results[ScaleKeys.S1].Int += (int)(Math.Round(K.Int * 0.5));
            results[ScaleKeys.S4].Int += (int)(Math.Round(K.Int * 0.4));
            results[ScaleKeys.S7].Int += K.Int;
            results[ScaleKeys.S8].Int += K.Int;
            results[ScaleKeys.S9].Int += (int)(Math.Round(K.Int * 0.2));
        }

        private void correctScale(TestResultValue scale, double M, double d)
        {
            scale.Int = 50 + (int)Math.Floor(10.0 * (scale.Int - M) / d);
        }

        private void maleResultsCorrection(TestResults results)
        {
            correctScale(results[ScaleKeys.L], 1.48, 1.23);
            correctScale(results[ScaleKeys.F], 3.10, 2.30);
            correctScale(results[ScaleKeys.K], 7.68, 3.42);
            correctScale(results[ScaleKeys.S1], 7.24, 3.00);
            correctScale(results[ScaleKeys.S2], 7.02, 2.68);
            correctScale(results[ScaleKeys.S3], 9.73, 2.91);
            correctScale(results[ScaleKeys.S4], 10.39, 2.13);
            correctScale(results[ScaleKeys.S6], 4.03, 1.74);
            correctScale(results[ScaleKeys.S7], 13.57, 2.51);
            correctScale(results[ScaleKeys.S8], 13.68, 2.83);
            correctScale(results[ScaleKeys.S9], 6.23, 1.55);
        }

        private void famaleResultsCorrection(TestResults results)
        {
            correctScale(results[ScaleKeys.L], 1.51, 1.19);
            correctScale(results[ScaleKeys.F], 2.64, 1.71);
            correctScale(results[ScaleKeys.K], 7.72, 2.64);
            correctScale(results[ScaleKeys.S1], 8.74, 2.92);
            correctScale(results[ScaleKeys.S2], 7.96, 3.00);
            correctScale(results[ScaleKeys.S3], 11.53, 3.38);
            correctScale(results[ScaleKeys.S4], 9.76, 1.90);
            correctScale(results[ScaleKeys.S6], 4.77, 2.00);
            correctScale(results[ScaleKeys.S7], 14.48, 2.27);
            correctScale(results[ScaleKeys.S8], 13.52, 2.80);
            correctScale(results[ScaleKeys.S9], 6.35, 1.91);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Стиль_руководства.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Стиль_руководства : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Style1 = "Авторитарный стиль руководства";
            public static readonly string Style2 = "Демократический стиль руководства";
            public static readonly string Style3 = "Либеральный стиль руководства";
        }


        private Dictionary<int, List<ScoresForAnswer>> ScoreKeys = new Dictionary<int, List<ScoresForAnswer>>
        {
            [1] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {3,0,0}),
                  new ScoresForAnswer(2,new List<int>() {0,0,2}),
                  new ScoresForAnswer(3,new List<int>() {0,3,0}),
                  new ScoresForAnswer(4,new List<int>() {0,0,3}),
                  new ScoresForAnswer(5,new List<int>() {0,2,0})
            },
            [2] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {3,0,0}),
                  new ScoresForAnswer(2,new List<int>() {0,2,0}),
                  new ScoresForAnswer(3,new List<int>() {0,0,1}),
                  new ScoresForAnswer(4,new List<int>() {0,3,0}),
                  new ScoresForAnswer(5,new List<int>() {0,0,2})
            },
            [3] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,0,1}),
                  new ScoresForAnswer(2,new List<int>() {0,2,0}),
                  new ScoresForAnswer(3,new List<int>() {2,0,0}),
                  new ScoresForAnswer(4,new List<int>() {0,1,2}),
                  new ScoresForAnswer(5,new List<int>() {0,2,0})
            },
            [4] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {1,0,0}),
                  new ScoresForAnswer(2,new List<int>() {0,2,0}),
                  new ScoresForAnswer(3,new List<int>() {0,0,2}),
                  new ScoresForAnswer(4,new List<int>() {0,0,1}),
                  new ScoresForAnswer(5,new List<int>() {0,2,0})
            },
            [5] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,3,0}),
                  new ScoresForAnswer(2,new List<int>() {2,0,0}),
                  new ScoresForAnswer(3,new List<int>() {0,0,2}),
                  new ScoresForAnswer(4,new List<int>() {0,1,2}),
                  new ScoresForAnswer(5,new List<int>() {0,2,0})
            },
            [6] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,0,3}),
                  new ScoresForAnswer(2,new List<int>() {3,0,0}),
                  new ScoresForAnswer(3,new List<int>() {0,3,0}),
                  new ScoresForAnswer(4,new List<int>() {3,0,0}),
                  new ScoresForAnswer(5,new List<int>() {2,0,0})
            },
            [7] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {1,0,0}),
                  new ScoresForAnswer(2,new List<int>() {0,1,0}),
                  new ScoresForAnswer(3,new List<int>() {0,0,2}),
                  new ScoresForAnswer(4,new List<int>() {0,1,1}),
                  new ScoresForAnswer(5,new List<int>() {0,1,0})
            },
            [8] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,3,0}),
                  new ScoresForAnswer(2,new List<int>() {0,0,3}),
                  new ScoresForAnswer(3,new List<int>() {2,0,0}),
                  new ScoresForAnswer(4,new List<int>() {0,0,2}),
                  new ScoresForAnswer(5,new List<int>() {3,0,0})
            },
            [9] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,2,0}),
                  new ScoresForAnswer(2,new List<int>() {0,0,2}),
                  new ScoresForAnswer(3,new List<int>() {2,0,0}),
                  new ScoresForAnswer(4,new List<int>() {2,0,2}),
                  new ScoresForAnswer(5,new List<int>() {0,0,2})
            },
            [10] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {2,0,0}),
                  new ScoresForAnswer(2,new List<int>() {0,2,0}),
                  new ScoresForAnswer(3,new List<int>() {0,0,1}),
                  new ScoresForAnswer(4,new List<int>() {2,2,0}),
                  new ScoresForAnswer(5,new List<int>() {0,1,2})
            },
            [11] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,0,2}),
                  new ScoresForAnswer(2,new List<int>() {0,2,0}),
                  new ScoresForAnswer(3,new List<int>() {2,0,0}),
                  new ScoresForAnswer(4,new List<int>() {1,0,2}),
                  new ScoresForAnswer(5,new List<int>() {2,0,1})
            },
            [12] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,1,0}),
                  new ScoresForAnswer(2,new List<int>() {1,0,0}),
                  new ScoresForAnswer(3,new List<int>() {0,0,1}),
                  new ScoresForAnswer(4,new List<int>() {2,0,0}),
                  new ScoresForAnswer(5,new List<int>() {3,0,0})
            },
            [13] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {2,0,0}),
                  new ScoresForAnswer(2,new List<int>() {0,2,0}),
                  new ScoresForAnswer(3,new List<int>() {0,0,2}),
                  new ScoresForAnswer(4,new List<int>() {0,1,0}),
                  new ScoresForAnswer(5,new List<int>() {1,0,2})
            },
            [14] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,0,3}),
                  new ScoresForAnswer(2,new List<int>() {3,0,0}),
                  new ScoresForAnswer(3,new List<int>() {0,3,0}),
                  new ScoresForAnswer(4,new List<int>() {2,0,0}),
                  new ScoresForAnswer(5,new List<int>() {0,3,0})
            },
            [15] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,2,0}),
                  new ScoresForAnswer(2,new List<int>() {2,0,0}),
                  new ScoresForAnswer(3,new List<int>() {0,0,2}),
                  new ScoresForAnswer(4,new List<int>() {2,0,0}),
                  new ScoresForAnswer(5,new List<int>() {2,0,2})
            },
            [16] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,2,0}),
                  new ScoresForAnswer(2,new List<int>() {1,0,1}),
                  new ScoresForAnswer(3,new List<int>() {1,0,2}),
                  new ScoresForAnswer(4,new List<int>() {0,0,3}),
                  new ScoresForAnswer(5,new List<int>() {0,0,1})
            },
            [17] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {2,0,0}),
                  new ScoresForAnswer(2,new List<int>() {0,0,2}),
                  new ScoresForAnswer(3,new List<int>() {0,2,0}),
                  new ScoresForAnswer(4,new List<int>() {2,0,0}),
                  new ScoresForAnswer(5,new List<int>() {0,0,3})
            },
            [18] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {3,0,0}),
                  new ScoresForAnswer(2,new List<int>() {0,3,0}),
                  new ScoresForAnswer(3,new List<int>() {0,1,2}),
                  new ScoresForAnswer(4,new List<int>() {1,0,2}),
                  new ScoresForAnswer(5,new List<int>() {0,0,1})
            },
            [19] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {3,0,0}),
                  new ScoresForAnswer(2,new List<int>() {0,0,2}),
                  new ScoresForAnswer(3,new List<int>() {0,3,0}),
                  new ScoresForAnswer(4,new List<int>() {0,0,3}),
                  new ScoresForAnswer(5,new List<int>() {0,0,3})
            },
            [20] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {1,0,0}),
                  new ScoresForAnswer(2,new List<int>() {0,1,0}),
                  new ScoresForAnswer(3,new List<int>() {0,0,1}),
                  new ScoresForAnswer(4,new List<int>() {0,2,0}),
                  new ScoresForAnswer(5,new List<int>() {2,0,0})
            },
            [21] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,2,0}),
                  new ScoresForAnswer(2,new List<int>() {2,0,0}),
                  new ScoresForAnswer(3,new List<int>() {2,0,0}),
                  new ScoresForAnswer(4,new List<int>() {0,0,2}),
                  new ScoresForAnswer(5,new List<int>() {2,0,0})
            },
            [22] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,2,0}),
                  new ScoresForAnswer(2,new List<int>() {1,2,0}),
                  new ScoresForAnswer(3,new List<int>() {2,1,0}),
                  new ScoresForAnswer(4,new List<int>() {0,2,0}),
                  new ScoresForAnswer(5,new List<int>() {2,0,0})
            },
            [23] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {2,0,0}),
                  new ScoresForAnswer(2,new List<int>() {0,0,2}),
                  new ScoresForAnswer(3,new List<int>() {0,2,0}),
                  new ScoresForAnswer(4,new List<int>() {0,0,2}),
                  new ScoresForAnswer(5,new List<int>() {0,0,3})
            },
            [24] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {3,0,0}),
                  new ScoresForAnswer(2,new List<int>() {0,3,0}),
                  new ScoresForAnswer(3,new List<int>() {2,0,0}),
                  new ScoresForAnswer(4,new List<int>() {0,0,3}),
                  new ScoresForAnswer(5,new List<int>() {0,2,0})
            },
            [25] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,0,1}),
                  new ScoresForAnswer(2,new List<int>() {0,1,0}),
                  new ScoresForAnswer(3,new List<int>() {1,0,0}),
                  new ScoresForAnswer(4,new List<int>() {0,2,0}),
                  new ScoresForAnswer(5,new List<int>() {0,0,2})
            },
            [26] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,2,0}),
                  new ScoresForAnswer(2,new List<int>() {0,3,0}),
                  new ScoresForAnswer(3,new List<int>() {0,0,3}),
                  new ScoresForAnswer(4,new List<int>() {3,0,0}),
                  new ScoresForAnswer(5,new List<int>() {0,3,0})
            },
            [27] = new List<ScoresForAnswer>()
            {
                  new ScoresForAnswer(1,new List<int>() {0,0,1}),
                  new ScoresForAnswer(2,new List<int>() {0,2,0}),
                  new ScoresForAnswer(3,new List<int>() {1,0,0}),
                  new ScoresForAnswer(4,new List<int>() {0,2,0}),
                  new ScoresForAnswer(5,new List<int>() {3,0,0})
            }
        };


        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Тест_Стиль_руководства_СР);

            var NumberQuestion_NumberAnswer = new Dictionary<int, List<int>>();

            foreach (var question in questionnaire.Questions)
            {
                var numberQuestion = questionnaire.Questions.IndexOf(question) + 1;

                var answers = question.Answers.Where(w => w.IsSelected);
                var numbersAnswer = new List<int>();
                foreach (var answer in answers)
                {
                    var numberAnswer = question.Answers.IndexOf(answer) + 1;
                    numbersAnswer.Add(numberAnswer);
                }
                NumberQuestion_NumberAnswer.Add(numberQuestion, numbersAnswer);
            }

            int Style1 = 0, Style2 = 0, Style3 = 0;

            foreach (var numberQuestionNumberAnswersPair in NumberQuestion_NumberAnswer)
            {
                var numberQuestion = numberQuestionNumberAnswersPair.Key;
                var answerNumbers = numberQuestionNumberAnswersPair.Value;
                for (int i = 0; i < answerNumbers.Count; i++)
                {
                    var answerNumber = answerNumbers[i];
                    var keys = GetKeys(numberQuestion);

                   var values = keys.FirstOrDefault(f => f.AnswerNumber == answerNumber).KeysScoresPair;
                   Style1 += values[0];
                   Style2 += values[1];
                   Style3 += values[2];
                }
            }

            results.AddValue(new TestResultValue(ScaleKeys.Style1, Style1));
            results.AddValue(new TestResultValue(ScaleKeys.Style2, Style2));
            results.AddValue(new TestResultValue(ScaleKeys.Style3, Style3));
            return results;
        }

        private List<ScoresForAnswer> GetKeys(int numberQuestion)
        {
            return ScoreKeys[numberQuestion];
        }

        class ScoresForAnswer
        {
            public int AnswerNumber { get; set; }
            public List<int> KeysScoresPair { get; set; }

            public ScoresForAnswer(int answerNumber, List<int> keysScoresPair)
            {
                AnswerNumber = answerNumber;
                KeysScoresPair = keysScoresPair;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Структура_темперамента_Смирнов.cs


using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Структура_темперамента_Смирнов : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Extraversion_Introversion = "Экстраверсия-интроверсия";
            public static readonly string Rigidity_Plasticity = "Ригидность-пластичность";
            public static readonly string Emotional_excitability_Poise = "Эмоциональная возбудимость-уравновешенность";
            public static readonly string Reaction_tempo = "Темп реакции";
            public static readonly string Activity = "Активность";
            public static readonly string Sincerity = "Искренность";

            public static readonly string Extraversion_Introversion_Level = "Экстраверсия-интроверсия (уровень)";
            public static readonly string Rigidity_Plasticity_Level = "Ригидность-пластичность (уровень)";
            public static readonly string Emotional_excitability_Poise_Level = "Эмоциональная возбудимость-уравновешенность (уровень)";
            public static readonly string Reaction_tempo_Level = "Темп реакции (уровень)";
            public static readonly string Activity_Level = "Активность (уровень)";
        }

        private const int Yes = 1;
        private const int No = 2;

        public Структура_темперамента_Смирнов()
        {

        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Структура_темперамента_Смирнов);

            results.AddValue(new TestResultValue(ScaleKeys.Extraversion_Introversion, 0)
                .AddWithPoints(questionnaire, Yes, 3, 1, 7, 13, 19, 25, 31, 37)
                .AddWithPoints(questionnaire, Yes, 2, 4, 43));

            var EI_Points = results.Values.FirstOrDefault(f => f.Key == ScaleKeys.Extraversion_Introversion);
            results.AddValue(new TestResultValue(ScaleKeys.Extraversion_Introversion_Level, GetExtraversionIntroversionLevel(EI_Points.Int)));

            results.AddValue(new TestResultValue(ScaleKeys.Rigidity_Plasticity, 0)
               .AddWithPoints(questionnaire, Yes, 3, 8, 26, 32)
               .AddWithPoints(questionnaire, Yes, 2, 2, 14, 20, 38, 44)
               .AddWithPoints(questionnaire, No, 1, 19, 46));

            var RP_Points = results.Values.FirstOrDefault(f => f.Key == ScaleKeys.Rigidity_Plasticity);
            results.AddValue(new TestResultValue(ScaleKeys.Rigidity_Plasticity_Level, GetRigidityPlasticityLevel(RP_Points.Int)));

            results.AddValue(new TestResultValue(ScaleKeys.Emotional_excitability_Poise, 0)
              .AddWithPoints(questionnaire, Yes, 3, 15, 21, 33, 39, 45)
              .AddWithPoints(questionnaire, Yes, 2, 3, 9)
              .AddWithPoints(questionnaire, Yes, 1, 27));

            var EE_Points = results.Values.FirstOrDefault(f => f.Key == ScaleKeys.Emotional_excitability_Poise);
            results.AddValue(new TestResultValue(ScaleKeys.Emotional_excitability_Poise_Level, GetEmotionalExcitabilityPoiseLevel(EE_Points.Int)));

            results.AddValue(new TestResultValue(ScaleKeys.Reaction_tempo, 0)
             .AddWithPoints(questionnaire, Yes, 3, 4, 16, 28)
             .AddWithPoints(questionnaire, Yes, 2, 10, 22, 34, 40, 46));

            var RT_Points = results.Values.FirstOrDefault(f => f.Key == ScaleKeys.Reaction_tempo);
            results.AddValue(new TestResultValue(ScaleKeys.Reaction_tempo_Level, GetReactionTempoLevel(RT_Points.Int)));

            results.AddValue(new TestResultValue(ScaleKeys.Activity, 0)
             .AddWithPoints(questionnaire, Yes, 3, 5, 11, 17, 23, 29, 35, 41, 47)
             .AddWithPoints(questionnaire, Yes, 1, 10)
             .AddWithPoints(questionnaire, No, 1, 38));

            var A_Points = results.Values.FirstOrDefault(f => f.Key == ScaleKeys.Activity);
            results.AddValue(new TestResultValue(ScaleKeys.Activity_Level, GetActivityLevel(A_Points.Int)));

            results.AddValue(new TestResultValue(ScaleKeys.Sincerity, 0)
            .AddWithPoints(questionnaire, Yes, 3, 30, 36, 42, 48)
            .AddWithPoints(questionnaire, Yes, 2, 6, 12)
            .AddWithPoints(questionnaire, Yes, 1, 18, 24, 25)
            .AddWithPoints(questionnaire, No, 1, 23));
            return results;
        }


        /// <summary>
        /// Возвращает уровень эктраверсии-интроверсии
        /// </summary>
        /// <param name="rawPoints"></param>
        /// <returns></returns>
        private int GetExtraversionIntroversionLevel(int rawPoints)
        {
            if (rawPoints >= 22 && rawPoints <= 27)
                return -2;
            else if (rawPoints >= 17 && rawPoints <= 21)
                return -1;
            else if (rawPoints >= 12 && rawPoints <= 16)
                return 0;
            else if (rawPoints >= 7 && rawPoints <= 11)
                return 1;
            else if (rawPoints >= 0 && rawPoints <= 6)
                return 2;
            return 0;
        }


        /// <summary>
        /// Возвращает уровень ригидности-пластичности
        /// </summary>
        /// <param name="rawPoints"></param>
        /// <returns></returns>
        private int GetRigidityPlasticityLevel(int rawPoints)
        {
            if (rawPoints >= 16 && rawPoints <= 25)
                return -2;
            if (rawPoints >= 12 && rawPoints <= 15)
                return -1;
            if (rawPoints >= 7 && rawPoints <= 11)
                return 0;
            if (rawPoints >= 3 && rawPoints <= 6)
                return 1;
            if (rawPoints >= 0 && rawPoints <= 2)
                return 2;
            return 0;
        }


        /// <summary>
        /// Возвращает уровень эмоциональной возбудимости-уравновешенности
        /// </summary>
        /// <param name="rawPoints"></param>
        /// <returns></returns>
        private int GetEmotionalExcitabilityPoiseLevel(int rawPoints)
        {
            if (rawPoints >= 18 && rawPoints <= 20)
                return -2;
            else if (rawPoints >= 14 && rawPoints <= 17)
                return -1;
            else if (rawPoints >= 8 && rawPoints <= 13)
                return 0;
            else if (rawPoints >= 4 && rawPoints <= 7)
                return 1;
            else if (rawPoints >= 0 && rawPoints <= 3)
                return 2;
            return 0;
        }

        /// <summary>
        /// Возвращает уровень темпа реакции
        /// </summary>
        /// <param name="rawPoints"></param>
        /// <returns></returns>
        private int GetReactionTempoLevel(int rawPoints)
        {
            if (rawPoints >= 20 && rawPoints <= 22)
                return -2;
            else if (rawPoints >= 14 && rawPoints <= 19)
                return -1;
            else if (rawPoints >= 9 && rawPoints <= 13)
                return 0;
            else if (rawPoints >= 5 && rawPoints <= 8)
                return 1;
            else if (rawPoints >= 0 && rawPoints <= 4)
                return 2;
            return 0;
        }


        /// <summary>
        /// Возвращает уровень активности
        /// </summary>
        /// <param name="rawPoints"></param>
        /// <returns></returns>
        private int GetActivityLevel(int rawPoints)
        {
            if (rawPoints >= 24 && rawPoints <= 26)
                return -2;
            else if (rawPoints >= 21 && rawPoints <= 23)
                return -1;
            else if (rawPoints >= 14 && rawPoints <= 20)
                return 0;
            else if (rawPoints >= 9 && rawPoints <= 13)
                return 1;
            else if (rawPoints >= 0 && rawPoints <= 8)
                return 2;
            return 0;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Тест_MMPI_Березина.cs


using System;
using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Тест_MMPI_Березина : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string L = "Шкала L";
            public static readonly string F = "Шкала F";
            public static readonly string K = "Шкала K";
            public static readonly string S1 = "Шкала 1";
            public static readonly string S2 = "Шкала 2";
            public static readonly string S3 = "Шкала 3";
            public static readonly string S4 = "Шкала 4";
            public static readonly string S5 = "Шкала 5";
            public static readonly string S6 = "Шкала 6";
            public static readonly string S7 = "Шкала 7";
            public static readonly string S8 = "Шкала 8";
            public static readonly string S9 = "Шкала 9";
            public static readonly string S0 = "Шкала 0";
            public static readonly string Reliability = "Достоверность";
            public static readonly string Combination = "Сочетание";
        }

        private const int Right = 1;
        private const int Wrong = 2;
        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var resultsRaw = new TestResults(TestType.Тест_MMPI_Березина);
            questionnaire.Questions.RemoveAt(0);

            var firstAnswer = questionnaire.Questions.ElementAt(0).Answers.FirstOrDefault(f => f.IsSelected);
            var gender = questionnaire.Questions.ElementAt(0).Answers.IndexOf(firstAnswer) + 1;

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.L, 0)
              .Add(questionnaire, Wrong, 50, 58, 65, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.F, 0)
              .Add(questionnaire, Wrong, 24, 84, 87, 176, 193, 205, 233, 235, 261, 263, 293, 323, 364));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.F, 0)
            .Add(questionnaire, Right, 12, 26, 27, 28, 54, 55, 72, 83, 85, 86, 102,
            105, 113, 115, 116, 117, 132, 143, 145, 146, 147, 173, 175, 177, 203,
            206, 207, 208, 209, 236, 237, 265, 266, 267, 294, 295, 297, 324, 325,
            326, 327, 329, 334, 353, 354, 355, 356, 357));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.K, 0)
             .Add(questionnaire, Wrong, 8, 13, 38, 43, 73, 94, 98, 103, 124, 126, 133, 154,
             158, 163, 188, 193, 217, 218, 223, 253, 277, 280, 282,
             283, 310, 312, 313, 342, 372));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.K, 0)
             .Add(questionnaire, Right, 340));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S1, 0)
            .Add(questionnaire, Wrong, 16, 75, 131, 167, 195, 254, 284, 374));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S1, 0)
           .Add(questionnaire, Right, 15, 17, 45, 46, 47, 77, 105, 107, 135, 136,
           165, 197, 255, 285, 286, 308, 314, 315, 316, 344, 345, 346, 375, 376));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S2, 0)
           .Add(questionnaire, Wrong, 18, 20, 41, 43, 50, 75, 124,
           131, 137, 138, 163, 167, 193, 198, 199, 223, 254, 277, 284, 287, 288,
           289, 317, 318, 319, 338, 347, 348, 349, 368, 370, 377));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S2, 0)
         .Add(questionnaire, Right, 19, 48, 49, 79, 98, 105, 108, 109, 139, 165,
         168, 169, 225, 228, 229, 253, 257, 258, 259, 315, 337, 367));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S3, 0)
          .Add(questionnaire, Wrong, 8, 11, 16, 38, 41, 43, 44, 71, 73, 74, 75, 101, 103,
          104, 124, 133, 155, 163, 164, 184, 187, 195, 196, 214, 218, 224, 226, 248, 254,
          278, 280, 284, 286, 343, 370, 374));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S3, 0)
        .Add(questionnaire, Right, 14, 15, 45, 46, 76, 105, 106, 134, 135, 136, 165,
        166, 194, 225, 255, 285, 314, 315, 337, 344, 345, 373, 375));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S4, 0)
        .Add(questionnaire, Wrong, 8, 10, 11, 38, 41, 68, 71, 94, 101, 130,
        131, 160, 161, 187, 217, 220, 277, 280, 307, 310, 340, 370));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S4, 0)
        .Add(questionnaire, Right, 12, 40, 42, 64, 70, 72, 100, 102, 132, 162, 190, 191,
        192, 221, 222, 247, 250, 251, 252, 281, 311, 337, 341, 367, 369, 371));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S5, 0)
       .Add(questionnaire, Wrong, 2, 4, 31, 33, 34, 35, 61, 63, 65, 91, 92, 121, 123, 153, 154,
       182, 183, 184, 211, 212, 214, 241, 244, 271, 272, 304, 333, 363, 364));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S5, 0)
            .Add(questionnaire, Right, 1, 5, 32, 62, 94, 122, 151, 152, 181, 213, 242, 243,
            273, 274, 301, 302, 303, 331, 332, 334, 361, 362));

            if (gender == 1)
                resultsRaw.AddValue(new TestResultValue(ScaleKeys.S5, 0).Add(questionnaire, Right, 93));
            else
                resultsRaw.AddValue(new TestResultValue(ScaleKeys.S5, 0).Add(questionnaire, Wrong, 93));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S6, 0)
       .Add(questionnaire, Wrong, 34, 118, 148, 188, 218, 238, 268, 370));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S6, 0)
        .Add(questionnaire, Right, 5, 12, 28, 42, 51, 88, 113, 114, 143, 144, 162, 171, 178, 192, 203,
        208, 222, 231, 254, 262, 267, 291, 297, 308, 327, 339, 357, 371));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S7, 0)
     .Add(questionnaire, Wrong, 261, 288, 318, 348));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S7, 0)
       .Add(questionnaire, Right, 19, 21, 39, 49, 51, 69, 76, 79, 80, 81, 99, 106, 109, 110, 111, 129,
       136, 140, 141, 154, 159, 170, 171, 189, 191, 195, 200, 201, 221,
       230, 231, 251, 253, 258, 260, 290, 291, 315, 320, 337, 350, 367));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S8, 0)
                .Add(questionnaire, Wrong, 41, 84, 233, 262, 264, 283, 292, 293, 322, 323));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S8, 0)
      .Add(questionnaire, Right, 12, 21, 22, 23, 42, 51, 52, 53, 54, 81, 82, 83, 111, 112,
      113, 114, 141, 142, 142, 144, 171, 172, 173, 174, 201, 202, 203, 204, 231, 232, 234,
      247, 249, 274, 279, 281, 304, 308, 309, 311, 321, 337, 341, 345, 351, 352, 353, 371, 375));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S9, 0)
                           .Add(questionnaire, Wrong, 8, 30, 34, 89, 90, 108, 120, 217, 249, 313, 358));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S9, 0)
     .Add(questionnaire, Right, 20, 21, 29, 51, 59, 60, 94, 106, 119, 149, 166, 174, 179, 196,
     204, 209, 222, 234, 239, 256, 262, 264, 269, 276, 281, 289, 298, 299, 319, 328, 339, 349, 353, 359));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S0, 0)
                          .Add(questionnaire, Wrong, 36, 66, 67, 68, 125, 156, 157, 185, 186, 189, 215,
                          249, 273, 275, 276, 277, 303, 306, 333, 335, 336, 339, 363, 368));

            resultsRaw.AddValue(new TestResultValue(ScaleKeys.S0, 0)
     .Add(questionnaire, Right, 6, 7, 9, 34, 37, 38, 39, 69, 95, 97, 98, 99, 126, 127, 128,
     129, 155, 158, 159, 187, 188, 217, 218, 219, 243, 245, 246, 247, 248, 278, 279, 305, 307, 308, 309,
     337, 338, 365, 366, 367));

            double L = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.L).Int;
            double F = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.F).Int;
            double K = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.K).Int;
            double S1 = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.S1).Int;
            double S2 = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.S2).Int;
            double S3 = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.S3).Int;
            double S4 = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.S4).Int;
            double S5 = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.S5).Int;
            double S6 = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.S6).Int;
            double S7 = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.S7).Int;
            double S8 = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.S8).Int;
            double S9 = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.S9).Int;
            double S0 = resultsRaw.Values.FirstOrDefault(f => f.Key == ScaleKeys.S0).Int;

            var results = new TestResults(TestType.Тест_MMPI_Березина);

            S1 = S1 + 0.5 * K;
            S4 = S4 + 0.4 * K;
            S7 = S7 + K;
            S8 = S8 + K;
            S9 = S9 + 0.2 * K;

            ConvertToTPoints(gender, ref L, ref F, ref K, ref S1, ref S2, ref S3, ref S4, ref S5, ref S6, ref S7, ref S8, ref S9, ref S0);

            string realiability = "";
            if (L > 80 || F > 80 || K > 80 || K < 20)
                realiability = "Результаты не достоверны.";
            else
                realiability = "Результаты достоверны.";

            var resultsArray = new double[] { L, F, K, S1, S2, S3, S4, S5, S6, S7, S8, S9, S0 };
            string domination = Domination(resultsArray);

            if (domination == "")
                domination = " ";

            results.AddValue(new TestResultValue(ScaleKeys.L , L ));
            results.AddValue(new TestResultValue(ScaleKeys.F , F ));
            results.AddValue(new TestResultValue(ScaleKeys.K , K ));
            results.AddValue(new TestResultValue(ScaleKeys.S1, S1));
            results.AddValue(new TestResultValue(ScaleKeys.S2, S2));
            results.AddValue(new TestResultValue(ScaleKeys.S3, S3));
            results.AddValue(new TestResultValue(ScaleKeys.S4, S4));
            results.AddValue(new TestResultValue(ScaleKeys.S5, S5));
            results.AddValue(new TestResultValue(ScaleKeys.S6, S6));
            results.AddValue(new TestResultValue(ScaleKeys.S7, S7));
            results.AddValue(new TestResultValue(ScaleKeys.S8, S8));
            results.AddValue(new TestResultValue(ScaleKeys.S9, S9));
            results.AddValue(new TestResultValue(ScaleKeys.S0, S0));
            results.AddValue(new TestResultValue(ScaleKeys.Reliability, realiability));
            results.AddValue(new TestResultValue(ScaleKeys.Combination, domination));

            return resultsRaw;
        }
        private void ConvertToTPoints(int gender,
                                      ref double L,
                                      ref double F,
                                      ref double K,
                                      ref double S1,
                                      ref double S2,
                                      ref double S3,
                                      ref double S4,
                                      ref double S5,
                                      ref double S6,
                                      ref double S7,
                                      ref double S8,
                                      ref double S9,
                                      ref double S0)
        {

            if (gender == 1)
            {
                L = 50 + 10 * Math.Abs(L - 3.94) / 2.24;
                F = 50 + 10 * Math.Abs(F - 5.76) / 2.92;
                K = 50 + 10 * Math.Abs(K - 15.7) / 3.88;
                S1 = 50 + 10 * Math.Abs(S1 - 12) / 3.28;
                S2 = 50 + 10 * Math.Abs(S2 - 20.3) / 4.14;
                S3 = 50 + 10 * Math.Abs(S3 - 18.1) / 4.44;
                S4 = 50 + 10 * Math.Abs(S4 - 21.2) / 4.17;
                S5 = 50 + 10 * Math.Abs(S5 - 21.6) / 3.91;
                S6 = 50 + 10 * Math.Abs(S6 - 9.2) / 2.77;
                S7 = 50 + 10 * Math.Abs(S7 - 27.4) / 4.79;
                S8 = 50 + 10 * Math.Abs(S8 - 26.7) / 4.46;
                S9 = 50 + 10 * Math.Abs(S9 - 18.6) / 4;
                S0 = 50 + 10 * Math.Abs(S0 - 26.8) / 7.04;
            }
            else
            {
                L = 50 + 10 * Math.Abs(L - 4.56) / 2.43;
                F = 50 + 10 * Math.Abs(F - 6.77) / 3.18;
                K = 50 + 10 * Math.Abs(K - 14.6) / 4.14;
                S1 = 50 + 10 * Math.Abs(S1 - 14.5) / 4.47;
                S2 = 50 + 10 * Math.Abs(S2 - 24.7) / 5.03;
                S3 = 50 + 10 * Math.Abs(S3 - 20.3) / 5.18;
                S4 = 50 + 10 * Math.Abs(S4 - 22) / 4.2;
                S5 = 50 - 10 * Math.Abs(S5 - 32) / 3.82;
                S6 = 50 + 10 * Math.Abs(S6 - 10.5) / 3.29;
                S7 = 50 + 10 * Math.Abs(S7 - 31.8) / 4.77;
                S8 = 50 + 10 * Math.Abs(S8 - 29.6) / 25;
                S9 = 50 + 10 * Math.Abs(S9 - 19) / 3.82;
                S0 = 50 + 10 * Math.Abs(S0 - 30.4) / 7.75;
            }
        }

        private string Domination(double[] resultsArray)
        {
            int I, J;
            double Max, Min, MaxSum, MinSum;
            List<int> Tables = new List<int>();
            List<int> Dom = new List<int>();
            string Result = "";

            for (I = 0; I <= 12; I++)
                Tables.Add(I);

            // Ищем не менее 4-ёх сильно отклоняющихся шкал
            while (Dom.Count < 4)
            {
                Max = -1;
                Min = 101;
                MaxSum = 0;
                MinSum = 0;
                // Ищем максимальное и минимальное значения
                for (I = 0; I <= Tables.Count - 1; I++)
                {
                    if (resultsArray[Tables[I]] > Max)
                    {
                        Max = resultsArray[Tables[I]];
                    }
                    if (resultsArray[Tables[I]] < Min)
                    {
                        Min = resultsArray[Tables[I]];
                    }
                }
                // Проверяем что сильнее отклонено: максимум или минимум
                for (I = 0; I <= Tables.Count - 1; I++)
                {
                    MaxSum = MaxSum + Max - resultsArray[Tables[I]];
                    MinSum = MinSum + resultsArray[Tables[I]] - Min;
                }

                J = 0;
                if (MaxSum > MinSum)
                {
                    // Добавляем в список доминатных все шкалы, содержащие максимальное значение
                    while (J < Tables.Count)
                    {
                        if (resultsArray[Tables[J]] == Max)
                        {
                            Dom.Add(Tables[J]);
                            Tables.RemoveAt(J);
                        }
                        else
                            J++;
                    }
                }
                else
                    // Добавляем в список доминатных все шкалы, содержащие минимальное значение
                    while (J < Tables.Count)
                    {
                        if (resultsArray[Tables[J]] == Min)
                        {
                            Dom.Add(-(Tables[J]) - 1);
                            Tables.RemoveAt(J);
                        }
                        else
                            J++;
                    }
            }

            // Опять ищем максимальное и минимальное значения оставшихся шкал
            Max = -1;
            Min = 101;
            for (I = 0; I <= Tables.Count - 1; I++)
            {
                if (resultsArray[Tables[I]] > Max)
                    Max = resultsArray[Tables[I]];
                if (resultsArray[Tables[I]] < Min)
                    Min = resultsArray[Tables[I]];
            }

        L:;
            for (I = 0; I <= Dom.Count - 1; I++)
            {
                if (Dom[I] >= 0)
                    if (resultsArray[Dom[I]] - Max <= 5)
                    {
                        Max = resultsArray[Dom[I]];
                        Dom.RemoveAt(I);
                        goto L;
                    }
                if (Dom[I] < 0)
                    if (Min - resultsArray[-Dom[I] - 1] <= 5)
                    {
                        Min = resultsArray[-Dom[I] - 1];
                        Dom.RemoveAt(I);
                        goto L;
                    }
            }

            // Составляем выходную строку
            while (Dom.Count != 0)
            {
            Max= -1;
            J= -1;
                for (I = 0; I <= Dom.Count - 1; I++)
                {
                    if (Dom[I] >= 0)
                    {
                        if (Dom[I] > Max)
                        {
                            Max = Dom[I];
                            J = I;
                        }
                    }
                    else if ((-Dom[I] - 1) > Max)
                    {
                        Max = -Dom[I] - 1;
                        J = I;
                    }
                }
                if (Dom[J] >= 0)
                {
                    Result= Result + '+' + ToTable(Max);
                    Dom.RemoveAt(J);
                    continue;
                }
                else
                {
                    Result= Result + '-' + ToTable(Max);
                    Dom.RemoveAt(J);
                    continue;
                }
                }
            return Result;
            }


        private string ToTable(double value)
        {
            switch (Math.Truncate(value))
            {
                case 0:
                    return "L";
                case 1:
                    return "F";
                case 2:
                    return "K";
                case 3:
                    return Math.Truncate(value - 3).ToString();
                case 4:
                    return Math.Truncate(value - 3).ToString();
                case 5:
                    return Math.Truncate(value - 3).ToString();
                case 6:
                    return Math.Truncate(value - 3).ToString();
                case 7:
                    return Math.Truncate(value - 3).ToString();
                case 8:
                    return Math.Truncate(value - 3).ToString();
                case 9:
                    return Math.Truncate(value - 3).ToString();
                case 10:
                    return Math.Truncate(value - 3).ToString();
                case 11:
                    return Math.Truncate(value - 3).ToString();
                case 12:
                    return "0";
            }
            return "";
        }
        }
    }
        
        
        
        
        
        
        
        
        
        
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Тест_Айзенка.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Тест_Айзенка : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Психотизм = "Психотизм";
            public static readonly string Экстраверсия = "Экстраверсия/Интроверсия";
            public static readonly string Нейротизм = "Нейротизм";
            public static readonly string Искренность = "Искренность";
        }

        private const int Yes = 1;
        private const int No = 2;

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Тест_Айзенка_EPQ);

            results.AddValue(new TestResultValue(ScaleKeys.Психотизм, 0)
              .Add(questionnaire, No, 2, 6, 9, 11, 19, 39, 43, 59, 63, 67, 78, 100)
              .Add(questionnaire,Yes, 23, 27, 31, 35, 47, 51, 55, 71, 85, 88, 93, 97));

            results.AddValue(new TestResultValue(ScaleKeys.Экстраверсия, 0)
                .Add(questionnaire, No, 22, 30, 46, 84)
                .Add(questionnaire, Yes, 1, 5, 10, 15, 18, 26, 34, 38, 42, 50, 54, 58, 62, 65, 70, 74, 77, 81, 90, 92, 96));

            results.AddValue(new TestResultValue(ScaleKeys.Нейротизм, 0)
             .Add(questionnaire, Yes, 3, 7, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 75, 79, 83, 86,
             89, 94, 98));

            results.AddValue(new TestResultValue(ScaleKeys.Искренность, 0)
             .Add(questionnaire, No, 4, 8, 17, 25, 29, 41, 45, 49, 53, 57, 66, 69, 76, 80, 82, 91, 95)
             .Add(questionnaire, Yes, 13, 21, 33, 37, 61, 73, 87, 99));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Тест_Кеттелла.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Тест_Кеттелла : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Высокие = "Высокие";
            public static readonly string Низкие = "Низкие";
            public static readonly string Баллы = "Баллы";
            public static readonly string Стены = "Стены";
        }

        public class ScoresKeys
        {
            public static readonly List<ScaleValue> A = new List<ScaleValue>()
            {
                new ScaleValue(3, 2, 1, 0),
                new ScaleValue(26, 0, 1, 2),
                new ScaleValue(27, 0, 1, 2),
                new ScaleValue(51, 0, 1, 2),
                new ScaleValue(52, 2, 1, 0),
                new ScaleValue(76, 0, 1, 2),
                new ScaleValue(101, 2, 1, 0),
                new ScaleValue(126, 2, 1, 0),
                new ScaleValue(151, 0, 1, 2),
                new ScaleValue(176, 2, 1, 0),
            };

            public static readonly List<ScaleValue> B = new List<ScaleValue>()
            {
                new ScaleValue(28, 0, 1, 0),
                new ScaleValue(53, 0, 1, 0),
                new ScaleValue(54, 0, 1, 0),
                new ScaleValue(77, 0, 0, 1),
                new ScaleValue(78, 0, 1, 0),
                new ScaleValue(102, 0, 0, 1),
                new ScaleValue(103, 0, 1, 0),
                new ScaleValue(127, 0, 0, 1),
                new ScaleValue(128, 0, 1, 0),
                new ScaleValue(152, 1, 0, 0),
                new ScaleValue(153, 0, 0, 1),
                new ScaleValue(177, 1, 0, 0),
                new ScaleValue(178, 1, 0, 0),
            };

            public static readonly List<ScaleValue> C = new List<ScaleValue>()
            {
                new ScaleValue(4, 2, 1, 0),
                new ScaleValue(5, 0, 1, 2),
                new ScaleValue(29, 0, 1, 2),
                new ScaleValue(30, 2, 1, 0),
                new ScaleValue(55, 2, 1, 0),
                new ScaleValue(79, 0, 1, 2),
                new ScaleValue(80, 0, 1, 2),
                new ScaleValue(104, 2, 1, 0),
                new ScaleValue(105, 2, 1, 0),
                new ScaleValue(129, 0, 1, 2),
                new ScaleValue(130, 2, 1, 0),
                new ScaleValue(154, 0, 1, 2),
                new ScaleValue(179, 2, 1, 0),
            };

            public static readonly List<ScaleValue> E = new List<ScaleValue>()
            {
                new ScaleValue(6, 0, 1, 2),
                new ScaleValue(7, 2, 1, 0),
                new ScaleValue(31, 0, 1, 2),
                new ScaleValue(32, 0, 1, 2),
                new ScaleValue(56, 0, 1, 2),
                new ScaleValue(57, 2, 1, 0),
                new ScaleValue(81, 0, 1, 2),
                new ScaleValue(106, 0, 1, 2),
                new ScaleValue(131, 2, 1, 0),
                new ScaleValue(155, 2, 1, 0),
                new ScaleValue(156, 2, 1, 0),
                new ScaleValue(180, 2, 1, 0),
                new ScaleValue(181, 2, 1, 0),

            };

            public static readonly List<ScaleValue> F = new List<ScaleValue>()
            {
                new ScaleValue(8, 0, 1, 2),
                new ScaleValue(33, 2, 1, 0),
                new ScaleValue(58, 2, 1, 0),
                new ScaleValue(82, 0, 1, 2),
                new ScaleValue(83, 2, 1, 0),
                new ScaleValue(107, 0, 1, 2),
                new ScaleValue(108, 0, 1, 2),
                new ScaleValue(132, 2, 1, 0),
                new ScaleValue(133, 2, 1, 0),
                new ScaleValue(157, 0, 1, 2),
                new ScaleValue(158, 0, 1, 2),
                new ScaleValue(182, 2, 1, 0),
                new ScaleValue(183, 2, 1, 0),

            };

            public static readonly List<ScaleValue> G = new List<ScaleValue>()
            {
                new ScaleValue(9, 0, 1, 2),
                new ScaleValue(34, 0, 1, 2),
                new ScaleValue(59, 0, 1, 2),
                new ScaleValue(84, 0, 1, 2),
                new ScaleValue(109, 2, 1, 0),
                new ScaleValue(134, 2, 1, 0),
                new ScaleValue(159, 0, 1, 2),
                new ScaleValue(160, 2, 1, 0),
                new ScaleValue(184, 2, 1, 0),
                new ScaleValue(185, 2, 1, 0)
            };

            public static readonly List<ScaleValue> H = new List<ScaleValue>()
            {
                new ScaleValue(10, 2, 1, 0),
                new ScaleValue(35, 0, 1, 2),
                new ScaleValue(36, 2, 1, 0),
                new ScaleValue(60, 0, 1, 2),
                new ScaleValue(61, 0, 1, 2),
                new ScaleValue(85, 2, 1, 0),
                new ScaleValue(86, 2, 1, 0),
                new ScaleValue(110, 2, 1, 0),
                new ScaleValue(111, 2, 1, 0),
                new ScaleValue(135, 2, 1, 0),
                new ScaleValue(136, 2, 1, 0),
                new ScaleValue(161, 0, 1, 2),
                new ScaleValue(186, 2, 1, 0),

            };

            public static readonly List<ScaleValue> I = new List<ScaleValue>()
            {
                new ScaleValue(11, 0, 1, 2),
                new ScaleValue(12, 2, 1, 0),
                new ScaleValue(37, 2, 1, 0),
                new ScaleValue(62, 0, 1, 2),
                new ScaleValue(87, 0, 1, 2),
                new ScaleValue(112, 2, 1, 0),
                new ScaleValue(137, 0, 1, 2),
                new ScaleValue(138, 2, 1, 0),
                new ScaleValue(162, 0, 1, 2),
                new ScaleValue(163, 2, 1, 0),

            };

            public static readonly List<ScaleValue> L = new List<ScaleValue>()
            {
                new ScaleValue(13, 0, 1, 2),
                new ScaleValue(38, 2, 1, 0),
                new ScaleValue(63, 0, 1, 2),
                new ScaleValue(64, 0, 1, 2),
                new ScaleValue(88, 2, 1, 0),
                new ScaleValue(89, 0, 1, 2),
                new ScaleValue(113, 2, 1, 0),
                new ScaleValue(114, 2, 1, 0),
                new ScaleValue(139, 0, 1, 2),
                new ScaleValue(164, 2, 1, 0),

            };

            public static readonly List<ScaleValue> M = new List<ScaleValue>()
            {
                new ScaleValue(14, 0, 1, 2),
                new ScaleValue(15, 0, 1, 2),
                new ScaleValue(39, 2, 1, 0),
                new ScaleValue(40, 2, 1, 0),
                new ScaleValue(65, 2, 1, 0),
                new ScaleValue(90, 0, 1, 2),
                new ScaleValue(91, 2, 1, 0),
                new ScaleValue(114, 2, 1, 0),
                new ScaleValue(115, 2, 1, 0),
                new ScaleValue(140, 2, 1, 0),
                new ScaleValue(141, 0, 1, 2),
                new ScaleValue(165, 0, 1, 2),
                new ScaleValue(166, 0, 1, 2),

            };

            public static readonly List<ScaleValue> N = new List<ScaleValue>()
            {
                new ScaleValue(16, 0, 1, 2),
                new ScaleValue(17, 2, 1, 0),
                new ScaleValue(41, 0, 1, 2),
                new ScaleValue(42, 2, 1, 0),
                new ScaleValue(66, 0, 1, 2),
                new ScaleValue(67, 0, 1, 2),
                new ScaleValue(92, 0, 1, 2),
                new ScaleValue(117, 2, 1, 0),
                new ScaleValue(142, 2, 1, 0),
                new ScaleValue(167, 2, 1, 0),
            };

            public static readonly List<ScaleValue> O = new List<ScaleValue>()
            {
                new ScaleValue(18, 2, 1, 0),
                new ScaleValue(19, 0, 1, 2),
                new ScaleValue(43, 2, 1, 0),
                new ScaleValue(44, 0, 1, 2),
                new ScaleValue(68, 0, 1, 2),
                new ScaleValue(69, 2, 1, 0),
                new ScaleValue(93, 0, 1, 2),
                new ScaleValue(94, 2, 1, 0),
                new ScaleValue(118, 2, 1, 0),
                new ScaleValue(119, 2, 1, 0),
                new ScaleValue(143, 2, 1, 0),
                new ScaleValue(144, 0, 1, 2),
                new ScaleValue(168, 0, 1, 2),

            };

            public static readonly List<ScaleValue> Q1 = new List<ScaleValue>()
            {
                new ScaleValue(20, 2, 1, 0),
                new ScaleValue(21, 0, 1, 2),
                new ScaleValue(45, 0, 1, 2),
                new ScaleValue(46, 2, 1, 0),
                new ScaleValue(70, 2, 1, 0),
                new ScaleValue(95, 0, 1, 2),
                new ScaleValue(120, 0, 1, 2),
                new ScaleValue(145, 2, 1, 0),
                new ScaleValue(169, 2, 1, 0),
                new ScaleValue(170, 0, 1, 2),

            };

            public static readonly List<ScaleValue> Q2 = new List<ScaleValue>()
            {
                new ScaleValue(22, 0, 1, 2),
                new ScaleValue(47, 2, 1, 0),
                new ScaleValue(71, 2, 1, 0),
                new ScaleValue(72, 2, 1, 0),
                new ScaleValue(96, 2, 1, 0),
                new ScaleValue(97, 2, 1, 0),
                new ScaleValue(121, 0, 1, 2),
                new ScaleValue(122, 0, 1, 2),
                new ScaleValue(146, 2, 1, 0),
                new ScaleValue(171, 2, 1, 0),

            };

            public static readonly List<ScaleValue> Q3 = new List<ScaleValue>()
            {
                new ScaleValue(23, 0, 1, 2),
                new ScaleValue(24, 0, 1, 2),
                new ScaleValue(48, 2, 1, 0),
                new ScaleValue(73, 2, 1, 0),
                new ScaleValue(98, 2, 1, 0),
                new ScaleValue(123, 0, 1, 2),
                new ScaleValue(147, 0, 1, 2),
                new ScaleValue(148, 2, 1, 0),
                new ScaleValue(172, 0, 1, 2),
                new ScaleValue(173, 2, 1, 0),

            };

            public static readonly List<ScaleValue> Q4 = new List<ScaleValue>()
            {
                new ScaleValue(25, 0, 1, 2),
                new ScaleValue(49, 2, 1, 0),
                new ScaleValue(50, 2, 1, 0),
                new ScaleValue(74, 2, 1, 0),
                new ScaleValue(75, 0, 1, 2),
                new ScaleValue(99, 2, 1, 0),
                new ScaleValue(100, 0, 1, 2),
                new ScaleValue(124, 2, 1, 0),
                new ScaleValue(125, 2, 1, 0),
                new ScaleValue(149, 2, 1, 0),
                new ScaleValue(150, 0, 1, 2),
                new ScaleValue(174, 2, 1, 0),
                new ScaleValue(175, 0, 1, 2),

            };
        }

        public interface IStenValues
        {
            List<StenValue> A { get; set; }
            List<StenValue> B { get; set; }
            List<StenValue> C { get; set; }
            List<StenValue> E { get; set; }
            List<StenValue> F { get; set; }
            List<StenValue> G { get; set; }
            List<StenValue> H { get; set; }
            List<StenValue> I { get; set; }
            List<StenValue> L { get; set; }
            List<StenValue> M { get; set; }
            List<StenValue> N { get; set; }
            List<StenValue> O { get; set; }
            List<StenValue> Q1 { get; set; }
            List<StenValue> Q2 { get; set; }
            List<StenValue> Q3 { get; set; }
            List<StenValue> Q4 { get; set; }
        }
        public class StensKeys
        {
            public class Mens_19_28_Years : IStenValues
            {
                public List<StenValue> A { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,6,3),
                    new StenValue(7,7,4),
                    new StenValue(8,9,5),
                    new StenValue(10,11,6),
                    new StenValue(12,13,7),
                    new StenValue(14,14,8),
                    new StenValue(15,16,9),
                    new StenValue(17,20,10),
                };

                public List<StenValue> B { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,5,3),
                    new StenValue(6,6,4),
                    new StenValue(7,7,5),
                    new StenValue(8,8,6),
                    new StenValue(9,9,7),
                    new StenValue(10,10,8),
                    new StenValue(11,11,9),
                    new StenValue(12,13,10),
                };

                public List<StenValue> C { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,7,1),
                    new StenValue(8,9,2),
                    new StenValue(10,11,3),
                    new StenValue(12,13,4),
                    new StenValue(14,15,5),
                    new StenValue(16,17,6),
                    new StenValue(18,19,7),
                    new StenValue(20,21,8),
                    new StenValue(22,22,9),
                    new StenValue(23,26,10),
                };

                public List<StenValue> E { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,6,1),
                    new StenValue(7,8,2),
                    new StenValue(9,9,3),
                    new StenValue(10,11,4),
                    new StenValue(12,13,5),
                    new StenValue(14,16,6),
                    new StenValue(17,18,7),
                    new StenValue(19,19,8),
                    new StenValue(20,21,9),
                    new StenValue(22,26,10),
                };

                public List<StenValue> F { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,5,1),
                    new StenValue(6,8,2),
                    new StenValue(9,10,3),
                    new StenValue(11,13,4),
                    new StenValue(14,15,5),
                    new StenValue(16,17,6),
                    new StenValue(18,19,7),
                    new StenValue(20,21,8),
                    new StenValue(22,23,9),
                    new StenValue(24,26,10),
                };

                public List<StenValue> G { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,4,1),
                    new StenValue(5,6,2),
                    new StenValue(7,9,3),
                    new StenValue(10,11,4),
                    new StenValue(12,12,5),
                    new StenValue(13,14,6),
                    new StenValue(15,16,7),
                    new StenValue(17,17,8),
                    new StenValue(18,19,9),
                    new StenValue(20,20,10),
                };

                public List<StenValue> H { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,2,1),
                    new StenValue(3,4,2),
                    new StenValue(5,7,3),
                    new StenValue(8,10,4),
                    new StenValue(11,13,5),
                    new StenValue(14,16,6),
                    new StenValue(17,18,7),
                    new StenValue(19,20,8),
                    new StenValue(21,22,9),
                    new StenValue(23,26,10),
                };

                public List<StenValue> I { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,2,1),
                    new StenValue(3,3,2),
                    new StenValue(4,5,3),
                    new StenValue(6,6,4),
                    new StenValue(7,8,5),
                    new StenValue(9,10,6),
                    new StenValue(11,12,7),
                    new StenValue(13,14,8),
                    new StenValue(15,15,9),
                    new StenValue(16,20,10),
                };

                public List<StenValue> L { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,6,3),
                    new StenValue(7,7,4),
                    new StenValue(8,9,5),
                    new StenValue(10,11,6),
                    new StenValue(12,12,7),
                    new StenValue(13,14,8),
                    new StenValue(15,15,9),
                    new StenValue(16,20,10),
                };

                public List<StenValue> M { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,5,1),
                    new StenValue(6,6,2),
                    new StenValue(7,8,3),
                    new StenValue(9,9,4),
                    new StenValue(10,11,5),
                    new StenValue(12,13,6),
                    new StenValue(14,15,7),
                    new StenValue(16,17,8),
                    new StenValue(18,18,9),
                    new StenValue(19,20,10),
                };

                public List<StenValue> N { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,5,1),
                    new StenValue(6,7,2),
                    new StenValue(8,8,3),
                    new StenValue(9,9,4),
                    new StenValue(10,10,5),
                    new StenValue(11,12,6),
                    new StenValue(13,13,7),
                    new StenValue(14,15,8),
                    new StenValue(16,16,9),
                    new StenValue(17,20,10),
                };

                public List<StenValue> O { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,6,3),
                    new StenValue(7,8,4),
                    new StenValue(9,9,5),
                    new StenValue(10,11,6),
                    new StenValue(12,13,7),
                    new StenValue(14,15,8),
                    new StenValue(16,17,9),
                    new StenValue(18,26,10),
                };

                public List<StenValue> Q1 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,4,1),
                    new StenValue(5,5,2),
                    new StenValue(6,6,3),
                    new StenValue(7,8,4),
                    new StenValue(9,9,5),
                    new StenValue(10,10,6),
                    new StenValue(11,12,7),
                    new StenValue(13,13,8),
                    new StenValue(14,15,9),
                    new StenValue(16,20,10),
                };

                public List<StenValue> Q2 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,6,3),
                    new StenValue(7,7,4),
                    new StenValue(8,9,5),
                    new StenValue(10,11,6),
                    new StenValue(12,13,7),
                    new StenValue(14,15,8),
                    new StenValue(16,17,9),
                    new StenValue(18,20,10),
                };

                public List<StenValue> Q3 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,5,2),
                    new StenValue(6,6,3),
                    new StenValue(7,8,4),
                    new StenValue(9,10,5),
                    new StenValue(11,11,6),
                    new StenValue(12,13,7),
                    new StenValue(14,14,8),
                    new StenValue(15,16,9),
                    new StenValue(17,20,10),
                };

                public List<StenValue> Q4 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,7,3),
                    new StenValue(8,9,4),
                    new StenValue(10,12,5),
                    new StenValue(13,14,6),
                    new StenValue(15,17,7),
                    new StenValue(18,19,8),
                    new StenValue(20,21,9),
                    new StenValue(22,26,10),
                };
            }
            public class Mens_29_70_Years : IStenValues
            {
                public List<StenValue> A { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,6,3),
                    new StenValue(7,7,4),
                    new StenValue(8,9,5),
                    new StenValue(10,11,6),
                    new StenValue(12,13,7),
                    new StenValue(14,14,8),
                    new StenValue(15,16,9),
                    new StenValue(17,20,10),
                };

                public List<StenValue> B { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,1,1),
                    new StenValue(2,2,2),
                    new StenValue(3,3,3),
                    new StenValue(4,4,4),
                    new StenValue(5,5,5),
                    new StenValue(6,6,6),
                    new StenValue(7,7,7),
                    new StenValue(8,9,8),
                    new StenValue(10,10,9),
                    new StenValue(12,13,10),
                };

                public List<StenValue> C { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,7,1),
                    new StenValue(8,9,2),
                    new StenValue(10,12,3),
                    new StenValue(13,14,4),
                    new StenValue(15,16,5),
                    new StenValue(17,17,6),
                    new StenValue(18,19,7),
                    new StenValue(20,21,8),
                    new StenValue(22,23,9),
                    new StenValue(24,26,10),
                };

                public List<StenValue> E { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,5,1),
                    new StenValue(6,7,2),
                    new StenValue(8,9,3),
                    new StenValue(10,11,4),
                    new StenValue(12,13,5),
                    new StenValue(14,15,6),
                    new StenValue(16,17,7),
                    new StenValue(18,19,8),
                    new StenValue(20,21,9),
                    new StenValue(22,26,10),
                };

                public List<StenValue> F { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,5,2),
                    new StenValue(6,8,3),
                    new StenValue(9,10,4),
                    new StenValue(11,13,5),
                    new StenValue(14,15,6),
                    new StenValue(16,17,7),
                    new StenValue(18,19,8),
                    new StenValue(20,20,9),
                    new StenValue(21,26,10),
                };

                public List<StenValue> G { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,4,1),
                    new StenValue(5,7,2),
                    new StenValue(8,10,3),
                    new StenValue(11,12,4),
                    new StenValue(13,13,5),
                    new StenValue(14,15,6),
                    new StenValue(16,17,7),
                    new StenValue(18,18,8),
                    new StenValue(19,19,9),
                    new StenValue(20,20,10),
                };

                public List<StenValue> H { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,5,2),
                    new StenValue(6,8,3),
                    new StenValue(9,11,4),
                    new StenValue(12,14,5),
                    new StenValue(15,16,6),
                    new StenValue(17,19,7),
                    new StenValue(20,21,8),
                    new StenValue(22,23,9),
                    new StenValue(24,26,10),
                };

                public List<StenValue> I { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,2,1),
                    new StenValue(3,3,2),
                    new StenValue(4,4,3),
                    new StenValue(5,6,4),
                    new StenValue(7,8,5),
                    new StenValue(9,10,6),
                    new StenValue(11,12,7),
                    new StenValue(13,14,8),
                    new StenValue(15,15,9),
                    new StenValue(16,20,10),
                };

                public List<StenValue> L { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,2,1),
                    new StenValue(3,3,2),
                    new StenValue(4,5,3),
                    new StenValue(6,6,4),
                    new StenValue(8,8,5),
                    new StenValue(9,10,6),
                    new StenValue(11,12,7),
                    new StenValue(13,13,8),
                    new StenValue(14,15,9),
                    new StenValue(16,20,10),
                };

                public List<StenValue> M { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,5,1),
                    new StenValue(6,7,2),
                    new StenValue(8,8,3),
                    new StenValue(9,10,4),
                    new StenValue(11,11,5),
                    new StenValue(12,13,6),
                    new StenValue(14,15,7),
                    new StenValue(16,17,8),
                    new StenValue(18,19,9),
                    new StenValue(20,26,10),
                };

                public List<StenValue> N { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,6,1),
                    new StenValue(7,7,2),
                    new StenValue(8,9,3),
                    new StenValue(10,10,4),
                    new StenValue(11,11,5),
                    new StenValue(12,13,6),
                    new StenValue(14,14,7),
                    new StenValue(15,15,8),
                    new StenValue(16,17,9),
                    new StenValue(18,20,10),
                };

                public List<StenValue> O { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,2,1),
                    new StenValue(3,3,2),
                    new StenValue(4,5,3),
                    new StenValue(6,7,4),
                    new StenValue(8,9,5),
                    new StenValue(10,11,6),
                    new StenValue(12,12,7),
                    new StenValue(13,15,8),
                    new StenValue(16,17,9),
                    new StenValue(18,26,10),
                };

                public List<StenValue> Q1 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,4,1),
                    new StenValue(5,6,2),
                    new StenValue(7,7,3),
                    new StenValue(8,8,4),
                    new StenValue(9,10,5),
                    new StenValue(11,11,6),
                    new StenValue(12,13,7),
                    new StenValue(14,14,8),
                    new StenValue(15,16,9),
                    new StenValue(17,20,10),
                };

                public List<StenValue> Q2 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,6,3),
                    new StenValue(7,8,4),
                    new StenValue(9,10,5),
                    new StenValue(11,11,6),
                    new StenValue(12,13,7),
                    new StenValue(14,15,8),
                    new StenValue(16,17,9),
                    new StenValue(18,20,10),
                };

                public List<StenValue> Q3 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,4,1),
                    new StenValue(5,6,2),
                    new StenValue(7,8,3),
                    new StenValue(9,9,4),
                    new StenValue(10,11,5),
                    new StenValue(12,12,6),
                    new StenValue(13,14,7),
                    new StenValue(15,15,8),
                    new StenValue(16,17,9),
                    new StenValue(18,20,10),
                };

                public List<StenValue> Q4 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,0,1),
                    new StenValue(1,2,2),
                    new StenValue(3,5,3),
                    new StenValue(6,7,4),
                    new StenValue(8,10,5),
                    new StenValue(11,12,6),
                    new StenValue(13,15,7),
                    new StenValue(16,17,8),
                    new StenValue(18,19,9),
                    new StenValue(20,26,10),
                };
            }
            public class Womens_19_28_Years : IStenValues
            {
                public List<StenValue> A { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,4,1),
                    new StenValue(5,6,2),
                    new StenValue(7,7,3),
                    new StenValue(8,9,4),
                    new StenValue(10,12,5),
                    new StenValue(13,13,6),
                    new StenValue(14,15,7),
                    new StenValue(16,16,8),
                    new StenValue(17,18,9),
                    new StenValue(19,20,10),
                };

                public List<StenValue> B { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,5,3),
                    new StenValue(6,6,4),
                    new StenValue(7,7,5),
                    new StenValue(8,8,6),
                    new StenValue(9,9,7),
                    new StenValue(10,10,8),
                    new StenValue(11,11,9),
                    new StenValue(12,13,10),
                };

                public List<StenValue> C { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,6,1),
                    new StenValue(7,8,2),
                    new StenValue(9,10,3),
                    new StenValue(11,12,4),
                    new StenValue(13,14,5),
                    new StenValue(15,16,6),
                    new StenValue(17,18,7),
                    new StenValue(19,20,8),
                    new StenValue(21,22,9),
                    new StenValue(23,26,10),
                };

                public List<StenValue> E { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,6,3),
                    new StenValue(7,8,4),
                    new StenValue(9,10,5),
                    new StenValue(11,12,6),
                    new StenValue(13,14,7),
                    new StenValue(15,16,8),
                    new StenValue(17,18,9),
                    new StenValue(19,26,10),
                };

                public List<StenValue> F { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,5,1),
                    new StenValue(6,7,2),
                    new StenValue(8,10,3),
                    new StenValue(11,12,4),
                    new StenValue(13,15,5),
                    new StenValue(16,17,6),
                    new StenValue(18,19,7),
                    new StenValue(20,21,8),
                    new StenValue(22,22,9),
                    new StenValue(23,26,10),
                };

                public List<StenValue> G { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,4,1),
                    new StenValue(5,6,2),
                    new StenValue(7,8,3),
                    new StenValue(9,10,4),
                    new StenValue(11,12,5),
                    new StenValue(13,13,6),
                    new StenValue(14,15,7),
                    new StenValue(16,17,8),
                    new StenValue(18,18,9),
                    new StenValue(19,20,10),
                };

                public List<StenValue> H { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,2,1),
                    new StenValue(3,4,2),
                    new StenValue(5,7,3),
                    new StenValue(8,9,4),
                    new StenValue(10,12,5),
                    new StenValue(13,15,6),
                    new StenValue(16,17,7),
                    new StenValue(18,20,8),
                    new StenValue(21,22,9),
                    new StenValue(23,26,10),
                };

                public List<StenValue> I { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,5,1),
                    new StenValue(6,6,2),
                    new StenValue(7,8,3),
                    new StenValue(9,10,4),
                    new StenValue(11,12,5),
                    new StenValue(13,13,6),
                    new StenValue(14,14,7),
                    new StenValue(15,15,8),
                    new StenValue(16,17,9),
                    new StenValue(18,20,10),
                };

                public List<StenValue> L { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,1,1),
                    new StenValue(2,3,2),
                    new StenValue(4,4,3),
                    new StenValue(5,5,4),
                    new StenValue(6,7,5),
                    new StenValue(8,9,6),
                    new StenValue(10,10,7),
                    new StenValue(11,12,8),
                    new StenValue(13,14,9),
                    new StenValue(15,20,10),
                };

                public List<StenValue> M { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,5,1),
                    new StenValue(6,7,2),
                    new StenValue(8,8,3),
                    new StenValue(9,10,4),
                    new StenValue(11,12,5),
                    new StenValue(13,14,6),
                    new StenValue(15,16,7),
                    new StenValue(17,17,8),
                    new StenValue(18,19,9),
                    new StenValue(20,26,10),
                };

                public List<StenValue> N { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,5,1),
                    new StenValue(6,6,2),
                    new StenValue(7,7,3),
                    new StenValue(8,8,4),
                    new StenValue(9,10,5),
                    new StenValue(11,11,6),
                    new StenValue(12,13,7),
                    new StenValue(14,14,8),
                    new StenValue(15,16,9),
                    new StenValue(17,20,10),
                };

                public List<StenValue> O { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,6,3),
                    new StenValue(7,7,4),
                    new StenValue(8,9,5),
                    new StenValue(10,12,6),
                    new StenValue(13,14,7),
                    new StenValue(15,16,8),
                    new StenValue(17,18,9),
                    new StenValue(19,26,10),
                };

                public List<StenValue> Q1 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,5,3),
                    new StenValue(6,7,4),
                    new StenValue(8,8,5),
                    new StenValue(9,9,6),
                    new StenValue(10,11,7),
                    new StenValue(12,13,8),
                    new StenValue(14,14,9),
                    new StenValue(15,20,10),
                };

                public List<StenValue> Q2 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,6,3),
                    new StenValue(7,7,4),
                    new StenValue(8,9,5),
                    new StenValue(10,11,6),
                    new StenValue(12,13,7),
                    new StenValue(14,15,8),
                    new StenValue(16,17,9),
                    new StenValue(18,20,10),
                };

                public List<StenValue> Q3 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,4,1),
                    new StenValue(5,5,2),
                    new StenValue(6,7,3),
                    new StenValue(8,9,4),
                    new StenValue(10,10,5),
                    new StenValue(11,12,6),
                    new StenValue(13,13,7),
                    new StenValue(14,14,8),
                    new StenValue(15,16,9),
                    new StenValue(17,20,10),
                };

                public List<StenValue> Q4 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,5,2),
                    new StenValue(6,7,3),
                    new StenValue(8,10,4),
                    new StenValue(11,12,5),
                    new StenValue(13,15,6),
                    new StenValue(16,18,7),
                    new StenValue(19,20,8),
                    new StenValue(21,22,9),
                    new StenValue(23,26,10),
                };
            }

            public class Womens_29_70_Years : IStenValues
            {
                public List<StenValue> A { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,4,1),
                    new StenValue(5,6,2),
                    new StenValue(7,8,3),
                    new StenValue(9,10,4),
                    new StenValue(11,11,5),
                    new StenValue(12,13,6),
                    new StenValue(14,15,7),
                    new StenValue(16,16,8),
                    new StenValue(17,18,9),
                    new StenValue(19,20,10),
                };

                public List<StenValue> B { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,1,1),
                    new StenValue(2,2,2),
                    new StenValue(3,3,3),
                    new StenValue(4,4,4),
                    new StenValue(5,5,5),
                    new StenValue(6,6,6),
                    new StenValue(7,7,7),
                    new StenValue(8,9,8),
                    new StenValue(10,10,9),
                    new StenValue(11,13,10),
                };

                public List<StenValue> C { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,7,1),
                    new StenValue(8,9,2),
                    new StenValue(10,11,3),
                    new StenValue(12,13,4),
                    new StenValue(14,15,5),
                    new StenValue(16,17,6),
                    new StenValue(18,20,7),
                    new StenValue(21,22,8),
                    new StenValue(23,24,9),
                    new StenValue(25,26,10),
                };

                public List<StenValue> E { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,2,1),
                    new StenValue(3,3,2),
                    new StenValue(4,5,3),
                    new StenValue(6,7,4),
                    new StenValue(8,9,5),
                    new StenValue(10,11,6),
                    new StenValue(12,14,7),
                    new StenValue(15,16,8),
                    new StenValue(17,18,9),
                    new StenValue(19,26,10),
                };

                public List<StenValue> F { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,4,1),
                    new StenValue(5,6,2),
                    new StenValue(7,8,3),
                    new StenValue(9,10,4),
                    new StenValue(11,13,5),
                    new StenValue(14,15,6),
                    new StenValue(16,17,7),
                    new StenValue(18,19,8),
                    new StenValue(20,21,9),
                    new StenValue(22,26,10),
                };

                public List<StenValue> G { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,6,1),
                    new StenValue(7,7,2),
                    new StenValue(8,9,3),
                    new StenValue(10,11,4),
                    new StenValue(12,13,5),
                    new StenValue(14,15,6),
                    new StenValue(16,16,7),
                    new StenValue(17,17,8),
                    new StenValue(18,19,9),
                    new StenValue(20,20,10),
                };

                public List<StenValue> H { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,2,1),
                    new StenValue(3,4,2),
                    new StenValue(5,7,3),
                    new StenValue(8,9,4),
                    new StenValue(10,12,5),
                    new StenValue(13,14,6),
                    new StenValue(15,17,7),
                    new StenValue(18,20,8),
                    new StenValue(21,22,9),
                    new StenValue(23,26,10),
                };

                public List<StenValue> I { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,5,1),
                    new StenValue(6,7,2),
                    new StenValue(8,8,3),
                    new StenValue(9,10,4),
                    new StenValue(11,11,5),
                    new StenValue(12,13,6),
                    new StenValue(14,14,7),
                    new StenValue(15,16,8),
                    new StenValue(17,17,9),
                    new StenValue(18,20,10),
                };

                public List<StenValue> L { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,1,1),
                    new StenValue(2,2,2),
                    new StenValue(3,4,3),
                    new StenValue(5,5,4),
                    new StenValue(6,7,5),
                    new StenValue(8,8,6),
                    new StenValue(9,10,7),
                    new StenValue(11,11,8),
                    new StenValue(12,13,9),
                    new StenValue(14,20,10),
                };

                public List<StenValue> M { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,6,1),
                    new StenValue(7,7,2),
                    new StenValue(8,9,3),
                    new StenValue(10,11,4),
                    new StenValue(12,12,5),
                    new StenValue(13,14,6),
                    new StenValue(15,16,7),
                    new StenValue(17,17,8),
                    new StenValue(18,19,9),
                    new StenValue(20,26,10),
                };

                public List<StenValue> N { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,5,1),
                    new StenValue(6,6,2),
                    new StenValue(7,7,3),
                    new StenValue(8,9,4),
                    new StenValue(10,10,5),
                    new StenValue(11,11,6),
                    new StenValue(12,13,7),
                    new StenValue(14,14,8),
                    new StenValue(15,15,9),
                    new StenValue(16,20,10),
                };

                public List<StenValue> O { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,6,3),
                    new StenValue(7,8,4),
                    new StenValue(9,10,5),
                    new StenValue(11,12,6),
                    new StenValue(13,14,7),
                    new StenValue(15,16,8),
                    new StenValue(17,18,9),
                    new StenValue(19,26,10),
                };

                public List<StenValue> Q1 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,5,3),
                    new StenValue(6,7,4),
                    new StenValue(8,8,5),
                    new StenValue(9,9,6),
                    new StenValue(10,11,7),
                    new StenValue(12,13,8),
                    new StenValue(14,14,9),
                    new StenValue(15,20,10),
                };

                public List<StenValue> Q2 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,3,1),
                    new StenValue(4,4,2),
                    new StenValue(5,6,3),
                    new StenValue(7,8,4),
                    new StenValue(9,9,5),
                    new StenValue(10,11,6),
                    new StenValue(12,13,7),
                    new StenValue(14,15,8),
                    new StenValue(16,17,9),
                    new StenValue(18,20,10),
                };

                public List<StenValue> Q3 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,5,1),
                    new StenValue(6,7,2),
                    new StenValue(8,8,3),
                    new StenValue(9,10,4),
                    new StenValue(11,11,5),
                    new StenValue(12,13,6),
                    new StenValue(14,14,7),
                    new StenValue(15,16,8),
                    new StenValue(17,17,9),
                    new StenValue(18,20,10),
                };

                public List<StenValue> Q4 { get; set; } = new List<StenValue>()
                {
                    new StenValue(0,2,1),
                    new StenValue(3,4,2),
                    new StenValue(5,7,3),
                    new StenValue(8,10,4),
                    new StenValue(11,12,5),
                    new StenValue(13,15,6),
                    new StenValue(16,17,7),
                    new StenValue(18,20,8),
                    new StenValue(21,22,9),
                    new StenValue(23,26,10),
                };
            }
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var genderAnswer = questionnaire.Questions[0].Answers.FirstOrDefault(f => f.IsSelected);
            var gender = questionnaire.Questions[0].Answers.IndexOf(genderAnswer);

            var agesAnswer = questionnaire.Questions[1].Answers.FirstOrDefault(f => f.IsSelected);
            var ages = questionnaire.Questions[1].Answers.IndexOf(agesAnswer);

            //удаляем первые два вопроса
            questionnaire.Questions.RemoveAt(0);
            questionnaire.Questions.RemoveAt(0);

            var NumberQuestion_NumberAnswer = new Dictionary<int, int>();

            foreach (var question in questionnaire.Questions)
            {
                var numberQuestion = questionnaire.Questions.IndexOf(question) + 1;
                var numberAnswer = question.Answers.IndexOf(question.Answers.FirstOrDefault(f => f.IsSelected));
                NumberQuestion_NumberAnswer.Add(numberQuestion, numberAnswer);
            }

            int A, B, C, E, F, G, H, I, L, M, N, O, Q1, Q2, Q3, Q4;
            A = GetRawPointsFromScale(ScoresKeys.A, NumberQuestion_NumberAnswer);
            B = GetRawPointsFromScale(ScoresKeys.B, NumberQuestion_NumberAnswer);
            C = GetRawPointsFromScale(ScoresKeys.C, NumberQuestion_NumberAnswer);
            E = GetRawPointsFromScale(ScoresKeys.E, NumberQuestion_NumberAnswer);
            F = GetRawPointsFromScale(ScoresKeys.F, NumberQuestion_NumberAnswer);
            G = GetRawPointsFromScale(ScoresKeys.G, NumberQuestion_NumberAnswer);
            H = GetRawPointsFromScale(ScoresKeys.H, NumberQuestion_NumberAnswer);
            I = GetRawPointsFromScale(ScoresKeys.I, NumberQuestion_NumberAnswer);
            L = GetRawPointsFromScale(ScoresKeys.L, NumberQuestion_NumberAnswer);
            M = GetRawPointsFromScale(ScoresKeys.M, NumberQuestion_NumberAnswer);
            N = GetRawPointsFromScale(ScoresKeys.N, NumberQuestion_NumberAnswer);
            O = GetRawPointsFromScale(ScoresKeys.O, NumberQuestion_NumberAnswer);
            Q1 = GetRawPointsFromScale(ScoresKeys.Q1, NumberQuestion_NumberAnswer);
            Q2 = GetRawPointsFromScale(ScoresKeys.Q2, NumberQuestion_NumberAnswer);
            Q3 = GetRawPointsFromScale(ScoresKeys.Q3, NumberQuestion_NumberAnswer);
            Q4 = GetRawPointsFromScale(ScoresKeys.Q4, NumberQuestion_NumberAnswer);

            int A_Stens, B_Stens, C_Stens, E_Stens, F_Stens, G_Stens, H_Stens, I_Stens, L_Stens, M_Stens, N_Stens, O_Stens, Q1_Stens, Q2_Stens, Q3_Stens, Q4_Stens;
            IStenValues stenTable;
            if (gender == 0)
            {
                if (ages == 0)
                    stenTable = new StensKeys.Mens_19_28_Years();
                else stenTable = new StensKeys.Mens_29_70_Years();
            }
            else
            {
                if (ages == 0)
                    stenTable = new StensKeys.Womens_19_28_Years();
                else stenTable = new StensKeys.Womens_29_70_Years();
            }

            A_Stens = GetStensFromRawPoints(A, stenTable.A);
            B_Stens = GetStensFromRawPoints(B, stenTable.B);
            C_Stens = GetStensFromRawPoints(C, stenTable.C);
            E_Stens = GetStensFromRawPoints(E, stenTable.E);
            F_Stens = GetStensFromRawPoints(F, stenTable.F);
            G_Stens = GetStensFromRawPoints(G, stenTable.G);
            H_Stens = GetStensFromRawPoints(H, stenTable.H);
            I_Stens = GetStensFromRawPoints(I, stenTable.I);
            L_Stens = GetStensFromRawPoints(L, stenTable.L);
            M_Stens = GetStensFromRawPoints(M, stenTable.M);
            N_Stens = GetStensFromRawPoints(N, stenTable.N);
            O_Stens = GetStensFromRawPoints(O, stenTable.O);
            Q1_Stens = GetStensFromRawPoints(Q1, stenTable.Q1);
            Q2_Stens = GetStensFromRawPoints(Q2, stenTable.Q2);
            Q3_Stens = GetStensFromRawPoints(Q3, stenTable.Q3);
            Q4_Stens = GetStensFromRawPoints(Q4, stenTable.Q4);

            Dictionary<string, int> StensValues = new Dictionary<string, int>()
            {
                ["A"] = A_Stens,
                ["B"] = B_Stens,
                ["C"] = C_Stens,
                ["E"] = E_Stens,
                ["F"] = F_Stens,
                ["G"] = G_Stens,
                ["H"] = H_Stens,
                ["I"] = I_Stens,
                ["L"] = L_Stens,
                ["M"] = M_Stens,
                ["N"] = N_Stens,
                ["O"] = O_Stens,
                ["Q1"] = Q1_Stens,
                ["Q2"] = Q2_Stens,
                ["Q3"] = Q3_Stens,
                ["Q4"] = Q4_Stens,
            };

            var high = GetHigh(StensValues);
            var low = GetLow(StensValues);
            var scores = new int[] { A, B, C, E, F, G, H, I, L, M, N, O, Q1, Q2, Q3, Q4 };
            var stens = new int[] { A_Stens, B_Stens, C_Stens, E_Stens, F_Stens, G_Stens, H_Stens, I_Stens, L_Stens, M_Stens, N_Stens, O_Stens, Q1_Stens, Q2_Stens, Q3_Stens, Q4_Stens };

            #region Это сделано дабы не менять отчеты

            for (int i = 0; i < scores.Length; i++)
                scores[i] = 100 * i + scores[i];

            for (int i = 0; i < stens.Length; i++)
                stens[i] = 100 * i + stens[i];

            #endregion

            var results = new TestResults(TestType.Тест_Кетелла);
            results.AddValue(new TestResultValue(ScaleKeys.Баллы, scores));
            results.AddValue(new TestResultValue(ScaleKeys.Стены, stens));
            results.AddValue(new TestResultValue(ScaleKeys.Высокие, high));
            results.AddValue(new TestResultValue(ScaleKeys.Низкие, low));

            return results;
        }

        private string GetHigh(Dictionary<string, int> stenValues)
        {
            string result = "";

            foreach (var pair in stenValues)
            {
                if (pair.Value >= 7)
                    result = result + pair.Key + " ";
            }

            if (result == "")
                result = "-/-";
            return result;
        }

        private string GetLow(Dictionary<string, int> stenValues)
        {
            string result = "";

            foreach (var pair in stenValues)
            {
                if (pair.Value <= 4)
                    result = result + pair.Key + " ";
            }

            if (result == "")
                result = "-/-";
            return result;
        }

        private int GetStensFromRawPoints(int raw, List<StenValue> stenValues)
        {
            int result = 0;
            //var sten = stenValues.FirstOrDefault(first => first.From == stenValues.Where(f => f.To <= raw).Max(m => m.From));
            var sten = stenValues.FirstOrDefault(first => first.From <= raw && first.To >= raw);
            if (sten != null)
                result = sten.StenValues;
            return result;
        }

        private int GetRawPointsFromScale(List<ScaleValue> scaleValues, Dictionary<int, int> answers)
        {
            int result = 0;
            foreach (var value in scaleValues)
            {
                var numberAnswer = answers.FirstOrDefault(f => f.Key == value.Key).Value;
                var points = value.PointsForAnswers[numberAnswer];
                result = result + points;
            }

            return result;
        }

        public class StenValue
        {
            public int From { get; private set; }

            public int To { get; private set; }

            public int StenValues { get; private set; }

            public StenValue(int from, int to, int stenValues)
            {
                From = from;
                To = to;
                StenValues = stenValues;
            }
        }

        public class ScaleValue
        {
            public int Key { get; private set; }
            public int[] PointsForAnswers { get; private set; }
            public ScaleValue(int key, params int[] pointsForAnswers)
            {
                Key = key;
                PointsForAnswers = pointsForAnswers;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Тест_Лири.cs


namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Тест_Лири : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Factor1 = "Фактор \"Авторитарный\"";
            public static readonly string Factor2 = "Фактор \"Независимо - доминирующий\"";
            public static readonly string Factor3 = "Фактор \"Агрессивный\"";
            public static readonly string Factor4 = "Фактор \"Недоверчивый - скептический\"";
            public static readonly string Factor5 = "Фактор \"Покорно - застенчивый\"";
            public static readonly string Factor6 = "Фактор \"Зависимый\"";
            public static readonly string Factor7 = "Фактор \"Сотрудничающий\"";
            public static readonly string Factor8 = "Фактор \"Альтруистический\"";
        }

        private const int Yes = 1;
        private const int No = 2;

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Тест_Лири);
            results.AddValue(new TestResultValue(ScaleKeys.Factor1, 0)
             .Add(questionnaire, Yes, 1, 2, 3, 4, 33, 34, 35, 36, 65, 66, 67, 97, 98, 99, 100));
            results.AddValue(new TestResultValue(ScaleKeys.Factor2, 0)
             .Add(questionnaire, Yes, 5, 6, 7, 8, 37, 38, 39, 40, 69, 70, 71, 72, 101, 102, 103, 104));
            results.AddValue(new TestResultValue(ScaleKeys.Factor3, 0)
             .Add(questionnaire, Yes, 9, 10, 11, 12, 41, 42, 43, 44, 73, 74, 75, 76, 105, 106, 107, 108));
            results.AddValue(new TestResultValue(ScaleKeys.Factor4, 0)
             .Add(questionnaire, Yes, 13, 14, 15, 16, 45, 46, 47, 48, 77, 78, 79, 80, 109, 110, 111, 112));
            results.AddValue(new TestResultValue(ScaleKeys.Factor5, 0)
            .Add(questionnaire, Yes, 17, 18, 19, 20, 49, 50, 51, 52, 81, 82, 83, 84, 113, 114, 115, 116));
            results.AddValue(new TestResultValue(ScaleKeys.Factor6, 0)
            .Add(questionnaire, Yes, 21, 22, 23, 24, 53, 54, 55, 56, 85, 86, 87, 88, 117, 118, 119, 120));
            results.AddValue(new TestResultValue(ScaleKeys.Factor7, 0)
            .Add(questionnaire, Yes, 25, 26, 27, 28, 57, 58, 59, 60, 89, 90, 91, 92, 121, 122, 123, 124));
            results.AddValue(new TestResultValue(ScaleKeys.Factor8, 0)
           .Add(questionnaire, Yes, 29, 30, 31, 32, 61, 62, 63, 64, 93, 94, 95, 96, 125, 126, 127, 128));
            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Тест_Люшера.cs


using System;
using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Тест_Люшера : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Select1 = "Первый выбор";
            public static readonly string Intensity1 = "Интенсивность тревоги в первом выборе";
            public static readonly string Select2 = "Второй выбор";
            public static readonly string Intensity2 = "Интенсивность тревоги во втором выборе";
            public static readonly string Pairs = "Пары";
            public static readonly string Coefficient = "Коэффициент вегетативного баланса";
            public static readonly string Index = "Индекс суммарного отклонения";
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Тест_Люшера);

            var FChoise1 = GetSelectColors(questionnaire.Questions[0]);
            var FChoise2 = GetSelectColors(questionnaire.Questions[1]);
            var FAnxiety1 = CountAnxiety(FChoise1);
            var FAnxiety2 = CountAnxiety(FChoise2);
            var FPairs = ProcessPairs(FChoise1, FChoise2);
            var vegBalans = VegBalans(FChoise2);
            var sumOtkl = SumOtkl(FChoise2);

            results.AddValue(new TestResultValue(ScaleKeys.Select1, FChoise1));
            results.AddValue(new TestResultValue(ScaleKeys.Intensity1, FAnxiety1));
            results.AddValue(new TestResultValue(ScaleKeys.Select2, FChoise2));
            results.AddValue(new TestResultValue(ScaleKeys.Intensity2, FAnxiety2));
            results.AddValue(new TestResultValue(ScaleKeys.Pairs, FPairs));
            results.AddValue(new TestResultValue(ScaleKeys.Coefficient, vegBalans));
            results.AddValue(new TestResultValue(ScaleKeys.Index, sumOtkl));
            return results;
        }

        private string GetSelectColors(Question question)
        {
           var rawRes = question.Answers.Cast<Lusher.Data.LusherAnswer>().OrderBy(o => o.SelectNumber).Select(s => s.ColorNumber).ToArray();
            string result = "";
            for (int i = 0; i < rawRes.Length; i++)
                result += rawRes[i];
            return result;
        }

        private float VegBalans(string FChoise2)
        {
            int i, c;
            int[] p = new int[] { 1, 2, 3, 4 };
            for (i = 0; i < FChoise2.Length; i++)
            {
                c = int.Parse(FChoise2[i].ToString());
                if (c < 5 && c > 0)
                    p[c - 1] = i + 1;
            }

            return (float)Math.Round((float)((18.0 - p[2] - p[3]) / (18.0 - p[0] - p[1])),2);
        }

        private int SumOtkl(string FChoise2)
        {
            int[] std = new int[] { 7, 5, 3, 1, 2, 4, 6, 8 };
            int i, c, sum=0;
            for (i = 0; i < FChoise2.Length; i++)
            {
                c = int.Parse(FChoise2[i].ToString());
                sum = sum + Math.Abs(i + 1 - std[c]);
            }
            return sum;
        }

        private int CountAnxiety(string s)
        {
            int i;
            int Anxiety = 0;

            for (i = 5; i <= 7; i++)
            {
                if ((int.Parse(s[i].ToString()) < 5) && (int.Parse(s[i].ToString()) > 0))
                {
                    Anxiety += (i + 1 - 5);
                }
            }

            for (i = 2; i >= 0; i--)
            {
                if ((int.Parse(s[i].ToString()) == 0) || (int.Parse(s[i].ToString()) > 5))
                {
                    Anxiety += (4 - i - 1);
                }
            }

            return Anxiety;
        }

        private string ProcessPairs(string s1, string s2)
        {
            int i, j;
            var List1 = new List<Pair>();
            var List2 = new List<Pair>();
            var PairsList = new List<Pair>();
            int Sign = -1;
            int LastPairNumber = 0;
            string PairsString = "";
            char[] SignChar = new char[] { '+', 'x', '=', '-' };

            for (i = -1; i < 6; i++)
            {
                List1.Add(new Pair(s1[i + 1].ToString(), s1[i + 2].ToString()));
                List2.Add(new Pair(s2[i + 1].ToString(), s2[i + 2].ToString()));
            }

            for (i = 0; i < 7; i++)
                for (j = 0; j < 7; j++)
                {
                    if (((List1[i].a == List2[j].a) && (List1[i].b == List2[j].b)) || ((List1[i].b == List2[j].a) && (List1[i].a == List2[j].b)))
                        PairsList.Add(List2[j]);
                }

            for (i = 0; i < 7; i++)
            {
                for (j = 0; j < PairsList.Count; j++)
                {
                    if ((s2[i].ToString() == PairsList[j].a) && (s2[i + 1].ToString() == PairsList[j].b))
                    {
                        if (Sign < 2)
                            Sign++;
                        if (i == 6)
                            Sign = 3;
                        PairsString = PairsString + "(" + SignChar[Sign] + s2[i] + ";" + SignChar[Sign] + s2[i + 1] + ") ";
                        LastPairNumber = i + 2;
                        goto PairFound;
                    }
                }

                if (LastPairNumber != i + 1)
                {
                    if (Sign < 2)
                        Sign++;
                    if (i == 7)
                        Sign = 3;
                    PairsString = PairsString + "(" + SignChar[Sign] + s2[i] + ") ";
                    LastPairNumber = i;

                }

            PairFound:;
            }

            if (LastPairNumber != 8)
            {
                Sign = 3;
                PairsString = PairsString + "(" + SignChar[Sign] + s2[7] + ") ";
            }

            for (i = 5; i < 8; i++)
            {
                if ((int.Parse(s2[i].ToString()) < 5) && (int.Parse(s2[i].ToString()) > 0))
                {
                    PairsString = PairsString + "(+" + s2[0] + ";-" + s2[7] + ")";
                    break;
                }
            }

            return PairsString;

        }

        private class Pair
        {
            public string a { get; set; }
            public string b { get; set; }
            public Pair(string a, string b)
            {
                this.a = a;
                this.b = b;
            }
        }

    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Тест_словесных_ассоциации.cs

using Updk7.Tests;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Тест_словесных_ассоциации : IQuestionnaireKeys
    {
        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            throw new NotImplementedException();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Тест_Спилбергера.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Updk7.Tests;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Тест_Спилбергера : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string СитуативнаяТревожность = "Ситуативная тревожность";
            public static readonly string ЛичностнаяТревожность = "Личностная тревожность";
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Тест_Спилберга);

            //Получаем значения ответов
            var answerValues = new List<int>();

            foreach (var question in questionnaire.Questions)
            {
                var answer = question.Answers.FirstOrDefault(f => f.IsSelected);
                var value = question.Answers.IndexOf(answer) + 1;
                answerValues.Add(value);
            }

            //Расчет показателя Ситуативной Тревожности
            int[] questionsNumbers1 = new int[] { 3, 4, 6, 7, 9, 12, 13, 14, 17, 18 };
            int[] questionsNumbers2 = new int[] { 1, 2, 5, 8, 10, 11, 15, 16, 19, 20 };
            var questionsSum1 = Sum(questionsNumbers1, answerValues);
            var questionsSum2 = Sum(questionsNumbers2, answerValues);
            //ST - Ситуативная тревожность
            var ST = questionsSum1 - questionsSum2 + 50;
            results.AddValue(new TestResultValue(ScaleKeys.СитуативнаяТревожность, ST));


            //Расчет показателя Личностной тревожности
            int[] questionsNumbers3 = new int[] { 22, 23, 24, 25, 28, 29, 31, 32, 34, 35, 37, 38, 40 };
            int[] questionsNumbers4 = new int[] { 21, 26, 27, 30, 33, 36, 39 };

            var questionsSum3 = Sum(questionsNumbers3, answerValues);
            var questionsSum4 = Sum(questionsNumbers4, answerValues);
            //LT - Личностная тревожность
            var LT = questionsSum3 - questionsSum4 + 35;
            results.AddValue(new TestResultValue(ScaleKeys.ЛичностнаяТревожность, LT));

            return results;
        }

        private static int Sum(int[] questionsNumbers, List<int> answerValues)
        {
            var sum = 0;
            for (int i = 0; i < questionsNumbers.Length; i++)
            {
                var index = questionsNumbers[i];
                sum = sum + answerValues[index - 1];
            }
            return sum;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Тест_Томаса.cs


using Updk7.Tests;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Тест_Томаса : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Rivalry = "Соперничество";
            public static readonly string Cooperation = "Сотрудничество";
            public static readonly string Compromise = "Компромисс";
            public static readonly string Avoidance = "Избегание";
            public static readonly string Adaptation = "Приспособление";
        }

        private const int A = 1;
        private const int B = 2;

        public Тест_Томаса()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Тест_Томаса_Конфликтность);

            results.AddValue(new TestResultValue(ScaleKeys.Rivalry, 0)
                .Add(questionnaire, A, 3, 8, 10, 17, 25, 28)
                .Add(questionnaire, B, 6, 9, 13, 14, 16, 22));

            results.AddValue(new TestResultValue(ScaleKeys.Cooperation, 0)
                .Add(questionnaire, A, 5, 11, 14, 19, 20)
                .Add(questionnaire, B, 2, 8, 21, 26, 28, 30));

            results.AddValue(new TestResultValue(ScaleKeys.Compromise, 0)
                .Add(questionnaire, A, 2, 4, 13, 22, 23, 26, 29)
                .Add(questionnaire, B, 7, 10, 12, 18, 24));

            results.AddValue(new TestResultValue(ScaleKeys.Avoidance, 0)
                .Add(questionnaire, A, 1, 6, 7, 9, 12, 27)
                .Add(questionnaire, B, 5, 15, 17, 19, 20, 29));

            results.AddValue(new TestResultValue(ScaleKeys.Adaptation, 0)
                .Add(questionnaire, A, 15, 16, 18, 21, 24, 30)
                .Add(questionnaire, B, 1, 3, 4, 11, 25, 27));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Уровень_субъективного_контроля.cs


using System;
using System.Linq;
using System.Collections.Generic;
using Updk7.Tests;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Уровень_субъективного_контроля : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string General_internality_Stens = "Общая интернальность";
            public static readonly string Internality_in_arhievement_field_Stens = "Интернальность в области достижений";
            public static readonly string Internality_in_a_situation_of_failure_Stens = "Интернальность в ситуации неудачи";
            public static readonly string Internality_in_family_relations_Stens = "Интернальность в семейных отношениях";
            public static readonly string Internality_in_industrial_relations_Stens = "Интернальность в области производственных отношений";
            public static readonly string Internality_in_interpersonal_relations_Stens = "Интернальность в межличностных отношениях";
            public static readonly string Health_internality_Stens = "Интернальность в отношении здоровья";
            public static readonly string Self_reflection = "Саморефлексия";
        }

        public Уровень_субъективного_контроля()
        {
        }

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Тест_Уровень_субъективного_контроля_УСК);

            var GI = GetPoints(questionnaire, GeneralScalePoints);
            results.AddValue(new TestResultValue(ScaleKeys.General_internality_Stens, GetStens(GI, GeneralScaleStensPoints)));

            var AF = GetPoints(questionnaire, InArhievementFieldsScalePoints);
            results.AddValue(new TestResultValue(ScaleKeys.Internality_in_arhievement_field_Stens, GetStens(AF, InArhievementFieldsScaleStensPoints)));

            var SF = GetPoints(questionnaire, InSituationOfFailureScalePoints);
            results.AddValue(new TestResultValue(ScaleKeys.Internality_in_a_situation_of_failure_Stens, GetStens(SF, InSituationOfFailureScaleStensPoints)));

            var FR = GetPoints(questionnaire, InFamilyRelationsScalePoints);
            results.AddValue(new TestResultValue(ScaleKeys.Internality_in_family_relations_Stens, GetStens(FR, InFamilyRelationsScaleStensPoints)));

            var IR = GetPoints(questionnaire, InIndustrialRelationsScalePoints);
            results.AddValue(new TestResultValue(ScaleKeys.Internality_in_industrial_relations_Stens, GetStens(IR, InIndustrialRelationsScaleStensPoints)));

            var IIR = GetPoints(questionnaire, InInterpertonalRelationsScalePoints);
            results.AddValue(new TestResultValue(ScaleKeys.Internality_in_interpersonal_relations_Stens, GetStens(IIR, InInterpertonalRelationsScaleStensPoints)));

            var HI = GetPoints(questionnaire, HealthInternalityScalePoints);
            results.AddValue(new TestResultValue(ScaleKeys.Health_internality_Stens, GetStens(HI, HealthInternalityScaleStensPoints)));

            var SR = GetNumbersSelfReflection(questionnaire);
            results.AddValue(new TestResultValue(ScaleKeys.Self_reflection, SR));
            return results;
        }

        private static readonly Dictionary<int, int[]> GeneralScalePoints = new Dictionary<int, int[]>()
        {
            [1] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [2] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [3] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [4] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [5] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [6] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [7] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [8] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [9] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [10] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [11] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [12] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [13] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [14] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [15] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [16] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [17] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [18] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [19] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [20] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [21] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [22] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [23] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [24] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [25] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [26] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [27] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [28] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [29] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [30] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [31] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [32] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [33] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [34] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [35] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [36] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [37] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [38] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [39] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [40] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [41] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [42] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [43] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [44] = new int[] { +3, +2, +1, 0, -1, -2, -3 }
        };

        private static readonly Dictionary<int, int[]> InArhievementFieldsScalePoints = new Dictionary<int, int[]>()
        {
            [1] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [5] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [6] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [12] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [14] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [15] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [26] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [27] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [32] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [36] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [37] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [43] = new int[] { -3, -2, -1, 0, +1, +2, +3 }
        };

        private static readonly Dictionary<int, int[]> InSituationOfFailureScalePoints = new Dictionary<int, int[]>()
        {
            [2] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [4] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [7] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [20] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [24] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [31] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [33] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [38] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [40] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [41] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [42] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [44] = new int[] { +3, +2, +1, 0, -1, -2, -3 }
        };

        private static readonly Dictionary<int, int[]> InFamilyRelationsScalePoints = new Dictionary<int, int[]>()
        {
            [2] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [7] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [14] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [16] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [20] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [26] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [28] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [32] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [37] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [41] = new int[] { -3, -2, -1, 0, +1, +2, +3 }
        };

        private static readonly Dictionary<int, int[]> InIndustrialRelationsScalePoints = new Dictionary<int, int[]>()
        {
            [1] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [9] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [10] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [19] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [22] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [24] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [25] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [30] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [34] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [42] = new int[] { +3, +2, +1, 0, -1, -2, -3 }
        };

        private static readonly Dictionary<int, int[]> InInterpertonalRelationsScalePoints = new Dictionary<int, int[]>()
        {
            [4] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [6] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [27] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [38] = new int[] { -3, -2, -1, 0, +1, +2, +3 }
        };

        private static readonly Dictionary<int, int[]> HealthInternalityScalePoints = new Dictionary<int, int[]>()
        {
            [3] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [13] = new int[] { +3, +2, +1, 0, -1, -2, -3 },
            [23] = new int[] { -3, -2, -1, 0, +1, +2, +3 },
            [34] = new int[] { +3, +2, +1, 0, -1, -2, -3 }
        };

        private int GetPoints(Questionnaire questionnaire, Dictionary<int, int[]> scalePoints)
        {
            int result = 0;

            foreach (var pair in scalePoints)
            {
                var question = questionnaire.Questions[pair.Key - 1];
                var indexAnswer = question.Answers.IndexOf(question.Answers.FirstOrDefault(f => f.IsSelected));
                result += scalePoints[pair.Key][indexAnswer];
            }
            return result;
        }

        private static readonly Dictionary<int, int[]> GeneralScaleStensPoints = new Dictionary<int, int[]>()
        {
            [1] = new int[] { -132, -14 },
            [2] = new int[] { -13, -3 },
            [3] = new int[] { -2, 0 },
            [4] = new int[] { 10, 21 },
            [5] = new int[] { 22, 32 },
            [6] = new int[] { 33, 44 },
            [7] = new int[] { 45, 56 },
            [8] = new int[] { 57, 68 },
            [9] = new int[] { 69, 79 },
            [10] = new int[] { 80, 132 },
        };

        private static readonly Dictionary<int, int[]> InArhievementFieldsScaleStensPoints = new Dictionary<int, int[]>()
        {
            [1] = new int[] { -36, -11 },
            [2] = new int[] { -10, -7 },
            [3] = new int[] { -6, -3 },
            [4] = new int[] { -2, 1 },
            [5] = new int[] { 2, 5 },
            [6] = new int[] { 6, 9 },
            [7] = new int[] { 10, 14 },
            [8] = new int[] { 15, 18 },
            [9] = new int[] { 19, 22 },
            [10] = new int[] { 23, 36 }
        };

        private static readonly Dictionary<int, int[]> InSituationOfFailureScaleStensPoints = new Dictionary<int, int[]>()
        {
            [1] = new int[] { -36, -8 },
            [2] = new int[] { -7, -4 },
            [3] = new int[] { -3, 0 },
            [4] = new int[] { 1, 4 },
            [5] = new int[] { 5, 7 },
            [6] = new int[] { 8, 11 },
            [7] = new int[] { 12, 15 },
            [8] = new int[] { 16, 19 },
            [9] = new int[] { 20, 23 },
           [10] = new int[] { 24, 36 }

        };

        private static readonly Dictionary<int, int[]> InFamilyRelationsScaleStensPoints = new Dictionary<int, int[]>()
        {
            [1] = new int[] { -30, -12 },
            [2] = new int[] { -11, -8 },
            [3] = new int[] { -7, -5 },
            [4] = new int[] { -4, -1 },
            [5] = new int[] { 0, 3 },
            [6] = new int[] { 4, 6 },
            [7] = new int[] { 7, 10 },
            [8] = new int[] { 11, 13 },
            [9] = new int[] { 14, 17 },
            [10] = new int[] { 18, 30 }
        };

        private static readonly Dictionary<int, int[]> InIndustrialRelationsScaleStensPoints = new Dictionary<int, int[]>()
        {
            [1] = new int[] { -30, -5 },
            [2] = new int[] { -4, -1 },
            [3] = new int[] { 0, 3 },
            [4] = new int[] { 4, 7 },
            [5] = new int[] { 8, 11 },
            [6] = new int[] { 12, 15 },
            [7] = new int[] { 16, 19 },
            [8] = new int[] { 20, 23 },
            [9] = new int[] { 24, 27 },
            [10] = new int[] { 28, 30 }
        };

        private static readonly Dictionary<int, int[]> InInterpertonalRelationsScaleStensPoints = new Dictionary<int, int[]>()
        {
            [1] = new int[] { -12, -7 },
            [2] = new int[] { -6, -5 },
            [3] = new int[] { -4, -3 },
            [4] = new int[] { -2, -1 },
            [5] = new int[] { 0, 1 },
            [6] = new int[] { 2, 4 },
            [7] = new int[] { 5, 6 },
            [8] = new int[] { 7, 8 },
            [9] = new int[] { 9, 10 },
            [10] = new int[] { 11, 12 }
        };

        private static readonly Dictionary<int, int[]> HealthInternalityScaleStensPoints = new Dictionary<int, int[]>()
        {
            [1] = new int[] { -12, -6 },
            [2] = new int[] { -5, -4 },
            [3] = new int[] { -3, -2 },
            [4] = new int[] { -1, 0 },
            [5] = new int[] { 1, 2 },
            [6] = new int[] { 3, 4 },
            [7] = new int[] { 5, 6 },
            [8] = new int[] { 7, 8 },
            [9] = new int[] { 9, 10 },
            [10] = new int[] { 11, 12 }
        };

        private int GetStens(int rawPoints, Dictionary<int, int[]> scaleStensPoints)
        {
            int result = 0;
            foreach (var pair in scaleStensPoints)
            {
                if (rawPoints >= pair.Value[0] && rawPoints <= pair.Value[1])
                {
                    result = pair.Key;
                    break;
                }
            }

            return Math.Max(result - 1, 0);
        }

        private int GetNumbersSelfReflection(Questionnaire questionnaire)
        {
            int result = 0;

            foreach (Question question in questionnaire.Questions)
            {
                var answerSelected = question.Answers.FirstOrDefault(f => f.IsSelected);
                if (question.Answers.IndexOf(answerSelected) == 3)
                    result++;
            }
            return result;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Уровень_тревожности_по_Тейлору.cs

using Updk7.Tests;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Уровень_тревожности_по_Тейлору : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Тревожность = "Степень тревожности";
        }

        private const int Yes = 1;
        private const int No = 2;

        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var results = new TestResults(TestType.Тест_уровня_тревожности_Тейлор);

            results.AddValue(new TestResultValue(ScaleKeys.Тревожность, 0)
               .Add(questionnaire, No, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
               .Add(questionnaire, Yes, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
               27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Ценностные_ориентации_Рокич.cs


using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Ценностные_ориентации_Рокич : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Шкала1 = "Приоритетные терминальные ценности";
            public static readonly string Шкала2 = "Неприоритетные терминальные ценности";
            public static readonly string Шкала3 = "Приоритетные инструментальные ценности";
            public static readonly string Шкала4 = "Неприоритетные инструментальные ценности";
            public static readonly string Таблица1 = "Таблица 1";
            public static readonly string Таблица2 = "Таблица 2";
        }
        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var answers1 = questionnaire.Questions[0].Answers
                .Cast<Rokich.Data.RokichAnswer>()
                .OrderBy(o => o.Rank)
                .Select(s => s.Number)
                .ToList();

            var answers2 = questionnaire.Questions[0].Answers
                .Cast<Rokich.Data.RokichAnswer>()
                .OrderBy(o => o.Rank)
                .Select(s => s.Number)
                .ToList();

            var results = new TestResults(TestType.Ценностные_ориентации_Рокич);
            string scale1 = answers1[0] + " " + answers1[1] + " " + answers1[2];
            string scale2 = answers1[16] + " " + answers1[17];
            string scale3 = answers2[0] + " " + answers2[1] + " " + answers2[2];
            string scale4 = answers2[16] + " " + answers2[17];

            results.AddValue(new TestResultValue(ScaleKeys.Шкала1, scale1));
            results.AddValue(new TestResultValue(ScaleKeys.Шкала2, scale2));
            results.AddValue(new TestResultValue(ScaleKeys.Шкала3, scale3));
            results.AddValue(new TestResultValue(ScaleKeys.Шкала4, scale4));

            results.AddValue(new TestResultValue(ScaleKeys.Таблица1, answers1.ToArray()));
            results.AddValue(new TestResultValue(ScaleKeys.Таблица2, answers2.ToArray()));

            return results;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Data\Keys\Шмишек_Леонгард.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Updk7.Tests;

namespace Updk7.Tests.Wpf.Questionnaires.Data.Keys
{
    public class Шмишек_Леонгард : IQuestionnaireKeys
    {
        public class ScaleKeys
        {
            public static readonly string Type1 = "Демонстративность";
            public static readonly string Type2 = "Застревание";
            public static readonly string Type3 = "Педантичность";
            public static readonly string Type4 = "Возбудимость";
            public static readonly string Type5 = "Гипертимность";
            public static readonly string Type6 = "Дистимность";
            public static readonly string Type7 = "Тревожность";
            public static readonly string Type8 = "Экзальтированность";
            public static readonly string Type9 = "Эмотивность";
            public static readonly string Type10 = "Циклотимность";
            public static readonly string Type11 = "Шкала_лжи";
        }

        private const int Yes = 1;
        private const int No = 2;
        public TestResults CalculateResults(Questionnaire questionnaire)
        {
            var rawResults = new TestResults(TestType.Тип_акцентуации_личности_Шмишека_Леонгарда);

            rawResults.AddValue(new TestResultValue(ScaleKeys.Type5, 0)
               .Add(questionnaire, Yes, 1, 12, 25, 36, 50, 61, 75, 85));

            rawResults.AddValue(new TestResultValue(ScaleKeys.Type9, 0)
              .Add(questionnaire, Yes, 3, 14, 52, 64, 77, 87)
              .Add(questionnaire, No, 28, 39));

            rawResults.AddValue(new TestResultValue(ScaleKeys.Type7, 0)
               .Add(questionnaire, Yes, 17, 30, 42, 54, 67, 79, 91)
               .Add(questionnaire, No, 5));

            rawResults.AddValue(new TestResultValue(ScaleKeys.Type1, 0)
              .Add(questionnaire, Yes, 7, 21, 24, 32, 45, 49, 71, 74, 81, 94, 97)
              .Add(questionnaire, No, 56));

            rawResults.AddValue(new TestResultValue(ScaleKeys.Type6, 0)
              .Add(questionnaire, Yes, 10, 23, 48, 83, 96)
              .Add(questionnaire, No, 34, 58, 73));

            rawResults.AddValue(new TestResultValue(ScaleKeys.Type2, 0)
             .Add(questionnaire, Yes, 2, 16, 26, 38, 41, 62, 76, 86, 90)
             .Add(questionnaire, No, 13, 51, 66));

            rawResults.AddValue(new TestResultValue(ScaleKeys.Type3, 0)
            .Add(questionnaire, Yes, 4, 15, 19, 29, 43, 53, 65, 69, 78, 89, 92)
            .Add(questionnaire, No, 40));

            rawResults.AddValue(new TestResultValue(ScaleKeys.Type10, 0)
           .Add(questionnaire, Yes, 6, 20, 31, 44, 55, 70, 80, 93));

            rawResults.AddValue(new TestResultValue(ScaleKeys.Type4, 0)
         .Add(questionnaire, Yes, 8, 22, 33, 46, 57, 72, 82, 95));

            rawResults.AddValue(new TestResultValue(ScaleKeys.Type8, 0)
        .Add(questionnaire, Yes, 11, 35, 60, 84));

            rawResults.AddValue(new TestResultValue(ScaleKeys.Type11, 0)
            .Add(questionnaire, Yes, 9, 47, 59, 68, 88)
            .Add(questionnaire, No, 18, 27, 37, 63));

            var results = new TestResults(TestType.Тип_акцентуации_личности_Шмишека_Леонгарда);
            SetResult(rawResults, results, ScaleKeys.Type5, 3);
            SetResult(rawResults, results, ScaleKeys.Type9, 3);
            SetResult(rawResults, results, ScaleKeys.Type7, 3);
            SetResult(rawResults, results, ScaleKeys.Type1, 2);
            SetResult(rawResults, results, ScaleKeys.Type6, 3);
            SetResult(rawResults, results, ScaleKeys.Type2, 2);
            SetResult(rawResults, results, ScaleKeys.Type3, 2);
            SetResult(rawResults, results, ScaleKeys.Type10, 3);
            SetResult(rawResults, results, ScaleKeys.Type4, 3);
            SetResult(rawResults, results, ScaleKeys.Type8, 6);
            SetResult(rawResults, results, ScaleKeys.Type11, 1);

            return results;
        }

        private static void SetResult(TestResults rawResults, TestResults results,string key, int coef )
        {
            var type5 = rawResults.Values.FirstOrDefault(f => f.Key == key).Int;
            results.AddValue(new TestResultValue(key, type5 * coef));
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Lusher\Data\Common.cs


using System;
using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Questionnaires.Lusher.Data
{
    public static class Common
    {
        public static Random _rnd = new Random();

        public static void Shuffle<T>(this IList<T> list)
        {
            int n = list.Count;
            while (n > 1)
            {
                n--;
                int k = _rnd.Next(n + 1);
                T value = list[k];
                list[k] = list[n];
                list[n] = value;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Lusher\Data\LusherAnswer.cs


using System.Windows.Media;

namespace Updk7.Tests.Wpf.Questionnaires.Lusher.Data
{
    public class LusherAnswer : Questionnaires.Data.Answer
    {
        public Brush Color { get; set; }

        public int ColorNumber { get; set; }

        public int SelectNumber { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Lusher\ViewModels\LusherCollectionViewModel.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Threading;

using Updk7.Tests.Wpf.Questionnaires.ViewModels;
using Updk7.Tests.Wpf.Questionnaires.Data;

namespace Updk7.Tests.Wpf.Questionnaires.Lusher.ViewModels
{
    public class LusherCollectionViewModel : QuestionsCollectionViewModel
    {
        private bool _isWaiting;

        public bool IsWaiting
        {
            get { return _isWaiting; }
            set
            {
                _isWaiting = value;
                if (_isWaiting)
                    animationTimer.Start();
                else
                    animationTimer.Stop();
                RaisePropertyChanged();
            }
        }

        DispatcherTimer animationTimer = new DispatcherTimer();

        public LusherCollectionViewModel() : base()
        {
            animationTimer.Interval = TimeSpan.FromSeconds(30);
            animationTimer.Tick += AnimationTimer_Tick;
            this.PropertyChanged += LusherCollectionViewModel_PropertyChanged;
        }

        private void LusherCollectionViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(Questions) && Questions != null)
                questionsSubscribe();
        }

        private void questionsSubscribe()
        {
            foreach (var question in Questions)
                question.PropertyChanged += Question_PropertyChanged;
        }

        private void questionsUnsubscribe()
        {
            foreach (var question in Questions)
                question.PropertyChanged += Question_PropertyChanged;
        }

        public override void Break()
        {
            questionsUnsubscribe();
            IsWaiting = false;
            base.Break();
        }

        private void Question_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(QuestionViewModel.IsDirty) && Questions.Where(w => w.IsDirty).Count() < Questions.Count)
                IsWaiting = true;
            else if (Questions.Where(w => w.IsDirty).Count() == Questions.Count)
                TestCompleteCommand.Execute();
        }

        private void AnimationTimer_Tick(object sender, EventArgs e)
        {
            IsWaiting = false;
            MoveToNextQuestionCommand.Execute();
        }

        public override IEnumerable<QuestionViewModel> createQuestionsViewModels(QuestionsCollection questions)
        {
            var indexes = Enumerable.Range(0, questions.Count);
            return questions.Zip(indexes, (q, i) => new LusherViewModel(q)
            {
                IndexNumber = i,
                Title = $"Вопрос {i + 1}",
            });
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Lusher\ViewModels\LusherViewModel.cs


using System.Linq;
using System.Collections.Generic;
using System.Windows.Media;

using Updk7.Tests.Wpf.Questionnaires.Data;
using Updk7.Tests.Wpf.Questionnaires.ViewModels;

namespace Updk7.Tests.Wpf.Questionnaires.Lusher.ViewModels
{
    public class LusherViewModel : QuestionViewModel
    {
        private List<SelectViewModel> _selectColorViewModels;
        public List<SelectViewModel> SelectColorViewModels
        {
            get { return _selectColorViewModels; }
            set { SetProperty(ref _selectColorViewModels, value); }
        }
        public LusherViewModel()
        {

        }

        public LusherViewModel(Question question) : base(question)
        {
            generateRects();
        }

        private void generateRects()
        {
            var selectColorVMs = new List<SelectViewModel>();

            foreach (var answerVm in Answers)
            {
                var vm = new SelectViewModel() { Answer = answerVm };
                vm.PropertyChanged += Vm_PropertyChanged;
                selectColorVMs.Add(vm);
            }
            
            Lusher.Data.Common.Shuffle(selectColorVMs);
            SelectColorViewModels = selectColorVMs;
        }

        int selectNumber = 0;
        private void Vm_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(SelectViewModel.IsSelected))
            {
                var sVm = sender as SelectViewModel;
                selectNumber++;
                sVm.SelectNumber = selectNumber;

                if (SelectColorViewModels.Where(w => !w.IsSelected).Count() == 0)
                {
                    foreach (var value in SelectColorViewModels)
                    {
                        var answerData = (value.Answer.Data as Lusher.Data.LusherAnswer);
                        answerData.Color = value.Color;
                        answerData.ColorNumber = value.ColorNumber;
                    }
                    SelectColorViewModels[0].Answer.IsSelected = true;
                }
                else
                    SelectColorViewModels[0].Answer.IsSelected = false;
            }
        }
    }

    public class SelectViewModel : Prism.Mvvm.BindableBase
    {
        public Brush Color
        {
            get { return (Answer.Data as Lusher.Data.LusherAnswer).Color; }
        }

        public int ColorNumber
        {
            get { return (Answer.Data as Lusher.Data.LusherAnswer).ColorNumber; }
        }

        private int _selectNumber;
        public int SelectNumber
        {
            get { return _selectNumber; }
            set
            {
                _selectNumber = value;
                (Answer.Data as Lusher.Data.LusherAnswer).SelectNumber = _selectNumber;
            }
        }

        private bool _isSelected;
        public bool IsSelected
        {
            get { return _isSelected; }
            set { SetProperty(ref _isSelected, value); }
        }

        public AnswerViewModel Answer { get; set; }

        public SelectViewModel()
        {

        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Lusher\Views\AnimatedCircle.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Lusher.Views.AnimatedCircle"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <Storyboard x:Key="ChangeColorAnimation">
            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse">
                <EasingColorKeyFrame KeyTime="0" Value="#FFE0297C"/>
                <EasingColorKeyFrame KeyTime="0:0:3.75" Value="#FFE029C7"/>
                <EasingColorKeyFrame KeyTime="0:0:7.5" Value="#FFAE29E0"/>
                <EasingColorKeyFrame KeyTime="0:0:11.25" Value="#FF4B29E0"/>
                <EasingColorKeyFrame KeyTime="0:0:15" Value="#FF2985E0"/>
                <EasingColorKeyFrame KeyTime="0:0:18.75" Value="#FF29E0BF"/>
                <EasingColorKeyFrame KeyTime="0:0:22.5" Value="#FF29E053"/>
                <EasingColorKeyFrame KeyTime="0:0:26.25" Value="#FFE0C729"/>
                <EasingColorKeyFrame KeyTime="0:0:30" Value="#FFE02929"/>
            </ColorAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse" IsCumulative="False" IsAdditive="False">
                <EasingDoubleKeyFrame KeyTime="0" Value="200"/>
                <EasingDoubleKeyFrame KeyTime="0:0:30" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse" IsCumulative="True">
                <EasingDoubleKeyFrame KeyTime="0" Value="200"/>
                <EasingDoubleKeyFrame KeyTime="0:0:30" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Left)" Storyboard.TargetName="ellipse" IsCumulative="False" IsAdditive="False">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:30" Value="100"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Top)" Storyboard.TargetName="ellipse" IsCumulative="True">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:30" Value="100"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <Grid>
        <Viewbox Grid.Column="1">
            <Canvas Height="200" Width="200">
                <Ellipse Height="200" Width="200" Canvas.Left="0" Canvas.Top="0" x:Name="ellipse" Fill="#FFE0297C"/>
            </Canvas>
        </Viewbox>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Lusher\Views\AnimatedCircle.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Lusher.Views
{
    public partial class AnimatedCircle : UserControl
    {
        public bool IsAnimating
        {
            get { return (bool)GetValue(IsAnimatingProperty); }
            set { SetValue(IsAnimatingProperty, value); }
        }

        public static readonly DependencyProperty IsAnimatingProperty =
            DependencyProperty.Register("IsAnimating", typeof(bool), typeof(AnimatedCircle), new PropertyMetadata(false, IsAnimatingChanged));

        private static void IsAnimatingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var isAnimating = (d as AnimatedCircle).IsAnimating;
            if (isAnimating)
                (d as AnimatedCircle).StartAnimating();
            else
                (d as AnimatedCircle).StopAnimating();
        }

        public bool IsActive
        {
            get { return (bool)GetValue(IsActiveProperty); }
            set { SetValue(IsActiveProperty, value); }
        }

        public static readonly DependencyProperty IsActiveProperty =
            DependencyProperty.Register("IsActive", typeof(bool), typeof(AnimatedCircle), new PropertyMetadata(false));

        Storyboard animation = null;
        private void StartAnimating()
        {
            if (animation != null)
            {
                animation.Begin(this);
            }
        }

        public AnimatedCircle()
        {
            InitializeComponent();
        }

        private void StopAnimating()
        {
            animation.Stop(this);
        }

        public override void OnApplyTemplate()
        {
            if (animation == null)
            {
                animation = (Storyboard)this.FindResource("ChangeColorAnimation");
            }
            base.OnApplyTemplate();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Lusher\Views\LusherCollectionView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Lusher.Views.LusherCollectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Lusher.Views"
             xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Lusher.Views.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid
            Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <!--Поле вопроса-->
            <Border BorderThickness="0" Grid.Row="1" BorderBrush="Transparent" Visibility="{Binding IsWaiting, Converter={converters:BoolToVisibilityConverter}}">
                <local:LusherView 
                VerticalAlignment="Stretch"
                DataContext="{Binding CurrentQuestion, Mode=OneWay}"/>
            </Border>
            <local:AnimatedCircle VerticalAlignment="Stretch"
                                  Grid.Row="1">
                <local:AnimatedCircle.Style>
                    <Style TargetType="local:AnimatedCircle">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsWaiting}" Value="True">
                                <Setter Property="Visibility" Value="Visible"/>
                                <Setter Property="IsAnimating" Value="True"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding IsWaiting}" Value="False">
                                <Setter Property="Visibility" Value="Hidden"/>
                                <Setter Property="IsAnimating" Value="False"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </local:AnimatedCircle.Style>
            </local:AnimatedCircle>
        </Grid>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Lusher\Views\LusherCollectionView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Lusher.Views
{
    /// <summary>
    /// Interaction logic for LusherCollectionView.xaml
    /// </summary>
    public partial class LusherCollectionView : UserControl
    {
        public LusherCollectionView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Lusher\Views\LusherView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Lusher.Views.LusherView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Lusher.Views"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <Style x:Key="RectangleCheckBoxStyle" TargetType="{x:Type CheckBox}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type CheckBox}">
                        <Grid x:Name="templateRoot" Background="Transparent" SnapsToDevicePixels="True">
                            <Border x:Name="checkBoxBorder">
                                <Grid x:Name="markGrid">
                                    <Rectangle x:Name="optionMark" Fill="{TemplateBinding Background}" Opacity="1"/>
                                    <Rectangle x:Name="indeterminateMark" Fill="Transparent" Opacity="0"/>
                                </Grid>
                            </Border>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="true">
                                <Setter Property="Opacity" TargetName="optionMark" Value="0"/>
                                <Setter Property="Opacity" TargetName="indeterminateMark" Value="1"/>
                                <Setter Property="IsEnabled" Value="False"/>
                            </Trigger>
                            <Trigger Property="IsChecked" Value="false">
                                <Setter Property="Opacity" TargetName="optionMark" Value="1"/>
                                <Setter Property="Opacity" TargetName="indeterminateMark" Value="0"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid DataContext="{Binding}" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" Margin="10" 
                   Text="Последовательно выбирайте наиболее приятный для Вас цвет"/>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <ItemsControl Grid.Row="1"
                          ItemsSource="{Binding SelectColorViewModels}"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Stretch"
                          HorizontalContentAlignment="Stretch"
                          VerticalContentAlignment="Stretch">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <CheckBox
                        Width="{Binding ElementWidth,RelativeSource={RelativeSource FindAncestor,AncestorType=local:LusherView}}"
                        Style="{StaticResource RectangleCheckBoxStyle}"
                              Margin="10"
                              Background="{Binding Color}"
                              IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
            </ItemsControl>
        </Grid>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Lusher\Views\LusherView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Lusher.Views
{
    public partial class LusherView : UserControl
    {
        public LusherView()
        {
            InitializeComponent();
            Loaded += LusherView_Loaded;
        }

        public double ElementWidth
        {
            get { return (double)GetValue(ElementWidthProperty); }
            set { SetValue(ElementWidthProperty, value); }
        }

        public static readonly DependencyProperty ElementWidthProperty =
            DependencyProperty.Register("ElementWidth", typeof(double), typeof(LusherView), new PropertyMetadata(0.0));

        private void LusherView_Loaded(object sender, RoutedEventArgs e)
        {
            ElementWidth = (ActualWidth / 8) - 20;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Lusher\Views\Converters\BoolToVisibilityConverter.cs


using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Markup;
namespace Updk7.Tests.Wpf.Questionnaires.Lusher.Views.Converters
{
    public class BoolToVisibilityConverter : MarkupExtension, IValueConverter
    {
        private BoolToVisibilityConverter _converter = null;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var val = (bool)value;
            if (val)
                return Visibility.Hidden;
            else
                return Visibility.Visible;

        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new BoolToVisibilityConverter();
            return _converter;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Rokich\Data\RokichAnswer.cs


namespace Updk7.Tests.Wpf.Questionnaires.Rokich.Data
{
    public class RokichAnswer : Questionnaires.Data.Answer
    {
        public int Number { get; set; }
        public int Rank { get; set; }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Rokich\ViewModels\DataContextProxy.cs


using System.Windows;

namespace Updk7.Tests.Wpf.Questionnaires.Rokich.ViewModels
{
    public class DataContextProxy : Freezable
    {
        #region Overrides of Freezable

        protected override Freezable CreateInstanceCore()
        {
            return new DataContextProxy();
        }

        #endregion

        public object DataSource
        {
            get { return (object)GetValue(DataProperty); }
            set { SetValue(DataProperty, value); }
        }

        public static readonly DependencyProperty DataProperty = DependencyProperty.Register("DataSource", typeof(object), typeof(DataContextProxy), new UIPropertyMetadata(null));
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Rokich\ViewModels\RokichCollectionViewModel.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Rokich.ViewModels
{
    public class RokichCollectionViewModel : Questionnaires.ViewModels.QuestionsCollectionViewModel
    {
        public override IEnumerable<Questionnaires.ViewModels.QuestionViewModel> createQuestionsViewModels(Questionnaires.Data.QuestionsCollection questions)
        {
            var indexes = Enumerable.Range(0, questions.Count);
            return questions.Zip(indexes, (q, i) => new RokichViewModel(q)
            {
                IndexNumber = i,
                Title = $"Вопрос {i + 1}",
            });
        }

        public override void updateNavigationCommands()
        {
            CanMoveToNextQuestion = CurrentQuestion.IndexNumber < Questions.Count - 1 && Questions[0].IsDirty;
            //CanMoveToPreviousQuestion = _currentQuestion.IndexNumber > 0;
            CanTestComplete = AnsweredQuestionsCount == Questions.Count;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Rokich\ViewModels\RokichViewModel.cs


using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.Rokich.ViewModels
{
    public class RokichViewModel : Questionnaires.ViewModels.QuestionViewModel
    {
        public RokichViewModel()
        {
        }

        private ObservableCollection<RankViewModel> _unselectedRanks = new ObservableCollection<RankViewModel>();
        public ObservableCollection<RankViewModel> UnselectedRanks
        {
            get { return _unselectedRanks; }
            private set { SetProperty(ref _unselectedRanks, value); }
        }

        private ObservableCollection<ValueViewModel> _values;
        public ObservableCollection<ValueViewModel> Values
        {
            get { return _values; }
            private set { SetProperty(ref _values, value); }
        }

        public RokichViewModel(Questionnaires.Data.Question question) : base(question)
        {
            setValues();
            setNumbers();
            updateNumbers();
            subscribe();
        }

        private void updateNumbers()
        {
            var selectedRankValues = Values.Where(w => w.Rank != 255).Select(s => s.Rank).ToList();

            foreach (var number in UnselectedRanks)
                number.IsSelected = false;

            for (int i = 0; i < selectedRankValues.Count; i++)
            {
                var number = UnselectedRanks.FirstOrDefault(f => f.Rank == selectedRankValues[i]);
                number.IsSelected = true;
            }
        }

        private void setNumbers()
        {
            var rankVm255 = new RankViewModel() { Rank = 255 };
            UnselectedRanks.Add(rankVm255);
            for (int i = 0; i < Values.Count; i++)
                UnselectedRanks.Add(new RankViewModel() { Rank = i + 1 });
            foreach (var value in Values)
                value.RankVm = rankVm255;
        }

        private void setValues()
        {
            var values = new ObservableCollection<ValueViewModel>();

            foreach (var answer in Answers)
            {
                var value = new ValueViewModel(answer);
                values.Add(value);
            }
            Values = values;
        }

        private void subscribe()
        {
            foreach (var value in Values)
                value.PropertyChanged += Value_PropertyChanged;
        }

        private void Value_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            updateNumbers();
            if (e.PropertyName == nameof(ValueViewModel.RankVm))
            {
                var newValues = new List<ValueViewModel>(Values.OrderBy(o => o.Rank).ToList());
                Values.Clear();
                foreach (var value in newValues)
                    Values.Add(value);
                if (UnselectedRanks.Where(w => !w.IsSelected).Count() == 1)
                {
                    foreach (var value in Values)
                        (value.Answer.Data as Rokich.Data.RokichAnswer).Rank = value.Rank;

                    Values[0].Answer.IsSelected = true;
                }
                else
                    Values[0].Answer.IsSelected = false;
            }
        }
    }

    public class RankViewModel : Prism.Mvvm.BindableBase
    {
        private bool _isSelected;
        public bool IsSelected
        {
            get { return _isSelected; }
            set { SetProperty(ref _isSelected, value); }
        }

        public string DisplayValue
        {
            get { return _rank == 255 ? "-" : _rank.ToString(); }
        }

        private int _rank = 255;
        public int Rank
        {
            get { return _rank; }
            set { SetProperty(ref _rank, value); }
        }
    }

    public class ValueViewModel : Prism.Mvvm.BindableBase
    {
        private bool _isSelected;
        public bool IsSelected
        {
            get { return _isSelected; }
            set { SetProperty(ref _isSelected, value); }
        }
        public int Rank
        {
            get { return RankVm.Rank; }
        }

        private RankViewModel _rankVm;
        public RankViewModel RankVm
        {
            get { return _rankVm; }
            set
            {
                _rankVm = value;
                RaisePropertyChanged();
            }
        }

        public string Text { get { return Answer.Data.Content.ToString(); } }

        public string Number { get; }

        public Questionnaires.ViewModels.AnswerViewModel Answer { get; set; }
        public ValueViewModel(Questionnaires.ViewModels.AnswerViewModel answer)
        {
            Answer = answer;
            Number = (answer.Data as Rokich.Data.RokichAnswer).Number.ToString();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Rokich\Views\RokichView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Rokich.Views.RokichView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:viewModels="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Rokich.ViewModels"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <viewModels:DataContextProxy x:Key="DataContextProxy" DataSource="{Binding}"/>
        <Style TargetType="DataGridColumnHeader">
            <Style.Setters>
                <Setter Property="Background" Value="#FFE8E8E8"/>
            </Style.Setters>
        </Style>
        <Style TargetType="DataGridRow">
            <Setter Property="FontSize" Value="18"/>
            <Setter Property="Background" Value="{StaticResource WindowBackground}"/>
        </Style>
        <Style TargetType="DataGridCell">
            <Style.Triggers>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsReadOnly" Value="False"/>
                        <Condition Property="IsSelected" Value="True"/>
                    </MultiTrigger.Conditions>
                    <Setter Property="IsEditing" Value="True"/>
                </MultiTrigger>
            </Style.Triggers>
        </Style>

    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <ScrollViewer VerticalScrollBarVisibility="Auto" VerticalAlignment="Center" DataContext="{Binding}">
            <DataGrid ColumnWidth="*" FontSize="20" ItemsSource="{Binding Values}" AutoGenerateColumns="False" CanUserResizeRows="False" RowDetailsVisibilityMode="Collapsed" Background="LightGray" HeadersVisibility="Column" BorderBrush="{x:Null}">
                <DataGrid.Columns>
                    <DataGridTemplateColumn Header="№ п/п" Width="Auto" IsReadOnly="True">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Margin="5" Text="{Binding Number}"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Название ценности" IsReadOnly="True">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Margin="5" Text="{Binding Text}"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Ранг ценности" Width="180">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Margin="5" Text="{Binding RankVm.DisplayValue}"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                        <DataGridTemplateColumn.CellEditingTemplate>
                            <DataTemplate>
                                <ComboBox ItemsSource="{Binding Source={StaticResource DataContextProxy}, Path=DataSource.UnselectedRanks}"
                                          SelectedValue="{Binding RankVm, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >
                                    <ComboBox.ItemContainerStyle>
                                        <Style TargetType="ComboBoxItem">
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding IsSelected}" Value="True">
                                                    <Setter Property="Visibility" Value="Collapsed"/>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </ComboBox.ItemContainerStyle>
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding DisplayValue}"/>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellEditingTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
            </DataGrid>
        </ScrollViewer>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Rokich\Views\RokichView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Rokich.Views
{
    /// <summary>
    /// Interaction logic for RokichView.xaml
    /// </summary>
    public partial class RokichView : UserControl
    {
        public RokichView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Rokich\Views\TestConverter.cs


using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Questionnaires.Rokich.Views
{
    public class TestConverter : MarkupExtension, IValueConverter
    {
        private TestConverter _converter = null;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return new ViewModels.RankViewModel() { Rank = (int)value };
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var vm = value as ViewModels.RankViewModel;
            return vm.Rank;
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (_converter == null)
                _converter = new TestConverter();
            return _converter;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\SAN\ViewModels\SanQuestionCollectionViewModel.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.SAN.ViewModels
{
    public class SanQuestionCollectionViewModel : Questionnaires.ViewModels.QuestionsCollectionViewModel
    {
        public override IEnumerable<Questionnaires.ViewModels.QuestionViewModel> createQuestionsViewModels(Questionnaires.Data.QuestionsCollection questions)
        {
            var indexes = Enumerable.Range(0, questions.Count);
            return questions.Zip(indexes, (q, i) => new SanQuestionViewModel(q)
            {
                IndexNumber = i,
                Title = $"Вопрос {i + 1}",
            });
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\SAN\ViewModels\SanQuestionViewModel.cs


using System.Collections.Generic;

namespace Updk7.Tests.Wpf.Questionnaires.SAN.ViewModels
{
    public class SanQuestionViewModel : Questionnaires.ViewModels.QuestionViewModel
    {
        public SanQuestionViewModel()
        {

        }

        public SanQuestionViewModel(Questionnaires.Data.Question question) : base(question)
        {

        }
        public string LeftText
        {
            get { return GetValue(false); }
        }

        public string RightText
        {
            get { return GetValue(true); }
        }

        private string GetValue(bool leftRight)
        {
            List<char> curRes = new List<char>();
            if (!leftRight)
            {

                for (int i = 0; i < Text.Length; i++)
                {
                    if (Text[i] != '/')
                        curRes.Add(Text[i]);
                    else
                        break;
                }
            }
            else
            {
                bool record = false;
                for (int i = 0; i < Text.Length; i++)
                {
                    if (!record)
                    {
                        if (Text[i] == '/')
                        {
                            record = true;
                            continue;
                        }
                    }
                    else
                    {
                        curRes.Add(Text[i]);
                    }
                }
            }

            return new string(curRes.ToArray());
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\SAN\Views\SanQuestionView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.SAN.Views.SanQuestionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:viewModels="clr-namespace:Updk7.Tests.Wpf.Questionnaires.ViewModels"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Updk7.Tests.Wpf;component/Source/Questionnaires/Views/AnswerCheckBoxStyle.xaml" />
                <ResourceDictionary Source="/Updk7.Tests.Wpf;component/Source/Questionnaires/Views/AnswerRadioButtonStyle.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.Resources>
            <Style x:Key="AnswersItemsControlStyle" TargetType="{x:Type ItemsControl}">
                <Style.Setters>
                    <Setter Property="ItemsPanel">
                        <Setter.Value>
                            <ItemsPanelTemplate>
                                <StackPanel Orientation="Horizontal"/>
                            </ItemsPanelTemplate>
                        </Setter.Value>
                    </Setter>
                </Style.Setters>
                <Style.Triggers>
                    <!--Шаблон ответов SingleChoice-->
                    <DataTrigger Binding="{Binding AnswersType}" Value="SingleChoice">
                        <Setter Property="ItemTemplate">
                            <Setter.Value>
                                <DataTemplate DataType="{x:Type viewModels:AnswerViewModel}">
                                    <RadioButton 
                                        Margin="5"
                                        Style="{StaticResource AnswerRadioButtonStyle}"
                                        Content="{Binding Content}"
                                        IsChecked="{Binding IsSelected}"
                                        Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, 
                                            AncestorType={x:Type UserControl}}, 
                                            Path=DataContext.MoveToNextQuestionCommand}"
                                        GroupName="AnswerButton"
                                        SnapsToDevicePixels="True"
                                        />
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                    <!--Шаблон ответов MultiChoice-->
                    <DataTrigger Binding="{Binding AnswersType}" Value="MultiChoice">
                        <Setter Property="ItemTemplate">
                            <Setter.Value>
                                <DataTemplate DataType="{x:Type viewModels:AnswerViewModel}">
                                    <CheckBox 
                                        Margin="5"
                                        Style="{StaticResource AnswerCheckBoxStyle}"
                                        Content="{Binding Content}"
                                        IsChecked="{Binding IsSelected}"
                                        SnapsToDevicePixels="True"
                                        />
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                    <!--Шаблон ответов Text-->
                    <DataTrigger Binding="{Binding AnswersType}" Value="Text">
                        <Setter Property="ItemTemplate">
                            <Setter.Value>
                                <DataTemplate DataType="{x:Type viewModels:AnswerViewModel}">
                                    <Grid
                                        Margin="5">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="2*" />
                                            <ColumnDefinition Width="1*" />
                                        </Grid.ColumnDefinitions>
                                        <TextBlock 
                                            Grid.Column="0"
                                            Text="Введите ответ в текстовое поле "
                                            FontSize="20"
                                            TextWrapping="WrapWithOverflow"
                                            FontWeight="DemiBold"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Right"
                                            />
                                        <TextBox 
                                            Grid.Column="1"
                                            Margin="10,0,0,0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="22"
                                            FontWeight="DemiBold"
                                            Text="{Binding EnteredText, UpdateSourceTrigger=PropertyChanged}"
                                            Width="100"
                                            />
                                    </Grid>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </Grid.Resources>
        <!--Содержание вопроса-->
        <TextBlock
            Grid.Row="0"
            VerticalAlignment="Bottom"
            HorizontalAlignment="Center"
            Text="{Binding LeftText}"
            FontSize="26"
            FontWeight="Bold"
            TextWrapping="Wrap"
            TextAlignment="Center"
            />

        <TextBlock
            Grid.Row="0"
            Grid.Column="1"
            VerticalAlignment="Bottom"
            HorizontalAlignment="Center"
            Text="{Binding RightText}"
            FontSize="26"
            FontWeight="Bold"
            TextWrapping="Wrap"
            TextAlignment="Center"
            />
        <!--Варианты ответов-->
        <ScrollViewer
            Grid.Row="1" Grid.ColumnSpan="2"
            VerticalAlignment="Top"
            HorizontalScrollBarVisibility="Disabled"
            VerticalScrollBarVisibility="Auto">
            <ItemsControl
                Grid.Row="1"
                Margin="10,10,10,20"
                HorizontalContentAlignment="Stretch"
                HorizontalAlignment="Center"
                VerticalAlignment="Bottom"
                BorderBrush="Transparent"
                BorderThickness="0"
                Background="Transparent"
                Style="{StaticResource AnswersItemsControlStyle}"
                ItemsSource="{Binding Answers}">
            </ItemsControl>
        </ScrollViewer>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\SAN\Views\SanQuestionView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.SAN.Views
{
    /// <summary>
    /// Interaction logic for SanQuestionView.xaml
    /// </summary>
    public partial class SanQuestionView : UserControl
    {
        public SanQuestionView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\SR\ViewModels\SRQuestionsCollectionViewModel.cs


using System.Collections.Generic;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.SR.ViewModels
{
    public class SRQuestionsCollectionViewModel : Questionnaires.ViewModels.QuestionsCollectionViewModel
    {
        public override IEnumerable<Questionnaires.ViewModels.QuestionViewModel> createQuestionsViewModels(Questionnaires.Data.QuestionsCollection questions)
        {
            var indexes = Enumerable.Range(0, questions.Count);
            return questions.Zip(indexes, (q, i) => new SRViewModel(q)
            {
                IndexNumber = i,
                Title = $"Вопрос {i + 1}",
            });
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\SR\ViewModels\SRViewModel.cs


using System.ComponentModel;
using System.Linq;

namespace Updk7.Tests.Wpf.Questionnaires.SR.ViewModels
{
    public class SRViewModel : Questionnaires.ViewModels.QuestionViewModel
    {
        public SRViewModel()
        {

        }

        public SRViewModel(Questionnaires.Data.Question question) : base(question)
        {
            subsctibeAnswers();
        }

        private void subsctibeAnswers()
        {
            foreach (var answer in Answers)
            {
                answer.PropertyChanged += onAnswerPropertyChanged;
            }
        }

        private void onAnswerPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            var answer = sender as Questionnaires.ViewModels.AnswerViewModel;
            checkPossibleCountMiltiSelect(3, answer);
        }

        private void checkPossibleCountMiltiSelect(int countAnswersSelected, Questionnaires.ViewModels.AnswerViewModel lastAnswer)
        {
            var currentCountSelected = Answers.Where(w => w.IsSelected).Count();
            if (countAnswersSelected < currentCountSelected)
                lastAnswer.IsSelected = false;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\SR\Views\SRView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.SR.Views.SRView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:viewModels="clr-namespace:Updk7.Tests.Wpf.Questionnaires.ViewModels"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Updk7.Tests.Wpf;component/Source/Questionnaires/Views/AnswerCheckBoxStyle.xaml" />
                <ResourceDictionary Source="/Updk7.Tests.Wpf;component/Source/Questionnaires/Views/AnswerRadioButtonStyle.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.Resources>
            <Style x:Key="AnswersItemsControlStyle" TargetType="{x:Type ItemsControl}">
                <Style.Triggers>
                    <!--Шаблон ответов MultiChoice-->
                    <DataTrigger Binding="{Binding AnswersType}" Value="MultiChoice">
                        <Setter Property="ItemTemplate">
                            <Setter.Value>
                                <DataTemplate DataType="{x:Type viewModels:AnswerViewModel}">
                                    <CheckBox 
                                        Margin="5"
                                        Style="{StaticResource AnswerCheckBoxStyle}"
                                        Content="{Binding Content}"
                                        IsChecked="{Binding IsSelected}"
                                        SnapsToDevicePixels="True"
                                        />
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </Grid.Resources>
        <!--Содержание вопроса-->

        <!--Варианты ответов-->
        <ScrollViewer
            Grid.Row="1" Grid.ColumnSpan="2"
            VerticalAlignment="Top"
            HorizontalScrollBarVisibility="Disabled"
            VerticalScrollBarVisibility="Auto">
            <ItemsControl
                Grid.Row="1"
                Margin="10,10,10,20"
                HorizontalContentAlignment="Stretch"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                BorderBrush="Transparent"
                BorderThickness="0"
                Background="Transparent"
                Style="{StaticResource AnswersItemsControlStyle}"
                ItemsSource="{Binding Answers}">
            </ItemsControl>
        </ScrollViewer>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\SR\Views\SRView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.SR.Views
{
    /// <summary>
    /// Interaction logic for SRView.xaml
    /// </summary>
    public partial class SRView : UserControl
    {
        public SRView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\ViewModels\AnswerViewModel.cs


using System.ComponentModel;

namespace Updk7.Tests.Wpf.Questionnaires.ViewModels
{
    public class AnswerViewModel : Prism.Mvvm.BindableBase
    {
        public AnswerViewModel()
        {
        }

        public AnswerViewModel(Data.Answer answer)
        {
            Data = answer;
            Content = answer.Content;
        }

        public Data.Answer Data { get; }

        public object Content { get; }

        private bool _isSelected;

        public bool IsSelected
        {
            get { return _isSelected; }
            set { SetProperty(ref _isSelected, value); }
        }

        private string _enteredText;

        public string EnteredText
        {
            get { return _enteredText; }
            set { SetProperty(ref _enteredText, value); }
        }

        protected override void OnPropertyChanged(PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(IsSelected))
                Data.IsSelected = IsSelected;
            else if (e.PropertyName == nameof(EnteredText))
                Data.EnteredText = EnteredText;

            base.OnPropertyChanged(e);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\ViewModels\CustomQuestionnairesViewModel.cs


namespace Updk7.Tests.Wpf.Questionnaires.ViewModels
{
    public class CustomQuestionnairesViewModel : QuestionnaireViewModel
    {
        public CustomQuestionnairesViewModel(TestType type)
        {
            QuestionsCollectionViewModel = GetCollectionViewModel(type);
        }
        
        private QuestionsCollectionViewModel GetCollectionViewModel(TestType test)
        {
            switch (test)
            {
                case TestType.Опросник_САН:
                    return new SAN.ViewModels.SanQuestionCollectionViewModel();
                case TestType.Ценностные_ориентации_Рокич:
                    return new Rokich.ViewModels.RokichCollectionViewModel();
                case TestType.Тест_Стиль_руководства_СР:
                    return new SR.ViewModels.SRQuestionsCollectionViewModel();
                case TestType.Тест_Люшера:
                    return new Lusher.ViewModels.LusherCollectionViewModel();
                default:
                    return new QuestionsCollectionViewModel(); ;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\ViewModels\InstructionViewModel.cs


using Prism.Mvvm;
using Prism.Commands;

namespace Updk7.Tests.Wpf.Questionnaires.ViewModels
{
    public class InstructionViewModel : BindableBase
    {
        public InstructionViewModel()
        {
        }

        private DelegateCommand _startTestingCommand;

        public DelegateCommand StartTestingCommand
        {
            get { return _startTestingCommand; }
            set { SetProperty(ref _startTestingCommand, value); }
        }

        private object _data;

        public object Data
        {
            get { return _data; }
            set { SetProperty(ref _data, value); }
        } 
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\ViewModels\QuestionnaireViewModel.cs


using System;
using System.ComponentModel;
using System.Diagnostics;
using Prism.Mvvm;
using Prism.Commands;

namespace Updk7.Tests.Wpf.Questionnaires.ViewModels
{
    public class QuestionnaireViewModel : BindableBase, ITest
    {
        protected InstructionViewModel InstructionViewModel = new InstructionViewModel();
        protected TestCompleteViewModel TestCompleteViewModel = new TestCompleteViewModel();
        protected TestBreakViewModel TestBreakViewModel = new TestBreakViewModel();

        public QuestionnaireViewModel()
        {
            InstructionViewModel.StartTestingCommand = new DelegateCommand(onBriefingComplete);
            QuestionsCollectionViewModel = new QuestionsCollectionViewModel();
        }

        public event EventHandler<TestCompleteEventArgs> TestComplete;

        private QuestionsCollectionViewModel _questionsCollectionViewModel;

        public QuestionsCollectionViewModel QuestionsCollectionViewModel
        {
            get { return _questionsCollectionViewModel; }
            protected set
            {
                unscribeFromQuestionsCollectionViewModel(_questionsCollectionViewModel);
                SetProperty(ref _questionsCollectionViewModel, value);
                subscribeToQuestionsCollectionViewModel(_questionsCollectionViewModel);
            }
        } 

        private BindableBase _currentViewModel;

        public BindableBase CurrentViewModel
        {
            get { return _currentViewModel; }
            private set { SetProperty(ref _currentViewModel, value); }
        }

        private Data.Questionnaire _questionnaire;

        public Data.Questionnaire Questionnaire
        {
            get { return _questionnaire; }
            set { SetProperty(ref _questionnaire, value); }
        }

        private string _title;

        public string Title
        {
            get { return _title; }
            private set { SetProperty(ref _title, value); }
        }

        private TestParameter[] _parameters;

        public TestParameter[] Parameters
        {
            get { return _parameters; }
            private set { SetProperty(ref _parameters, value); }
        } 

        private int _testProgress;

        public int TestProgress
        {
            get { return _testProgress; }
            private set { SetProperty(ref _testProgress, value); }
        } 

        public void Start(TestParameter[] parameters)
        {
            Debug.Assert(_questionnaire != null);

            Parameters = parameters;
            TestProgress = 0;
            Title = _questionnaire.Title;
            InstructionViewModel.Data = _questionnaire.Instruction;

            CurrentViewModel = InstructionViewModel;
        }

        public void Break()
        {
            TestProgress = 0;
            CurrentViewModel = TestBreakViewModel;

            QuestionsCollectionViewModel.Break();
        }

        private void onBriefingComplete()
        {
            CurrentViewModel = QuestionsCollectionViewModel;

            QuestionsCollectionViewModel.Data = _questionnaire.Questions;
            QuestionsCollectionViewModel.TestDuration = _questionnaire.TestDuration;
            QuestionsCollectionViewModel.Start();
        }

        private void onQuestionCollectionPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(ViewModels.QuestionsCollectionViewModel.AnsweredQuestionsCount))
                updateProgress();
        }

        private void onTestComplete(object sender, EventArgs e)
        {
            CurrentViewModel = TestCompleteViewModel;

            var args = Questionnaire.Keys != null
                ? new TestCompleteEventArgs(Questionnaire.Keys.CalculateResults(Questionnaire))
                : null;

            TestComplete?.Invoke(this, args);
        }

        private void updateProgress()
        {
            var answered = QuestionsCollectionViewModel.AnsweredQuestionsCount;
            var total = _questionnaire.Questions.Count;
            TestProgress = (100 * answered) / total;
        }

        private void subscribeToQuestionsCollectionViewModel(QuestionsCollectionViewModel viewModel)
        {
            if (viewModel != null)
            {
                viewModel.TestComplete += onTestComplete;
                viewModel.PropertyChanged += onQuestionCollectionPropertyChanged;
            }
        }

        private void unscribeFromQuestionsCollectionViewModel(QuestionsCollectionViewModel viewModel)
        {
            if (viewModel != null)
            {
                viewModel.TestComplete -= onTestComplete;
                viewModel.PropertyChanged -= onQuestionCollectionPropertyChanged;
            }
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\ViewModels\QuestionsCollectionViewModel.cs


using System;
using System.ComponentModel;
using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows.Threading;
using Prism.Mvvm;
using Prism.Commands;

namespace Updk7.Tests.Wpf.Questionnaires.ViewModels
{
    public class QuestionsCollectionViewModel : BindableBase
    {
        private DelegateCommand _delayedMoveToNextQuestionCommand;
        private DispatcherTimer _timer = new DispatcherTimer();
        private Func<TimeSpan, string> getFormattedTime = t => $"{t.Minutes:d2}:{t.Seconds:d2}";

        public QuestionsCollectionViewModel()
        {
            MoveToNextQuestionCommand = new DelegateCommand(moveToNextQuestion, () => _canMoveToNextQuestion);
            MoveToPreviousQuestionCommand = new DelegateCommand(moveToPreviousQuestion, () => _canMoveToPreviousQuestion);
            TestCompleteCommand = new DelegateCommand(onTestComplete, () => CanTestComplete);
            _delayedMoveToNextQuestionCommand = new DelegateCommand(async () => await delayedMoveToNextQuestion());
            _timer.Tick += onTimerTick;
            _timer.Interval = TimeSpan.FromSeconds(1);
        }

        public event EventHandler TestComplete;

        public DelegateCommand MoveToNextQuestionCommand { get; }

        public DelegateCommand MoveToPreviousQuestionCommand { get; }

        public DelegateCommand TestCompleteCommand { get; }

        private Data.QuestionsCollection _data;

        public Data.QuestionsCollection Data
        {
            get { return _data; }
            set { SetProperty(ref _data, value); }
        }

        private List<QuestionViewModel> _questions;

        public List<QuestionViewModel> Questions
        {
            get { return _questions; }
            private set { SetProperty(ref _questions, value); }
        } 

        private QuestionViewModel _currentQuestion;

        public QuestionViewModel CurrentQuestion
        {
            get { return _currentQuestion; }
            set { SetProperty(ref _currentQuestion, value); }
        }

        private bool _canTestComplete = false;

        public bool CanTestComplete
        {
            get { return _canTestComplete; }
            set { SetProperty(ref _canTestComplete, value); }
        }

        private bool _canMoveToNextQuestion = true;

        public bool CanMoveToNextQuestion
        {
            get { return _canMoveToNextQuestion; }
            set { SetProperty(ref _canMoveToNextQuestion, value); }
        }

        private bool _canMoveToPreviousQuestion = false;

        public bool CanMoveToPreviousQuestion
        {
            get { return _canMoveToPreviousQuestion; }
            private set { SetProperty(ref _canMoveToPreviousQuestion, value); }
        }

        private int _answeredQuestionsCount;

        public int AnsweredQuestionsCount
        {
            get { return _answeredQuestionsCount; }
            private set { SetProperty(ref _answeredQuestionsCount, value); }
        }

        private TimeSpan _testDuration;

        public TimeSpan TestDuration
        {
            get { return _testDuration; }
            set { SetProperty(ref _testDuration, value); }
        }

        private TimeSpan _timeLeft;

        public TimeSpan TimeLeft
        {
            get { return _timeLeft; }
            private set { SetProperty(ref _timeLeft, value); }
        }

        private string _timeLeftFormat;

        public string TimeLeftFormat
        {
            get { return _timeLeftFormat; }
            private set { SetProperty(ref _timeLeftFormat, value); }
        } 

        public void Start()
        {
            TimeLeft = TestDuration;

            if (_timeLeft != TimeSpan.Zero)
            {
                TimeLeftFormat = getFormattedTime(_timeLeft);
                _timer.IsEnabled = true;
            }
        }

        public virtual void Break()
        {
            _timer.IsEnabled = false;
        }

        protected override void OnPropertyChanged(PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(Data))
                setupQuestionsData();
            else if (e.PropertyName == nameof(CurrentQuestion))
                updateTestProgress();
            else if (e.PropertyName == nameof(CanTestComplete))
                TestCompleteCommand.RaiseCanExecuteChanged();
            else if (e.PropertyName == nameof(CanMoveToNextQuestion))
                MoveToNextQuestionCommand.RaiseCanExecuteChanged();
            else if (e.PropertyName == nameof(CanMoveToPreviousQuestion))
                MoveToPreviousQuestionCommand.RaiseCanExecuteChanged();

            base.OnPropertyChanged(e);
        }

        private void onQuestionPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(QuestionViewModel.IsDirty))
                updateTestProgress();
        }

        private void onTimerTick(object sender, EventArgs e)
        {
            var diff = _timeLeft - _timer.Interval;
            if (diff >= TimeSpan.Zero)
            {
                TimeLeft = diff;
                TimeLeftFormat = getFormattedTime(_timeLeft);
            }
            else
            {
                onTestComplete();
            }
        }

        private void updateTestProgress()
        {
            if (CurrentQuestion != null)
            {
                AnsweredQuestionsCount = Questions.Where(q => q.IsDirty).Count();
                updateNavigationCommands();
            }
        }

        private void setupQuestionsData()
        {
            unscribeFromQuestionsEvents(Questions);
            Questions = createQuestionsViewModels(Data).ToList();
            subscribeToQuestionsEvents(Questions);

            CurrentQuestion = Questions.FirstOrDefault();
            AnsweredQuestionsCount = 0;
            TimeLeft = TimeSpan.Zero;
            TimeLeftFormat = string.Empty;
            updateNavigationCommands();
        }

        private async Task delayedMoveToNextQuestion()
        {
            await Task.Delay(100);
            moveToNextQuestion();
        }

        private void moveToNextQuestion()
        {
            var nextQuestion = _questions
                .SeekForward(_currentQuestion.IndexNumber + 1)
                .FirstOrDefault(q => !q.IsDirty); 

            if (nextQuestion == null)
            {
                var nextIndex = _currentQuestion.IndexNumber + 1;
                if (nextIndex < _questions.Count)
                    nextQuestion = _questions[nextIndex];
            }

            if (nextQuestion != null)
            {
                CurrentQuestion = nextQuestion;
                updateNavigationCommands();
            }
        }

        private void moveToPreviousQuestion()
        {
            var previousQuestion = _questions
                .SeekBackward(_currentQuestion.IndexNumber - 1)
                .FirstOrDefault(q => !q.IsDirty);

            if (previousQuestion == null)
            {
                var previousIndex = _currentQuestion.IndexNumber - 1;
                if (previousIndex >= 0)
                    previousQuestion = _questions[previousIndex];
            }

            if (previousQuestion != null)
            {
                CurrentQuestion = previousQuestion;
                updateNavigationCommands();
            }
        }

        private void onTestComplete()
        {
            _timer.IsEnabled = false;
            TestComplete?.Invoke(this, EventArgs.Empty);
        }

        public virtual IEnumerable<QuestionViewModel> createQuestionsViewModels(Data.QuestionsCollection questions)
        {
            var indexes = Enumerable.Range(0, questions.Count);
            return questions.Zip(indexes, (q, i) => new QuestionViewModel(q)
            {
                IndexNumber = i,
                Title = $"Вопрос {i + 1}",
            });
        }

        private void subscribeToQuestionsEvents(IEnumerable<QuestionViewModel> viewModels)
        {
            if (viewModels != null)
            {
                foreach (var vm in viewModels)
                {
                    vm.MoveToNextQuestionCommand = _delayedMoveToNextQuestionCommand;
                    vm.PropertyChanged += onQuestionPropertyChanged;
                }
            }
        }

        private void unscribeFromQuestionsEvents(IEnumerable<QuestionViewModel> viewModels)
        {
            if (viewModels != null)
            {
                foreach (var vm in viewModels)
                {
                    vm.PropertyChanged -= onQuestionPropertyChanged;
                    vm.MoveToNextQuestionCommand = null;
                }
            }
        }

        public virtual void updateNavigationCommands()
        {
            CanMoveToNextQuestion = _currentQuestion.IndexNumber < _questions.Count - 1;
            CanMoveToPreviousQuestion = _currentQuestion.IndexNumber > 0;
            CanTestComplete = AnsweredQuestionsCount == _questions.Count;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\ViewModels\QuestionViewModel.cs


using System.Linq;
using System.ComponentModel;
using System.Collections.Generic;
using Prism.Mvvm;
using Prism.Commands;

namespace Updk7.Tests.Wpf.Questionnaires.ViewModels
{
    public class QuestionViewModel : BindableBase
    {
        public QuestionViewModel()
        {
        }

        public QuestionViewModel(Data.Question question)
        {
            Data = question;
            Text = question.Text;
            AnswersType = question.AnswersType;
            setupAnswersViewModels();
        }

        public Data.Question Data { get; }

        public string Title { get; set; }

        public int IndexNumber { get; set; }

        public string Text { get; }

        public Data.AnswersType AnswersType { get; }

        public IEnumerable<AnswerViewModel> Answers { get; private set; }

        private DelegateCommand _moveToNextQuestionCommand;

        public DelegateCommand MoveToNextQuestionCommand
        {
            get { return _moveToNextQuestionCommand; }
            set { SetProperty(ref _moveToNextQuestionCommand, value); }
        } 

        private bool _isDirty;

        public bool IsDirty
        {
            get { return _isDirty; }
            private set { SetProperty(ref _isDirty, value); }
        } 

        private void onAnswerPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            var viewModel = sender as AnswerViewModel;
            IsDirty = Answers.Any(a => a.IsSelected || !string.IsNullOrEmpty(a.EnteredText));
        }

        private void setupAnswersViewModels()
        {
            var viewModels = new List<AnswerViewModel>();

            foreach (var answer in Data.Answers)
            {
                var viewModel = new AnswerViewModel(answer);
                viewModel.PropertyChanged += onAnswerPropertyChanged;
                viewModels.Add(viewModel);
            }

            Answers = viewModels;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\ViewModels\TestBreakViewModel.cs


using Prism.Mvvm;

namespace Updk7.Tests.Wpf.Questionnaires.ViewModels
{
    public class TestBreakViewModel : BindableBase
    {
        public TestBreakViewModel()
        {
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\ViewModels\TestCompleteViewModel.cs


using Prism.Mvvm;

namespace Updk7.Tests.Wpf.Questionnaires.ViewModels
{
    public class TestCompleteViewModel : BindableBase
    {
        public TestCompleteViewModel()
        {
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\AnswerCheckBoxStyle.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="AnswerCheckBoxStyle" TargetType="{x:Type CheckBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <Border
                        x:Name="PART_Border"
                        Background="Transparent"
                        BorderBrush="Gray"
                        BorderThickness="1">
                        <ContentControl
                            Margin="10,5,10,5"
                            Content="{Binding Content}"
                            FontSize="20" 
                            FontWeight="Bold"
                            VerticalAlignment="Center" 
                            VerticalContentAlignment="Center"
                            HorizontalAlignment="Left"
                            HorizontalContentAlignment="Left"
                            />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter 
                                TargetName="PART_Border" 
                                Property="BorderBrush"
                                Value="DeepSkyBlue"
                                />
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter 
                                TargetName="PART_Border"
                                Property="Background"
                                Value="DeepSkyBlue"
                                />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\AnswerRadioButtonStyle.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="AnswerRadioButtonStyle" TargetType="{x:Type RadioButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <Border
                        x:Name="PART_Border"
                        Background="Transparent"
                        BorderBrush="Gray"
                        BorderThickness="1">
                        <ContentControl
                            Margin="10,5,10,5"
                            Content="{Binding Content}"
                            FontSize="22" 
                            FontWeight="Bold"
                            VerticalAlignment="Center" 
                            VerticalContentAlignment="Center"
                            HorizontalAlignment="Left"
                            HorizontalContentAlignment="Left"
                            />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter 
                                TargetName="PART_Border" 
                                Property="BorderBrush"
                                Value="DeepSkyBlue"
                                />
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter 
                                TargetName="PART_Border"
                                Property="Background"
                                Value="DeepSkyBlue"
                                />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\CustomCollectionView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Views.CustomCollectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Views"
             xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Views.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="CustomQuestionTemplate.xaml"/>
                <ResourceDictionary>
                    <converters:CustomQuestionTemplateSelector x:Key="questionSelector"/>
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <!--Навигация по списку вопросов-->
        <local:QuestionsCollectionNavigationView DataContext="{Binding}"
                                                Visibility="Collapsed"
                                                />
        <Grid Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <!--Панель с информацией о тестировании-->
            <local:QuestionsCollectionInformationView Grid.Row="0"
                                                      DataContext="{Binding}"
                                                      />
            <!--Поле вопроса-->
            <ContentControl Grid.Row="1" Content="{Binding CurrentQuestion, Mode=OneWay}" ContentTemplateSelector="{StaticResource questionSelector}"/>


            <!--Кнопки управления тестированием-->
            <local:QuestionsCollectionControlView Grid.Row="2"
                                                 DataContext="{Binding}"
                                                 />
        </Grid>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\CustomCollectionView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Views
{
    /// <summary>
    /// Interaction logic for CustomCollectionView.xaml
    /// </summary>
    public partial class CustomCollectionView : UserControl
    {
        public CustomCollectionView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\CustomQuestionnairesView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Views.CustomQuestionnairesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Views"
             xmlns:viewModels="clr-namespace:Updk7.Tests.Wpf.Questionnaires.ViewModels"
             xmlns:lusherViewModels="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Lusher.ViewModels"
             xmlns:lusherViews="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Lusher.Views"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid>
        <Grid.Resources>
            <DataTemplate DataType="{x:Type viewModels:InstructionViewModel}">
                <local:InstructionView />
            </DataTemplate>
            <DataTemplate DataType="{x:Type viewModels:QuestionsCollectionViewModel}">
                <local:CustomCollectionView />
            </DataTemplate>
            <DataTemplate DataType="{x:Type lusherViewModels:LusherCollectionViewModel}">
                <lusherViews:LusherCollectionView />
            </DataTemplate>
            <DataTemplate DataType="{x:Type viewModels:TestCompleteViewModel}">
                <local:TestCompleteView />
            </DataTemplate>
            <DataTemplate DataType="{x:Type viewModels:TestBreakViewModel}">
                <local:TestBreakView />
            </DataTemplate>
        </Grid.Resources>
        <ContentPresenter 
            Content="{Binding CurrentViewModel}"
            />
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\CustomQuestionnairesView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Views
{
    /// <summary>
    /// Interaction logic for CustomQuestionnairesView.xaml
    /// </summary>
    public partial class CustomQuestionnairesView : UserControl
    {
        public CustomQuestionnairesView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\CustomQuestionTemplate.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:san="clr-namespace:Updk7.Tests.Wpf.Questionnaires.SAN.Views"
                    xmlns:sr="clr-namespace:Updk7.Tests.Wpf.Questionnaires.SR.Views"
                    xmlns:rokich="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Rokich.Views">

    <DataTemplate x:Key="San">
        <san:SanQuestionView VerticalAlignment="Stretch"
                             Grid.Row="1"
                             DataContext="{Binding}"
                             />
    </DataTemplate>

    <DataTemplate x:Key="SR">
        <sr:SRView VerticalAlignment="Stretch"
                             Grid.Row="1"
                             DataContext="{Binding}"
                             />
    </DataTemplate>

    <DataTemplate x:Key="Rokich">
        <rokich:RokichView VerticalAlignment="Stretch"
                             Grid.Row="1"
                             DataContext="{Binding}"
                             />
    </DataTemplate>
    
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\InstructionView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Views.InstructionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" >
    <Grid
        DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <FlowDocumentScrollViewer
            Grid.Row="0"
            Background="Transparent"
            Document="{Binding Data}"
            ScrollViewer.VerticalScrollBarVisibility="Auto"
            />
        <Button 
            Grid.Row="1"
            Margin="5"
            FontSize="20"
            Height="35"
            Padding="15,0,15,0"
            FontWeight="Bold"
            VerticalAlignment="Center"
            HorizontalAlignment="Right"
            Content="Начать тестирование"
            Style="{StaticResource FlatButtonStyle}"
            Command="{Binding StartTestingCommand}"
            />
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\InstructionView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Views
{
    /// <summary>
    /// Interaction logic for InstructionView.xaml
    /// </summary>
    public partial class InstructionView : UserControl
    {
        public InstructionView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\QuestionnaireView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Views.QuestionnaireView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Views"
             xmlns:viewModels="clr-namespace:Updk7.Tests.Wpf.Questionnaires.ViewModels"
             mc:Ignorable="d" >
    <Grid>
        <Grid.Resources>
            <DataTemplate DataType="{x:Type viewModels:InstructionViewModel}">
                <local:InstructionView />
            </DataTemplate>
            <DataTemplate DataType="{x:Type viewModels:QuestionsCollectionViewModel}">
                <local:QuestionsCollectionView />
            </DataTemplate>
            <DataTemplate DataType="{x:Type viewModels:TestCompleteViewModel}">
                <local:TestCompleteView />
            </DataTemplate>
            <DataTemplate DataType="{x:Type viewModels:TestBreakViewModel}">
                <local:TestBreakView />
            </DataTemplate>
        </Grid.Resources>
        <ContentPresenter 
            Content="{Binding CurrentViewModel}"
            />
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\QuestionnaireView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Views
{
    /// <summary>
    /// Interaction logic for QuestionnaireView.xaml
    /// </summary>
    public partial class QuestionnaireView : UserControl
    {
        public QuestionnaireView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\QuestionsCollectionControlView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Views.QuestionsCollectionControlView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Views"
             xmlns:converters="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Views.Converters"
             mc:Ignorable="d" 
             MinWidth="500">
    <Grid>
        <Button 
            Grid.Row="2"
            Margin="5"
            Content="Назад"
            FontSize="20"
            FontWeight="Bold"
            VerticalAlignment="Center"
            HorizontalAlignment="Left"
            Width="120"
            Height="35"
            Style="{StaticResource FlatButtonStyle}"
            Command="{Binding MoveToPreviousQuestionCommand}"
            />
        <Button 
            Grid.Row="2"
            Margin="5"
            Content="Завершить тест"
            FontSize="20"
            FontWeight="Bold"
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            Width="180"
            Height="35"
            Style="{StaticResource FlatButtonStyle}"
            Command="{Binding TestCompleteCommand}"
            Visibility="{Binding CanTestComplete, Converter={converters:BoolToVisibilityConverter}}"
            />
        <Button 
            Grid.Row="2"
            Margin="5"
            Content="Вперед"
            FontSize="20"
            FontWeight="Bold"
            VerticalAlignment="Center"
            HorizontalAlignment="Right"
            Width="120"
            Height="35"
            Style="{StaticResource FlatButtonStyle}"
            Command="{Binding MoveToNextQuestionCommand}"
            />
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\QuestionsCollectionControlView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Views
{
    /// <summary>
    /// Interaction logic for QuestionsCollectionControlView.xaml
    /// </summary>
    public partial class QuestionsCollectionControlView : UserControl
    {
        public QuestionsCollectionControlView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\QuestionsCollectionInformationView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Views.QuestionsCollectionInformationView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <!--Номер вопроса-->
        <TextBlock 
            Grid.Row="0"
            HorizontalAlignment="Right"
            FontSize="14"
            FontWeight="DemiBold">
            <Run Text="{Binding AnsweredQuestionsCount, Mode=OneWay}" />
            <Run Text=" / " />
            <Run Text="{Binding Questions.Count, Mode=OneWay}" />
        </TextBlock>
        <!--Оставшееся время-->
        <TextBlock
            Grid.Row="1"
            HorizontalAlignment="Right"
            FontSize="16"
            Foreground="Orange" 
            Text="{Binding TimeLeftFormat}"
            />
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\QuestionsCollectionInformationView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Views
{
    /// <summary>
    /// Interaction logic for QuestionsCollectionInformationView.xaml
    /// </summary>
    public partial class QuestionsCollectionInformationView : UserControl
    {
        public QuestionsCollectionInformationView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\QuestionsCollectionNavigationView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Views.QuestionsCollectionNavigationView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <TextBlock 
            Grid.Row="0"
            Margin="5"
            Text="Навигация"
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            FontSize="16"
            FontWeight="Bold"
            />
        <ListView
            Grid.Row="1"
            Margin="5"
            Background="Transparent"
            ItemsSource="{Binding Questions}"
            SelectedItem="{Binding CurrentQuestion}"
            IsSynchronizedWithCurrentItem="True">
            <ListView.ItemContainerStyle>
                <Style TargetType="{x:Type ListViewItem}">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ListViewItem}">
                                <Border
                                    x:Name="PART_ElementBorder"
                                    Margin="3"
                                    Padding="10,3,10,3"
                                    BorderBrush="DeepSkyBlue"
                                    BorderThickness="2">
                                    <TextBlock 
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        FontSize="16"
                                        FontWeight="Bold"
                                        Text="{Binding Title}"
                                        />
                                </Border>
                                <ControlTemplate.Triggers>
                                    <DataTrigger Binding="{Binding IsDirty}" Value="true">
                                        <Setter 
                                            TargetName="PART_ElementBorder" 
                                            Property="BorderBrush"
                                            Value="DarkGray"
                                            />
                                    </DataTrigger>
                                    <Trigger Property="IsSelected" Value="True">
                                        <Setter 
                                            TargetName="PART_ElementBorder" 
                                            Property="BorderBrush" 
                                            Value="LimeGreen" 
                                            />
                                    </Trigger>
                                    <MultiTrigger>
                                        <MultiTrigger.Conditions>
                                            <Condition Property="IsMouseOver" Value="True" />
                                            <Condition Property="IsSelected" Value="False" />
                                        </MultiTrigger.Conditions>
                                        <Setter 
                                            TargetName="PART_ElementBorder" 
                                            Property="BorderBrush" 
                                            Value="Orange" 
                                            />
                                    </MultiTrigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListView.ItemContainerStyle>
        </ListView>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\QuestionsCollectionNavigationView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Views
{
    /// <summary>
    /// Interaction logic for QuestionsCollectionNavigationView.xaml
    /// </summary>
    public partial class QuestionsCollectionNavigationView : UserControl
    {
        public QuestionsCollectionNavigationView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\QuestionsCollectionView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Views.QuestionsCollectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:views="clr-namespace:Updk7.Tests.Wpf.Questionnaires.Views"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <!--Навигация по списку вопросов-->
        <views:QuestionsCollectionNavigationView 
            DataContext="{Binding}"
            Visibility="Collapsed"
            />
        <Grid
            Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <!--Панель с информацией о тестировании-->
            <views:QuestionsCollectionInformationView 
                Grid.Row="0"
                DataContext="{Binding}"
                />
            <!--Поле вопроса-->
            <views:QuestionView 
                VerticalAlignment="Stretch"
                Grid.Row="1"
                DataContext="{Binding CurrentQuestion, Mode=OneWay}"
                />
            <!--Кнопки управления тестированием-->
            <views:QuestionsCollectionControlView 
                Grid.Row="2"
                DataContext="{Binding}"
                />
        </Grid>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\QuestionsCollectionView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Views
{
    /// <summary>
    /// Interaction logic for QuestionsCollectionView.xaml
    /// </summary>
    public partial class QuestionsCollectionView : UserControl
    {
        public QuestionsCollectionView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\QuestionView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Views.QuestionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:viewModels="clr-namespace:Updk7.Tests.Wpf.Questionnaires.ViewModels"
             mc:Ignorable="d" >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="AnswerCheckBoxStyle.xaml" />
                <ResourceDictionary Source="AnswerRadioButtonStyle.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.Resources>
            <Style x:Key="AnswersItemsControlStyle" TargetType="{x:Type ItemsControl}">
                <Style.Triggers>
                    <!--Шаблон ответов SingleChoice-->
                    <DataTrigger Binding="{Binding AnswersType}" Value="SingleChoice">
                        <Setter Property="ItemTemplate">
                            <Setter.Value>
                                <DataTemplate DataType="{x:Type viewModels:AnswerViewModel}">
                                    <RadioButton 
                                        Margin="5"
                                        Style="{StaticResource AnswerRadioButtonStyle}"
                                        Content="{Binding Content}"
                                        IsChecked="{Binding IsSelected}"
                                        Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, 
                                            AncestorType={x:Type UserControl}}, 
                                            Path=DataContext.MoveToNextQuestionCommand}"
                                        GroupName="AnswerButton"
                                        SnapsToDevicePixels="True"
                                        />
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                    <!--Шаблон ответов MultiChoice-->
                    <DataTrigger Binding="{Binding AnswersType}" Value="MultiChoice">
                        <Setter Property="ItemTemplate">
                            <Setter.Value>
                                <DataTemplate DataType="{x:Type viewModels:AnswerViewModel}">
                                    <CheckBox 
                                        Margin="5"
                                        Style="{StaticResource AnswerCheckBoxStyle}"
                                        Content="{Binding Content}"
                                        IsChecked="{Binding IsSelected}"
                                        SnapsToDevicePixels="True"
                                        />
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                    <!--Шаблон ответов Text-->
                    <DataTrigger Binding="{Binding AnswersType}" Value="Text">
                        <Setter Property="ItemTemplate">
                            <Setter.Value>
                                <DataTemplate DataType="{x:Type viewModels:AnswerViewModel}">
                                    <Grid
                                        Margin="5">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="2*" />
                                            <ColumnDefinition Width="1*" />
                                        </Grid.ColumnDefinitions>
                                        <TextBlock 
                                            Grid.Column="0"
                                            Text="Введите ответ в текстовое поле "
                                            FontSize="20"
                                            TextWrapping="WrapWithOverflow"
                                            FontWeight="DemiBold"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Right"
                                            />
                                        <TextBox 
                                            Grid.Column="1"
                                            Margin="10,0,0,0"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left"
                                            FontSize="22"
                                            FontWeight="DemiBold"
                                            Text="{Binding EnteredText, UpdateSourceTrigger=PropertyChanged}"
                                            Width="100"
                                            />
                                    </Grid>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </Grid.Resources>
        <!--Содержание вопроса-->
        <TextBlock
            Grid.Row="0"
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            Text="{Binding Text}"
            FontSize="26"
            FontWeight="Bold"
            TextWrapping="Wrap"
            TextAlignment="Center"
            />
        <!--Варианты ответов-->
        <ScrollViewer
            Grid.Row="1"
            HorizontalScrollBarVisibility="Disabled"
            VerticalScrollBarVisibility="Auto">
            <ItemsControl
                Grid.Row="1"
                Margin="10,10,10,20"
                HorizontalContentAlignment="Stretch"
                HorizontalAlignment="Center"
                VerticalAlignment="Bottom"
                BorderBrush="Transparent"
                BorderThickness="0"
                Background="Transparent"
                Style="{StaticResource AnswersItemsControlStyle}"
                ItemsSource="{Binding Answers}">
            </ItemsControl>
        </ScrollViewer>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\QuestionView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Views
{
    /// <summary>
    /// Interaction logic for QuestionView.xaml
    /// </summary>
    public partial class QuestionView : UserControl
    {
        public QuestionView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\TestBreakView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Views.TestBreakView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" >
    <Grid>
        <TextBlock 
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            FontSize="26"
            FontWeight="Bold"
            Text="Тест прерван психологом"
            />
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\TestBreakView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Views
{
    /// <summary>
    /// Interaction logic for TestBreakView.xaml
    /// </summary>
    public partial class TestBreakView : UserControl
    {
        public TestBreakView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\TestCompleteView.xaml

<UserControl x:Class="Updk7.Tests.Wpf.Questionnaires.Views.TestCompleteView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" >
    <Grid>
        <TextBlock 
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            FontSize="26"
            FontWeight="Bold"
            Text="Тест завершён"
            />
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\TestCompleteView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Tests.Wpf.Questionnaires.Views
{
    /// <summary>
    /// Interaction logic for TestCompleteView.xaml
    /// </summary>
    public partial class TestCompleteView : UserControl
    {
        public TestCompleteView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\Converters\BoolToVisibilityConverter.cs


using System;
using System.Windows;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;

namespace Updk7.Tests.Wpf.Questionnaires.Views.Converters
{
    [ValueConversion(typeof(bool), typeof(Visibility))]
    public class BoolToVisibilityConverter : MarkupExtension, IValueConverter
    {
        public BoolToVisibilityConverter()
        {
        }

        public Visibility TrueVisibility { get; set; } = Visibility.Visible;

        public Visibility FalseVisibility { get; set; } = Visibility.Collapsed;

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            return this;
        }

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return (bool)value ? TrueVisibility : FalseVisibility;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Source\Questionnaires\Views\Converters\CustomQuestionTemplateSelector.cs


using System.Windows;
using System.Windows.Controls;

namespace Updk7.Tests.Wpf.Questionnaires.Views.Converters
{
    public class CustomQuestionTemplateSelector : DataTemplateSelector
    {
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            //получаем вызывающий контейнер
            FrameworkElement element = container as FrameworkElement;
            if (item != null && item is ViewModels.QuestionViewModel)
                switch (item.GetType().Name)
                {
                    case nameof(SAN.ViewModels.SanQuestionViewModel):
                        var san = (container as FrameworkElement).FindResource("San") as DataTemplate;
                        return san;

                    case nameof(SR.ViewModels.SRViewModel):
                        var sr = (container as FrameworkElement).FindResource("SR") as DataTemplate;
                        return sr;

                    case nameof(Rokich.ViewModels.RokichViewModel):
                        var rokich = (container as FrameworkElement).FindResource("Rokich") as DataTemplate;
                        return rokich;
                }
            return null;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Tests\Updk7.Tests.Wpf\Themes\Generic.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Updk7.Wpf;component/Themes/Generic.xaml" />
    </ResourceDictionary.MergedDictionaries>

</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\NavigationKeys.cs


namespace Updk7.Wpf.Slave.Assets
{
    public static class NavigationKeys
    {
        public static readonly string Welcome = "Wellcome";
        public static readonly string Testing = "Testing";
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\SlaveConfiguration.cs


namespace Updk7.Wpf.Slave.Assets
{
    public class SlaveConfiguration : ConfigurationBase
    {
        public SlaveConfiguration(string fileName) : base(fileName)
        {
        }

        public string ServerAddress { get; set; } = "localhost:27040";

        public string InstanceName { get; set; } = "Рабочее место 1";

        public int DefaultScreen { get; set; } = 1;
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\TestLauncher.cs


using System;
using System.ComponentModel;
using System.Windows;
using System.Diagnostics;
using System.Collections.Generic;

namespace Updk7.Wpf.Slave.Assets
{
    public class TestLauncher : Prism.Mvvm.BindableBase
    {
        private class ErrorStrings
        {
            public static readonly string PultNotConnected = "Пульт не подключен";
            public static readonly string RutokenNotConnected = "Ключ активации Rutoken не подключен";
            public static readonly string TestError = "Ошибка выполнения теста";
        }

        private Tests.Wpf.ITestsRepository _testsRepository = new Tests.Wpf.TestsRepository();
        private Tests.Pult.UpdkDeskMonitor _deskMonitor = new Tests.Pult.UpdkDeskMonitor();
        private Tests.ITest _currentTest;
        private Exception _currentTestException;
        
        private Network.Local.Slave.UpdkServiceProxy _serviceProxy;
        private Shell.IShellController _shellController;
        private Rutoken.Common.RutokenMonitor _rutokenMonitor;
        private DateTime _testBeginTime;

        public TestLauncher(Network.Local.Slave.UpdkServiceProxy serviceProxy,
            Rutoken.Common.RutokenMonitor rutokenMonitor,
            Shell.IShellController shellController)
        {
            _serviceProxy = serviceProxy;
            _serviceProxy.StartTest += onServiceProxyStartTest;
            _serviceProxy.ShowWelcome += onServiceProxyShowWelcome;
            _serviceProxy.BreakTest += onServiceProxyBreakTest;
            _serviceProxy.PropertyChanged += onServiceProxyPropertyChanged;

            ServiceAddress = _serviceProxy.ServiceAddress;
            InstanceName = _serviceProxy.InstanceName;
            IsConnected = _serviceProxy.IsConnected;

            _rutokenMonitor = rutokenMonitor;
            _rutokenMonitor.FeaturesChanged += onRutokenMonitorFeaturesChanged;

            _shellController = shellController;
            _deskMonitor.IsConnectedChanged += onPultMonitorIsConnectedChanged;
            _deskMonitor.Start();

            setServiceErrors();
        }

        public string ServiceAddress { get; }

        public string InstanceName { get; }

        private FrameworkElement _testView;

        public FrameworkElement TestView
        {
            get { return _testView; }
            private set { SetProperty(ref _testView, value); }
        }

        private bool _isBusy;

        public bool IsBusy
        {
            get { return _isBusy; }
            private set { SetProperty(ref _isBusy, value); }
        }

        private bool _isConnected;

        public bool IsConnected
        {
            get { return _isConnected; }
            private set { SetProperty(ref _isConnected, value); }
        }

        private string[] _errors;

        public string[] Errors
        {
            get { return _errors; }
            private set { SetProperty(ref _errors, value); }
        }

        private void onServiceProxyStartTest(object sender, Network.Local.Slave.StartTestEventArgs e)
        {
            Debug.Assert(_currentTest == null);

            AppLog.Current.Info("*** Run test: " + e.Test.ToString());

            var deskTransport = _deskMonitor.GetTransport();
            if (deskTransport == null)
            {
                AppLog.Current.Error("Desk transport creation failed");
                setServiceErrors();
                return;
            }

            _shellController.NavigateTo(NavigationKeys.Testing);

            _currentTestException = null;
            _currentTest = _testsRepository.GetTest(e.Test, deskTransport);
            subscribeToTestEvents(_currentTest);
            TestView = _testsRepository.GetView(e.Test);
            TestView.DataContext = _currentTest;
            _currentTest.Start(e.Parameters);
            _testBeginTime = DateTime.Now;
            
            IsBusy = true;
        }

        private void onServiceProxyBreakTest(object sender, EventArgs e)
        {
            AppLog.Current.Info("Test cancelled by the psychologist");

            if (_currentTest != null)
            {
                _currentTest.Break();
                clearCurrentTest();
                navigateToWelcomeScreen();
            }
        }

        private void onServiceProxyShowWelcome(object sender, EventArgs e)
        {
            navigateToWelcomeScreen();
        }

        private void onTestPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(Tests.ITest.TestProgress))
                _serviceProxy.SetTestProgress(_currentTest.TestProgress);
        }

        private void onTestComplete(object sender, Tests.TestCompleteEventArgs e)
        {
            e.Results.BeginTime = _testBeginTime;
            e.Results.EndTime = DateTime.Now;

            AppLog.Current.Info("Test complete");

            _currentTestException = e.Exception;
            if (_currentTestException != null)
            {
                e.Results.AddException(_currentTestException);
                AppLog.Current.Error(e.Exception.ToString());
                setServiceErrors();
            }

            _serviceProxy.SetTestResults(e.Results);
            
            clearCurrentTest();
        }

        private void onPultMonitorIsConnectedChanged(object sender, EventArgs e)
        {
            setServiceErrors();
        }

        private void onRutokenMonitorFeaturesChanged(object sender, EventArgs e)
        {
            setServiceErrors();
        }

        private void onServiceProxyPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(_serviceProxy.IsConnected))
            {
                IsConnected = _serviceProxy.IsConnected;
                setServiceErrors();

                if (!_serviceProxy.IsConnected && IsBusy)
                {
                    clearCurrentTest();
                    navigateToWelcomeScreen();
                }
            }
        }

        private void navigateToWelcomeScreen()
        {
            AppLog.Current.Info("To welcome screen");

            Debug.Assert(_currentTest == null);
            _shellController.NavigateTo(NavigationKeys.Welcome);
        }

        private void setServiceErrors()
        {
            var pultError = !_deskMonitor.IsConnected;
            _serviceProxy.SetError(Network.Local.ErrorFlags.HardwareError, pultError);

            var rutokenError = !_rutokenMonitor.ContainsFeature();
            _serviceProxy.SetError(Network.Local.ErrorFlags.ActivationKey, rutokenError);

            var testError = _currentTestException != null;
            _serviceProxy.SetError(Network.Local.ErrorFlags.TestInternalError, testError);

            var errorList = new List<string>();
            if (pultError)
                errorList.Add(ErrorStrings.PultNotConnected);
            if (rutokenError)
                errorList.Add(ErrorStrings.RutokenNotConnected);
            if (testError)
                errorList.Add(ErrorStrings.TestError);

            if (errorList.Count == 0)
                Errors = null;
            else
            {
                Errors = errorList.ToArray();
                foreach (var e in Errors)
                    AppLog.Current.Error(e);
            }
        }

        private void subscribeToTestEvents(Tests.ITest test)
        {
            if (test != null)
            {
                test.PropertyChanged += onTestPropertyChanged;
                test.TestComplete += onTestComplete;
            }
        }

        private void unscribeFromTestEvents(Tests.ITest test)
        {
            if (test != null)
            {
                test.PropertyChanged -= onTestPropertyChanged;
                test.TestComplete -= onTestComplete;
            }
        }

        private void clearCurrentTest()
        {
            if (_currentTest != null)
            {
                unscribeFromTestEvents(_currentTest);
                _currentTest = null;
                TestView.DataContext = null;
                TestView = null;
            }

            IsBusy = false;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\Commands\ChangeSettingsCommand.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Updk7.Wpf.Slave.Assets.Commands
{
    public class ChangeSettingsCommand : Wpf.Commands.CommandBase
    {
        private SlaveConfiguration _configuration;

        public ChangeSettingsCommand(SlaveConfiguration configuration)
        {
            _configuration = configuration;
        }

        public override bool CanExecute(object parameter) => true;

        public override void Execute(object parameter)
        {
            var interaction = new Assets.Interactions.ChangeSettingsInteraction();
            interaction.InteractionData.SetupData(_configuration);
            Wpf.Interactions.InteractionService.Current.ShowInteractionModel(interaction, () => 
            {
                if (interaction.Confirmed && !interaction.InteractionData.HasErrors)
                {
                    try
                    {
                        interaction.InteractionData.UpdateData(_configuration);
                        _configuration.Save();
                    }
                    catch (Exception ex)
                    {
                        var message = "Не удалось сохранить файл конфигурации\n" + ex.Message;
                        Wpf.Interactions.InteractionService.Current.ShowErrorMessage(message);
                        AppLog.Current.Error(message);
                    }
                }
            });
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\Commands\CommandKeys.cs


namespace Updk7.Wpf.Slave.Assets.Commands
{
    public enum CommandKeys
    {
        Shutdown,
        ChangeSettings
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\Commands\ShutdownCommand.cs


namespace Updk7.Wpf.Slave.Assets.Commands
{
    public class ShutdownCommand : Wpf.Commands.CommandBase
    {
        private AppManager _appManager;

        public ShutdownCommand(AppManager appManager)
        {
            _appManager = appManager;
        }

        public override bool CanExecute(object parameter) => true;

        public override void Execute(object parameter)
        {
            _appManager.Shutdown();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\Interactions\ChangeSettingsInteraction.cs


using System.ComponentModel;

namespace Updk7.Wpf.Slave.Assets.Interactions
{
    public class ChangeSettingsInteraction : Wpf.Interactions.ConfirmationInteraction
    {
        public ChangeSettingsInteraction()
        {
            InteractionData.PropertyChanged += onInteractionDataChanged;
        }

        protected override bool CanConfirm() => !InteractionData.HasErrors;

        public ViewModels.SettingsViewModel InteractionData { get; } = new ViewModels.SettingsViewModel();

        private void onInteractionDataChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(InteractionData.HasErrors))
                AcceptCommand.RaiseCanExecuteChanged();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\Interactions\Views\ChangeSettingsInteractionView.xaml

<UserControl x:Class="Updk7.Wpf.Slave.Assets.Interactions.Views.ChangeSettingsInteractionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Wpf.Slave.Assets.Interactions.Views"
             xmlns:views="clr-namespace:Updk7.Wpf.Slave.Assets.Views"
             mc:Ignorable="d" 
             Width="500">
    <Grid
        Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <!--Заголовок панели-->
        <Grid
            Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="40" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Image
                Grid.Column="0" 
                Margin="5"
                Source="{StaticResource SettingsImage}" />
            <TextBlock 
                Grid.Column="1"
                FontSize="18"
                FontWeight="Bold"
                Margin="5,1,1,1"
                VerticalAlignment="Center"
                HorizontalAlignment="Left"
                Text="Редактирование настроек приложения"
                />
        </Grid>
        <!--Панель редактора-->
        <Grid
            Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock 
                Grid.Row="0"
                Text="Новые настройки вступят в силу после перезапуска приложения"
                VerticalAlignment="Center"
                HorizontalAlignment="Center"
                FontSize="14"
                FontWeight="Medium"
                Margin="0,3,0,5"
                />
            <views:SettingsView 
                Grid.Row="1"
                DataContext="{Binding InteractionData}"
                />
        </Grid>
        <!--Кнопки управления-->
        <Grid
            Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <!--Кнопка Применить-->
            <Button 
                Grid.Column="1"
                Width="80"
                Height="30"
                HorizontalAlignment="Right"
                FontSize="14"
                FontWeight="Bold"
                Content="Принять"
                Command="{Binding AcceptCommand}"
                Margin="3"
                Style="{StaticResource FlatButtonStyle}"
                />
            <!--Кнопка Отменить-->
            <Button 
                Grid.Column="2"
                Width="80"
                Height="30"
                FontSize="14"
                FontWeight="Bold"
                HorizontalAlignment="Right"
                Content="Отменить"
                Command="{Binding CancelCommand}"
                Margin="3"
                Style="{StaticResource FlatButtonStyle}"
                />
        </Grid>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\Interactions\Views\ChangeSettingsInteractionView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Wpf.Slave.Assets.Interactions.Views
{
    /// <summary>
    /// Interaction logic for ChangeSettingsInteractionView.xaml
    /// </summary>
    public partial class ChangeSettingsInteractionView : UserControl
    {
        public ChangeSettingsInteractionView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\ViewModels\SettingsViewModel.cs


using System;

namespace Updk7.Wpf.Slave.Assets.ViewModels
{
    public class SettingsViewModel : Wpf.Validation.ValidatedBindableBase
    {
        private static class Errors
        {
            public static readonly string InstanceName = "Наименование рабочего места не должно быть пустым";
            public static readonly string ServerAddress = "Некорректный сетевой адрес ведущего (<ip-адрес/имя компьютера>:<номер порта>)";
        }

        public SettingsViewModel()
        {
            setupValidationRules();
        }

        private string _serverAddress;

        public string ServerAddress
        {
            get { return _serverAddress; }
            set { SetProperty(ref _serverAddress, value); }
        }

        private string _instanceName;

        public string InstanceName
        {
            get { return _instanceName; }
            set { SetProperty(ref _instanceName, value); }
        } 

        public void SetupData(Assets.SlaveConfiguration configuration)
        {
            ServerAddress = configuration.ServerAddress;
            InstanceName = configuration.InstanceName;
        }

        public void UpdateData(Assets.SlaveConfiguration configuration)
        {
            configuration.InstanceName = InstanceName;
            configuration.ServerAddress = ServerAddress;
        }

        private void setupValidationRules()
        {
            ErrorsContainer.AddValidationRule(
                nameof(ServerAddress),
                () =>
                {
                    var address = parseServerAddress();
                    return address != null && address.Item2 > 0 && address.Item2 < 65535;
                },
                Errors.ServerAddress);

            ErrorsContainer.AddValidationRule(
                nameof(InstanceName),
                () => !string.IsNullOrEmpty(InstanceName),
                Errors.InstanceName);

            ErrorsContainer.UpdateValidation();
        }

        private Tuple<string, int> parseServerAddress()
        {
            if (string.IsNullOrEmpty(ServerAddress))
                return null;

            var parts = ServerAddress.Split(':');
            if (parts.Length != 2)
                return null;

            var port = 0;
            if (!int.TryParse(parts[1], out port))
                return null;

            return Tuple.Create(parts[0], port);
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\ViewModels\TestingViewModel.cs


using System.ComponentModel;
using System.Windows;

namespace Updk7.Wpf.Slave.Assets.ViewModels
{
    public class TestingViewModel : Prism.Mvvm.BindableBase
    {
        private TestLauncher _testLauncher;

        public TestingViewModel(TestLauncher testLauncher)
        {
            _testLauncher = testLauncher;
            _testLauncher.PropertyChanged += onTestLauncherPropertyChanged;
        }

        private FrameworkElement _testView;

        public FrameworkElement TestView
        {
            get { return _testView; }
            private set { SetProperty(ref _testView, value); }
        }

        private void onTestLauncherPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(TestLauncher.TestView))
                TestView = _testLauncher.TestView;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\ViewModels\WelcomeViewModel.cs


using System.ComponentModel;

namespace Updk7.Wpf.Slave.Assets.ViewModels
{
    public class WelcomeViewModel : Prism.Mvvm.BindableBase
    {
        private TestLauncher _testLauncher;

        public WelcomeViewModel(TestLauncher testsLauncher)
        {
            _testLauncher = testsLauncher;
            _testLauncher.PropertyChanged += onTestLauncherPropertyChanged;

            ServerAddress = testsLauncher.ServiceAddress;
            WorkplaceName = testsLauncher.InstanceName;
            updateProperties();
        }

        private string _serverAddress;

        public string ServerAddress
        {
            get { return _serverAddress; }
            private set { SetProperty(ref _serverAddress, value); }
        }

        private bool _isServerConnected;

        public bool IsServerConnected
        {
            get { return _isServerConnected; }
            private set { SetProperty(ref _isServerConnected, value); }
        }

        private string _workplaceName;

        public string WorkplaceName
        {
            get { return _workplaceName; }
            private set { SetProperty(ref _workplaceName, value); }
        }

        private string _errorMessage;

        public string ErrorMessage
        {
            get { return _errorMessage; }
            private set { SetProperty(ref _errorMessage, value); }
        } 

        private void onTestLauncherPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(TestLauncher.IsConnected) ||
                e.PropertyName == nameof(TestLauncher.Errors))
            {
                updateProperties();
            }
        }

        private void updateProperties()
        {
            IsServerConnected = _testLauncher.IsConnected;

            ErrorMessage = _testLauncher.Errors != null && _testLauncher.Errors.Length != 0
                ? string.Join(", ", _testLauncher.Errors)
                : string.Empty;
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\Views\SettingsView.xaml

<UserControl x:Class="Updk7.Wpf.Slave.Assets.Views.SettingsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Updk7.Wpf.Slave.Assets.Views"
             mc:Ignorable="d">
    <Grid>
        <Grid.Resources>
            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="14" />
                <Setter Property="HorizontalAlignment" Value="Left" />
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="Margin" Value="5,3,5,3" />
            </Style>
            <Style TargetType="{x:Type TextBox}">
                <Setter Property="FontSize" Value="14" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter Property="HorizontalAlignment" Value="Stretch" />
                <Setter Property="VerticalAlignment" Value="Center" />
                <Style.Triggers>
                    <Trigger Property="Validation.HasError" Value="True">
                        <Setter Property="ToolTip"
                                Value="{Binding RelativeSource={RelativeSource Self}, 
                                Path=(Validation.Errors)[0].ErrorContent}"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <!--Наименование рабочего места-->
        <TextBlock Grid.Row="0" Grid.Column="0" Text="Имя рабочего места" />
        <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding InstanceName, UpdateSourceTrigger=PropertyChanged}" />
        <!--Сетевой адрес-->
        <TextBlock Grid.Row="1" Grid.Column="0" Text="Адрес ведущего" />
        <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ServerAddress, UpdateSourceTrigger=PropertyChanged}" />
        <!--Сообщение об ошибке-->
        <TextBlock
            Grid.Row="2"
            Grid.ColumnSpan="2"
            Foreground="Red"
            Margin="3"
            Text="{Binding LastError}"
            />
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\Views\SettingsView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Wpf.Slave.Assets.Views
{
    /// <summary>
    /// Interaction logic for SettingsView.xaml
    /// </summary>
    public partial class SettingsView : UserControl
    {
        public SettingsView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\Views\TestingView.xaml

<UserControl x:Class="Updk7.Wpf.Slave.Assets.Views.TestingView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:prism="http://prismlibrary.com/"
             prism:ViewModelLocator.AutoWireViewModel="True"
             mc:Ignorable="d" 
             d:DesignHeight="450" 
             d:DesignWidth="800">
    <Grid>
        <ContentControl 
            Content="{Binding TestView}"
            />
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\Views\TestingView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Wpf.Slave.Assets.Views
{
    /// <summary>
    /// Interaction logic for TestingView.xaml
    /// </summary>
    public partial class TestingView : UserControl
    {
        public TestingView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\Views\WelcomeView.xaml

<UserControl x:Class="Updk7.Wpf.Slave.Assets.Views.WelcomeView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:commands="clr-namespace:Updk7.Wpf.Commands;assembly=Updk7.Wpf"
             xmlns:localCommands="clr-namespace:Updk7.Wpf.Slave.Assets.Commands"
             xmlns:prism="http://prismlibrary.com/"
             prism:ViewModelLocator.AutoWireViewModel="True"
             mc:Ignorable="d">
    <Grid>
        <Grid.Resources>
            <Style x:Key="ConnectionStateCheckBox" TargetType="{x:Type CheckBox}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type CheckBox}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Ellipse
                                    Grid.Column="0"
                                    x:Name="PART_Ellipse"
                                    Width="15"
                                    Height="15"
                                    Fill="Green"
                                    Stroke="Black"
                                    StrokeThickness="1"
                                    />
                                <TextBlock 
                                    Grid.Column="1"
                                    x:Name="PART_Text"
                                    Margin="5,3,3,3"
                                    Text="Сервер"
                                    VerticalAlignment="Center"
                                    TextAlignment="Left"
                                    FontWeight="Medium"
                                    />
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsChecked" Value="False">
                                    <Setter TargetName="PART_Ellipse" Property="Fill" Value="Red" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <!--Панель инструментов-->
        <DockPanel
            Grid.Row="0"
            Grid.Column="0"
            Grid.RowSpan="2"
            Width="45">
            <!--Кнопка выключения-->
            <Button
                Height="45"
                DockPanel.Dock="Bottom"
                VerticalAlignment="Bottom"
                Margin="0,0,0,5"
                Style="{StaticResource FlatButtonStyle}"
                ToolTip="Выход"
                BorderThickness="2"
                Command="{commands:CommandProvider {x:Static localCommands:CommandKeys.Shutdown}}">
                <Image Margin="3" Source="{StaticResource ShutdownImage}" />
            </Button>
            <Button
                DockPanel.Dock="Top"
                VerticalAlignment="Bottom"
                Height="45"
                Style="{StaticResource FlatButtonStyle}"
                ToolTip="Настройки приложения"
                Margin="0,0,0,5"
                Command="{commands:CommandProvider {x:Static localCommands:CommandKeys.ChangeSettings}}">
                <Image Margin="3" Source="{StaticResource SettingsImage}" />
            </Button>
        </DockPanel>
        <!--Состояние подключения-->
        <DockPanel
            Grid.Row="0"
            Grid.Column="1">
            <TextBlock 
                Margin="4,0,4,0"
                DockPanel.Dock="Right"
                HorizontalAlignment="Right"
                VerticalAlignment="Center">
                <Run Text="(" />
                <Run Text="{Binding ServerAddress, Mode=OneWay}" />
                <Run Text=")" />
            </TextBlock>
            <CheckBox 
                DockPanel.Dock="Right"
                HorizontalAlignment="Right"
                VerticalAlignment="Center"
                IsHitTestVisible="False"
                Style="{StaticResource ConnectionStateCheckBox}"
                IsChecked="{Binding IsServerConnected, Mode=OneWay}"
                />
        </DockPanel>
        <!--Название и рабочее место-->
        <Grid
            Grid.Row="1"
            Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*" />
                <RowDefinition Height="1*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock 
                Grid.Row="0"
                HorizontalAlignment="Center"
                VerticalAlignment="Bottom"
                Text="УПДК 7"
                FontWeight="Bold"
                FontSize="48"
                />
            <TextBlock 
                Grid.Row="1"
                HorizontalAlignment="Center"
                VerticalAlignment="Top"
                FontWeight="Medium"
                FontSize="22"
                Text="{Binding WorkplaceName}"
                />
            <TextBlock 
                Grid.Row="2"
                VerticalAlignment="Center"
                HorizontalAlignment="Left"
                Text="v. 7.6.7"
                FontSize="10"
                Margin="10,0,0,0"
                />
            <TextBlock
                Grid.Row="2"
                HorizontalAlignment="Right"
                VerticalAlignment="Bottom"
                Foreground="Red"
                Margin="5"
                FontSize="20"
                FontWeight="Bold"
                Text="{Binding ErrorMessage}"
                />
        </Grid>
    </Grid>
</UserControl>

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Source\Views\WelcomeView.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Updk7.Wpf.Slave.Assets.Views
{
    /// <summary>
    /// Interaction logic for WelcomeView.xaml
    /// </summary>
    public partial class WelcomeView : UserControl
    {
        public WelcomeView()
        {
            InitializeComponent();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave.Assets\Themes\Generic.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Updk7.Wpf;component/Themes/Generic.xaml" />
    </ResourceDictionary.MergedDictionaries>
    
</ResourceDictionary>
*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave\Source\App.xaml

<prism:PrismApplication x:Class="Updk7.Wpf.Slave.App"
                        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:prism="http://prismlibrary.com/"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        Startup="ApplicationStartup">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/Updk7.Wpf;component/Themes/Generic.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</prism:PrismApplication>

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave\Source\App.xaml.cs


using System.Windows;
using Prism.Ioc;

namespace Updk7.Wpf.Slave
{
    public partial class App
    {
        private Assets.SlaveConfiguration _configuration;
        private AppManager _appManager;

        private void ApplicationStartup(object sender, StartupEventArgs e)
        {
            _appManager = new AppManager(this, "Updk 7.0 - Slave");
            if (!_appManager.CanBoot)
                _appManager.Shutdown();
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            if (_appManager.CanBoot)
            {
                containerRegistry.RegisterInstance(_appManager);
                containerRegistry.RegisterInstance(_appManager.RutokenMonitor);
                _configuration = loadConfiguration(containerRegistry);
                createAppLog();

                createViewModelLocator();
                registerServiceProxy(containerRegistry);
                registerInteractions();
                registerCommands(containerRegistry);
                registerGuiParts(containerRegistry);
                registerTestsLauncher(containerRegistry);
            }
        }

        private Assets.SlaveConfiguration loadConfiguration(IContainerRegistry containerRegistry)
        {
            var settingsFile = $@"{_appManager.Folders.Settings}\{_appManager.AppName}.config";
            var configuration = new Assets.SlaveConfiguration(settingsFile);

            containerRegistry.RegisterInstance(configuration);

            return configuration;
        }

        private void createAppLog()
        {
            AppLog.Current = new AppLog(_appManager.Folders.Logs);
            AppLog.Current.CleanupLogFolder(20);
        }

        protected override Window CreateShell()
        {
            if (_appManager.CanBoot)
            {
                var shell = new ShellWindow();
                var useSecondScreen = _configuration.DefaultScreen == 2;

                if (useSecondScreen)
                {
                    shell.WindowState = WindowState.Normal;
                    Shell.WindowHelper.MoveToSecondScreen(shell);
                    shell.Show();
                    shell.WindowState = WindowState.Maximized;
                }

                _appManager.Shell = shell;

                var shellController = Container.Resolve<Shell.IShellController>();
                shellController.NavigateTo(Assets.NavigationKeys.Welcome);
            }

            return _appManager.Shell;
        }
        
        private void createViewModelLocator()
        {
            var regionManager = Container.Resolve<Prism.Regions.IRegionManager>();
            ViewModelLocator.Current = new ViewModelLocator(regionManager, Container);
        }

        private void registerInteractions()
        {
            Interactions.InteractionService.Current
                .Register<Assets.Interactions.ChangeSettingsInteraction, Assets.Interactions.Views.ChangeSettingsInteractionView>();
        }

        private void registerServiceProxy(IContainerRegistry containerRegistry)
        {
            var serviceProxy = new Network.Local.Slave.UpdkServiceProxy(_configuration.ServerAddress,
                _configuration.InstanceName);
            serviceProxy.Run();

            containerRegistry.RegisterInstance(serviceProxy);
        }

        private void registerCommands(IContainerRegistry containerRegistry)
        {
            Commands.CommandManager.Current = new Commands.CommandManager(containerRegistry, Container)
                .Register<Assets.Commands.ShutdownCommand>(Assets.Commands.CommandKeys.Shutdown)
                .Register<Assets.Commands.ChangeSettingsCommand>(Assets.Commands.CommandKeys.ChangeSettings);
        }

        private void registerGuiParts(IContainerRegistry containerRegistry)
        {
            var controller = new Shell.ShellController()
                .Register<Assets.Views.WelcomeView>(Assets.NavigationKeys.Welcome)
                .Register<Assets.Views.TestingView>(Assets.NavigationKeys.Testing);

            containerRegistry
                .RegisterInstance(controller)
                .RegisterSingleton<Assets.ViewModels.WelcomeViewModel>()
                .RegisterSingleton<Assets.ViewModels.TestingViewModel>();

            ViewModelLocator.Current
                .Register<Shell.IShellController, ShellWindow>()
                .Register<Assets.ViewModels.WelcomeViewModel, Assets.Views.WelcomeView>()
                .Register<Assets.ViewModels.TestingViewModel, Assets.Views.TestingView>();
        }

        private void registerTestsLauncher(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterSingleton<Assets.TestLauncher>();
        }
    }
}

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave\Source\ShellWindow.xaml

<Window x:Class="Updk7.Wpf.Slave.ShellWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:prism="http://prismlibrary.com/"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        prism:ViewModelLocator.AutoWireViewModel="True"
        WindowStartupLocation="CenterScreen"
        Background="{StaticResource WindowBackground}"
        WindowStyle="None"
        WindowState="Maximized"
        Title="УПДК - рабочее место испытуемого">
    <Grid>
        <ContentControl 
            Margin="3"
            Content="{Binding CurrentView}"
            />
    </Grid>
</Window>

*** File: D:\Projects\Tmp\Updk7\Updk7.Wpf\Updk7.Wpf.Slave\Source\ShellWindow.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Updk7.Wpf.Slave
{
    /// <summary>
    /// Interaction logic for ShellWindow.xaml
    /// </summary>
    public partial class ShellWindow : Window
    {
        public ShellWindow()
        {
            InitializeComponent();
        }
    }
}
