public UserAnnotationViewModel(ISharedDataService sharedDataService, MeetingViewModel meeting)
        {
            Meeting = meeting;
            AnnotationsModel = sharedDataService.AnnotationsModel;
            SurfaceSize = new AnnotationSurfaceSize();

            var activeToolObs = Meeting.WhenAnyValue(vm => vm.ActiveTool)
               .Where(t => t != null);

            var pageChangedObs = activeToolObs
                             .Select(t => t.WhenAnyValue(v => v.CurrentPageNumber,
                                                p => new ToolIdAndPageNumber { ToolId = t.ToolId, PageNumber = p })
                                    )
                             .Switch(); // Only listen to the most recent sequence of property changes (active tool)

            // Every time the tool changes, select the tool id and current page number
            var toolChangedObs = activeToolObs
                .Select(t => new ToolIdAndPageNumber { ToolId = t.ToolId, PageNumber = t.CurrentPageNumber });
               
            // Merge them together - tool changes and current page of the tool
            _collectionRefreshSub = toolChangedObs
                .Merge(pageChangedObs)
                .Subscribe(t => this.RaisePropertyChanged("Annotations"));
            // whenever the suface size's width or height changes, re-bind the annotations
            // on the agent's side, this will send stuff over the wire. need to figure out how to solve this.
            _sizeChangedSub = this.SurfaceSize
                .WhenAnyValue(p => p.Width, p => p.Height, (w, h) => true)
                .Subscribe(p => this.RaisePropertyChanged("Annotations"));
        }
        public UserAnnotationViewModel(ISharedDataService sharedDataService, MeetingViewModel meeting)
        {
            Meeting          = meeting;
            AnnotationsModel = sharedDataService.AnnotationsModel;
            SurfaceSize      = new AnnotationSurfaceSize();

            var activeToolObs = Meeting.WhenAnyValue(vm => vm.ActiveTool)
                                .Where(t => t != null);

            var pageChangedObs = activeToolObs
                                 .Select(t => t.WhenAnyValue(v => v.CurrentPageNumber,
                                                             p => new ToolIdAndPageNumber {
                ToolId = t.ToolId, PageNumber = p
            })
                                         )
                                 .Switch(); // Only listen to the most recent sequence of property changes (active tool)

            // Every time the tool changes, select the tool id and current page number
            var toolChangedObs = activeToolObs
                                 .Select(t => new ToolIdAndPageNumber {
                ToolId = t.ToolId, PageNumber = t.CurrentPageNumber
            });

            // Merge them together - tool changes and current page of the tool
            _collectionRefreshSub = toolChangedObs
                                    .Merge(pageChangedObs)
                                    .Subscribe(t => this.RaisePropertyChanged("Annotations"));
            // whenever the suface size's width or height changes, re-bind the annotations
            // on the agent's side, this will send stuff over the wire. need to figure out how to solve this.
            _sizeChangedSub = this.SurfaceSize
                              .WhenAnyValue(p => p.Width, p => p.Height, (w, h) => true)
                              .Subscribe(p => this.RaisePropertyChanged("Annotations"));
        }