Click here to Skip to main content
15,064,166 members
Please Sign up or sign in to vote.
4.20/5 (2 votes)
See more:
Hi All,
I am working on WPF project in that i am facing the build error is "
The type cannot be used as type parameter in the generic type or method wpf
"

I had created one wpf window the code is below
public partial class LicensingForm : Window,ILicensingForm
{
}

Here i am inhering the ILicensingForm class and
the ILicensingForm code is below
public interface ILicensingForm
    {
        Control ConfirmLicenseButton { get; }
        Control ConfirmationCodeInput { get; }
        Control EmailAddressInput { get; }
        Control RequestLicenseButton { get; }
        Control Status { get; }

        event FormClosedEventHandler FormClosed;

        void Close();
        void ShowMessage(string message);
    }


And i am trying to call that window in some other class(mainModule).
internal static class MainModule
 {
public static void RemoveLicense()
  {
      using (var licenseController = new LicensingFormController<LicensingForm>())
      {
                licenseController.RemoveLicense();
      }
     }

}
Here iam getting error in this line LicensingForm only.
new LicensingFormController<LicensingForm>


What I have tried:

i had tried so many ways to fix this issue.
Posted
Updated 19-Jun-19 20:46pm
v3
Comments
F-ES Sitecore 17-Jun-19 8:24am
   
LicensingFormController doesn't support generics so you can't do LicensingFormController<TypeName> you can only create it like new LicensingFormController()
Ram349 18-Jun-19 2:31am
   
Hi F-ES Sitecore,Thanks for respond to my post i already created new LicensingFormController<typename> only.i created like below
var licenseController = new LicensingFormController<licensingform>()

Could you please help this issue.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900