Firstly thanks for MVC# - it's a fantastic set of libraries.
I'm having an issue when creating windows forms inheriting from WinFormsView<T> in that I can't use the visual forms designer - I get the following error:
"The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: OnSiteForm --- The base class 'MVCSharp.Winforms.WinFormView' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. "
However, if I inherit from WinFormsView the designer works as expected. I could just use the simple WinFormsView but it makes my code more lengthy and I'd prefer to use the generic version. Is this an issue that you've come across before - am I missing something, an attribute perhaps? Any help appreciated!
Sample code below:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MVCSharp.Winforms;
using MVCSharp.Winforms.Configuration;
using <mynamespace>.ApplicationLogic.Views;
using <mynamespace>.ApplicationLogic.Tasks;
using <mynamespace>.ApplicationLogic.Controllers;
namespace <mynamespace>.WinClient
{
[WinformsViewAttribute(typeof(RegistrationTask), "OnSiteForm Form")]
public partial class OnSiteForm : WinFormView<OnSiteViewController>
{
public OnSiteForm()
{
InitializeComponent();
}
}
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Take a look at the Basics (generics used) example. There an intermediate empty parent class is used to make the designer behave correctly. This is due to a known bug in the VS forms designer.
Regards,
--
Oleg Zhukov
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Firstly thanks for MVC# - it's a fantastic set of libraries.
I'm having an issue when creating windows forms inheriting from WinFormsView<T> in that I can't use the visual forms designer - I get the following error:
"The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: OnSiteForm --- The base class 'MVCSharp.Winforms.WinFormView' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. "
However, if I inherit from WinFormsView the designer works as expected. I could just use the simple WinFormsView but it makes my code more lengthy and I'd prefer to use the generic version. Is this an issue that you've come across before - am I missing something, an attribute perhaps? Any help appreciated!
Sample code below:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MVCSharp.Winforms;
using MVCSharp.Winforms.Configuration;
using <mynamespace>.ApplicationLogic.Views;
using <mynamespace>.ApplicationLogic.Tasks;
using <mynamespace>.ApplicationLogic.Controllers;
namespace <mynamespace>.WinClient
{
[WinformsViewAttribute(typeof(RegistrationTask), "OnSiteForm Form")]
public partial class OnSiteForm : WinFormView<OnSiteViewController>
{
public OnSiteForm()
{
InitializeComponent();
}
}
}
Sorry - should have pointed out that I'm using Visual Studio Professional 2008 SP1!
Hi,
Thank you for your appreciation!
Take a look at the Basics (generics used) example. There an intermediate empty parent class is used to make the designer behave correctly. This is due to a known bug in the VS forms designer.
Regards,
--
Oleg Zhukov
Superb! Thanks for your help Oleg and keep up the good work!!