Currently I am binding a windows form with video stream bytes like given code:
var opened = CheckOpened(peerId);
if (opened != null)
{
((ClientForm)opened).icc.ProcessBytes(bytes);
}
CheckOpened function
private Form CheckOpened(string name)
{
FormCollection fc = System.Windows.Forms.Application.OpenForms;
foreach (Form frm in fc)
{
if (frm.Text == name)
{
return frm;
}
}
return null;
}
How can I bind WindowsFormHost with this?. This will bind every time a specific button is pressed.
WindowsFormsHost
is just a holder for windows forms content. It doesn't expose any dependency properties that the form can access (required for binding).In general, its for legacy support only, and doesn't fit well with the MVVM pattern.