This project is read-only.

Is it possible to connect SCSF + Infragistics + WPF

Mar 5, 2008 at 5:36 PM
Hi...
I want to use WPF views inside a IGFormShellApplication (Infragistics). Is this possible? Does anyone else have tried this?
When I try to run a IGFormShellApplication with a WPF workspace (Microsoft.Practices.CompositeUI.WPF) inside it I get the following error ‘Service Microsoft.Practices.CompositeUI.WPF.IWPFUIElementAdapter is not available in the current context.’

Can anyone help me?

Best regards,
João Gomes
Mar 6, 2008 at 3:10 PM

Yes it's possible... I used ElementHost for hosting my WPF views... Now I get an error with the presenters... I will try to figure this out now...

Best regards,
João Gomes
Mar 7, 2008 at 10:16 AM
Hello again...
I can't find the solution for my problem... I am new with SCSF so I hope that somebody already figured out this issue.
My problem is the following:

I have a command handler:

CommandHandler(CommandNames.ShowOrder)
public void OnShowOrder(object sender, EventArgs e)
{
ShowViewInWorkspace<ExampleWinView>(WorkspaceNames.ZoneWorkspace);
}

Where I show the ExampleWinView which is a Windows Form. In this ExampleWinView I want to host a wpf user control so I have the following code in the ExampleWinView constructor:

public ExampleWinView()
{
InitializeComponent();

// Create the hosting container for WPF controls
ElementHost host = new ElementHost();
host.Dock = DockStyle.Fill;
_wpfWorkspace.Controls.Add(host);

// Create the WPF control itself and add to host
ExampleWPFView ctrl = new ExampleWPFView();
host.Child = ctrl;

}

But when I run OnShowOrder(object sender, EventArgs e) I get the following exception in the ExampleWPFView:

NullReferenceException was unhandled
Object reference not set to an instance of an object.

In the segment of code _presenter.OnViewReady(); from the following function of ExampleWPFView.xaml.cs:

public void OnLoad(object sender, RoutedEventArgs e)
{
_presenter.OnViewReady();
}

Can anyone help me with my problem??

Thanks & Best Regards,

João Gomes
Mar 10, 2008 at 4:21 PM
The inheritance from Infragistic's IGFormShellApplication is

IGFormShellApplication -> IGWindowsFormsApplicationBase -> WindowsFormsApplication.

On the otherhand, the Shell Form of a new SCSF project created to host WPF controls inherits from

WPFFormShellApplication -> FormShellApplication -> WindowsFormApplication.

There are significant code differences between IGWindowsFormsApplicationBase and FormShellApplication
Also, there are significant code differences between IGFormShellApplication.cs and WPFFormShellApplication.cs.