public void OpenInSecondScreen(VideoStreamPlayerViewModel viewModel, int secondScreenId)
 {
     if ((viewModel == null) || (viewModel.Owner == null)) return;
     imbCommands.BroadcastCommand(new DisplayVideoCmd(viewModel.Owner.Model, secondScreenId));
 }
        public void OpenWindowForVideoStream(VideoStreamPlayerViewModel videoVM)
        {
           // ViewLocator.AddNamespaceMapping("VlcVideoPlayer.ViewModels", "csStreamingVideoPlugin.Views");

            ViewLocator.AddNamespaceMapping("csCommon.Plugins.StreamingVideoPlugin.ViewModels", "csStreamingVideoPlugin.Views");
            var fullVideoDisplay = new CsVideoStreamPlayerFullViewModel(videoVM.Owner)
            {
                VideoFill = VlcVideoPlayer.WpfVlcPlayer.EVideoFill.FillKeepAspectRatio
            };
            int height = (videoVM.VideoHeight == 0) ? 50 : (int)(videoVM.VideoHeight *0.30);
            int width = (videoVM.VideoWidth == 0) ? 50 : (int)(videoVM.VideoWidth*0.30);

            var mousePosition = Mouse.GetPosition(Application.Current.MainWindow);
            var x = ((view.ActualWidth - 600) / view.ActualWidth) * mousePosition.X + 300;
            var fe = FloatingHelpers.CreateFloatingElement(String.Format("Video {0}", videoVM.Owner.Model.Description), 
                new System.Windows.Point(x, 300 + rnd.Next(200) - 100),
                new System.Windows.Size(width,height),
                fullVideoDisplay);
            if (mousePosition != new System.Windows.Point(0, 0))
            {
                fe.AnimationSpeed = new TimeSpan(0, 0, 0, 0, 500);
                //fe.StartSize= new Size(0,0);
                fe.OriginPosition = mousePosition;
                fe.OriginSize = new System.Windows.Size(0, 0);
            }
            fe.CanFullScreen = true;
            fe.CanScale = true;
            fe.Closed += (sender, e) =>
            {
                DisplayedFullVideoStreamsVM.Remove(fullVideoDisplay);
            };
            DisplayedFullVideoStreamsVM.Add(fullVideoDisplay);
            AppStateSettings.Instance.FloatingItems.AddFloatingElement(fe);
        }