I am developing a custom view in the "InteractionWorksheetRegion", which shows up in each interaction case window, under the side bar "CaseViewSideButtonRegion".
The code below is loaded in the "Initialize" method. And the Model class works only when i make it Singleton, otherwise i always have a Null value in the "PropertyChanged" variable.
1- when i am dealing with more then One interaction in the Toolbar, How do i tell my application to keep hold of different interaction objects, and How do my methods know that the Action (ex a custom button press), which case window it is coming from and Which Interaction object should be used.
2- How to register my Model class as a new instance each time a new interaction comes in ?
container.RegisterType<IView, View>();
container.RegisterType<IViewModel, ViewModel>();
// Put the MySample view in the region "InteractionWorksheetRegion"
viewManager.ViewsByRegionName["InteractionWorksheetRegion"].Add(new ViewActivator() { ViewType = typeof(IView), ViewName = "MyInteractionSample", ActivateView = true });
// Here we register the view (GUI) "IMySampleButtonView"
container.RegisterType<IExtButton, ExtButton>();
// Put the view in the region "CaseViewSideButtonRegion" (The case toggle button in the interaction windows)
viewManager.ViewsByRegionName["CaseViewSideButtonRegion"].Add(new ViewActivator() { ViewType = typeof(IExtButton), ViewName = "Extention", ActivateView = true });
Model = container.Resolve<ViewModel>();
Model.PropertyChanged += model_PropertyChanged;