Bind WindowsFormHost with Iconf.net ProcessBytes method

46 views Asked by At

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.

1

There are 1 answers

0
BradleyDotNET On

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.