From now the deltashell framework has a new kind of view...the IReusableView.
The purpose of this view is to reduce the number of views of a certain type by reusing the existing view with different data.

For example:
If you have a view open for a boundarycondition and double click on another boundary condition the existing view will change to show the other boundary condition. Therefore you will always have only one boundarycondition view open...

Except....when you 'lock' a reusableview. Then the view is tied to the data it shows and when opening a view for other data the view will not be reused. Therefore a new view will be opened (if no other resuable non-locked view is open). A lock image will be shown in the tab of the view to show when it is locked.

If you want your view to have this behaviour you should use IReusableView.

  • No labels

1 Comment

  1. Unknown User (don)

    The way IReusableView is introduced raises a few quesions. It seems to mix 2 things: 1) locking / unlocking view and 2) SetDataInViewMethod
    2) duplicates Data property and is used when view is composite (has child views).

        public interface IReusableView:IView
        {
            bool IsLocked { get; set; }
            event EventHandler IsLockedChanged; // why do we need this event?
            Action<IView,object> SetDataInViewMethod { get; set; }
        }
    

    My feeling is that we will have to redesign it to make more intuitive.