I want to integrate to my project a VLC player to display video cameras streams. For that, I try to use Vlc.DotNet (2.1.126 version) in my WPF project.
My tests are
The WPF version of the VlcControl is just a WindowsFormsHost control hosting the Windows Forms version of the VlcControl. Judging by the error message (The value of type "VlcControl" cannot be added to a collection or dictionary of type 'UIElementCollection') you're simply missing a reference to the WindowsFormsIntegration assembly, in which the WindowsFormsHost is defined (it can be found under Assemblies → Framework in the reference manager).
Here's a fully working example of a WPF window hosting the VLC player. You need to install the Vlc.DotNet.Wpf NuGet package (and its dependencies) and reference the WindowsFormsIntegration assembly.
MainWindow.xaml
MainWindow.xaml.cs
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
vlcPlayer.MediaPlayer.VlcLibDirectory =
//replace this path with an appropriate one
new DirectoryInfo(@"c:\Program Files (x86)\VideoLAN\VLC\");
vlcPlayer.MediaPlayer.EndInit();
vlcPlayer.MediaPlayer.Play(new Uri("http://download.blender.org/peach/" +
"bigbuckbunny_movies/big_buck_bunny_480p_surround-fix.avi"));
}
}