Hybrid app taking screenshots

The following code give an error on here , not sure why
var screenShot = ((ITakesScreenshot)_driver).GetScreenshot();

the full code is here

using System;
using System.Configuration;
using System.Drawing.Imaging;
using OpenQA.Selenium;
using SoftWorksApp.pages;
using OpenQA.Selenium.Appium.Android;

namespace SoftWorksApp.HelpFiles
public class TakeScreenShot {

    public static string Screenshot(string filename, AndroidDriver<AndroidElement> _driver)
    var fileName = String.Format("{0}{1}{2}", prefix, DateTime.Now.ToString("HHmmss"), ".png");
        var screenShot = ((ITakesScreenshot)_driver).GetScreenshot();
        screenShot.SaveAsFile(fileName, ImageFormat.Png);
        return fileName;


    public static string prefix { get; set; }


You can watch this video : https://youtu.be/NlAv4WEuzfs