﻿namespace Samples
{
    using System;

    using OpenQA.Selenium;
    using OpenQA.Selenium.Remote;

    public class WpDriver : RemoteWebDriver, IHasTouchScreen
    {
        public WpDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
            : base(commandExecutor, desiredCapabilities)
        {
            TouchScreen = new RemoteTouchScreen(this);
        }

        public WpDriver(ICapabilities desiredCapabilities)
            : base(desiredCapabilities)
        {
            TouchScreen = new RemoteTouchScreen(this);
        }

        public WpDriver(Uri remoteAddress, ICapabilities desiredCapabilities)
            : base(remoteAddress, desiredCapabilities)
        {
            TouchScreen = new RemoteTouchScreen(this);
        }

        public WpDriver(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout)
            : base(remoteAddress, desiredCapabilities, commandTimeout)
        {
            TouchScreen = new RemoteTouchScreen(this);
        }

        public ITouchScreen TouchScreen { get; private set; }
    }
}

﻿namespace Samples
{
    #region

    using System;

    using OpenQA.Selenium;
    using OpenQA.Selenium.Remote;

    #endregion

    public class WpDriver : RemoteWebDriver, IHasTouchScreen
    {
        #region Fields

        private ITouchScreen touchScreen;

        #endregion

        #region Constructors and Destructors

        public WpDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
            : base(commandExecutor, desiredCapabilities)
        {
        }

        public WpDriver(ICapabilities desiredCapabilities)
            : base(desiredCapabilities)
        {
        }

        public WpDriver(Uri remoteAddress, ICapabilities desiredCapabilities)
            : base(remoteAddress, desiredCapabilities)
        {
        }

        public WpDriver(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout)
            : base(remoteAddress, desiredCapabilities, commandTimeout)
        {
        }

        #endregion

        #region Public Properties

        public ITouchScreen TouchScreen
        {
            get
            {
                return this.touchScreen ?? (this.touchScreen = new RemoteTouchScreen(this));
            }
        }

        #endregion
    }
}

Move touch screen initialization to property getter
Move touch screen initialization to property getter

Init TouchScreen when needed instead of initing it in each constructor
