NewImageViewerControlEvent on created ImageViewerWpfControl

Kinda related to this thread: https://developer.milestonesys.com/s/question/0D50O00004BCuJeSAL/render-metadata-in-imageviewerwpfcontrol

This is a plugin for the SmartClient.

I’ve created a custom Wpf usercontrol that contains a imageviewer and a playbackcontroller. How can I fire the ClientControl.NewImageViewerControlEvent for the custom metadata visualization-plugins?

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            imageViewerControl.EnableDigitalZoom = true;
            imageViewerControl.EnableMouseControlledPtz = true;
            imageViewerControl.MaintainImageAspectRatio = true;
 
            playbackFQID = ClientControl.Instance.GeneratePlaybackController();
            playbackControl.Init(playbackFQID);
 
            playbackControl.SetCameras(new List<FQID>() { camera.FQID });
            imageViewerControl.CameraFQID = camera.FQID;
            imageViewerControl.PlaybackControllerFQID = playbackFQID;
 
            imageViewerControl.Initialize();
            imageViewerControl.Connect();
 
            imageViewerControl.StartBrowse();
 
            EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(
                                            VideoOS.Platform.Messaging.MessageId.System.ModeChangeCommand,
                                            Mode.ClientPlayback), playbackFQID);
 
            EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(
                                MessageId.SmartClient.PlaybackCommand,
                                new PlaybackCommandData() { Command = PlaybackData.PlayStop }), playbackFQID);
 
            EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(
                                            MessageId.SmartClient.PlaybackCommand,
                                            new PlaybackCommandData() { Command = PlaybackData.Goto, DateTime = triggerTime.ToUniversalTime() }), playbackFQID);
 
// Fire NewImageViewer event?
        }

The event should be automatic, you cannot fire it.

I experimented using the Smart Client Independent Playback plugin sample and observed this behavior:

When you create a new view, drag the SCIndependentPlayback plugin to the view item and then in the side panel selects a camera the NewImageViewerControlEvent is fired.

When you switch to the view now containing the SCIndependentPlayback plugin view item the NewImageViewerControlEvent is fired.

When you go into Setup mode and switch from the camera active to a new camera no NewImageViewerControlEvent is fired.

To me this is expected behavior. Do you see a different behavior?

Can you try to see if your experience is the same using the sample?

If your code is not resulting in the same behavior please see if there is a difference that you could take from the sample code.

If the scenario in my test does not fit the scenario you are working with please give me further details on what you do and what you experience.

I have a SearchToolbarPlugin that opens a new WPF window containing a custom user control. That user control contains a ImageViewerWpfControl

and a PlaybackWpfUserControl, defined in the XAML.

<smartClient:ImageViewerWpfControl x:Name="imageViewerControl" Grid.Row="0"/>
<smartClient:PlaybackWpfUserControl x:Name="playbackControl" Grid.Row="1" TabIndex="4"/>

I get no NewImageViewerControlEvent fired in my BackgroundPlugin.

Are you using the “preview” or your own window?

We need some details on how this is implemented in order to reproduce or understand what is going on.

Ideally you upload a plugin project showing the code and enabling Milestone to run a debug.

You can create a Support Case for this. If you create a Support Case please refer to this question and to my name in the case.

I created a case, MSC461055.