Skip to content

Commit

Permalink
Fixes #1149 transport location disappear (#1176)
Browse files Browse the repository at this point in the history
  • Loading branch information
msevestre authored and Yuri05 committed Apr 9, 2019
1 parent b3da7e2 commit 5fba12b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
Expand Up @@ -90,6 +90,8 @@ public void SetMembraneLocation(TransporterExpressionContainerDTO transporterExp
public void UpdateTransportType(TransportType newTransportType)
{
AddCommand(_moleculeExpressionTask.SetTransporterTypeFor(_transporter, newTransportType));
//required to refresh view when changing transport type as some UI elements need to be invalidated
RefreshView();
}

public override void AddCommand(ICommand command)
Expand Down Expand Up @@ -155,6 +157,7 @@ public void SetRelativeExpression(ExpressionContainerDTO expressionContainerDTO,
public void RefreshView()
{
_moleculePropertiesPresenter.RefreshView();
_view.RefreshData();
}

public void Handle(NoTranporterTemplateAvailableEvent eventToHandle)
Expand Down
Expand Up @@ -22,5 +22,6 @@ public interface IIndividualTransporterExpressionsView : IView<IIndividualTransp
void BindTo(TransporterExpressionDTO transporterExpressionDTO);
void ShowWarning(string warning);
void HideWarning();
void RefreshData();
}
}
@@ -1,10 +1,4 @@
using System.Linq;
using OSPSuite.DataBinding;
using OSPSuite.DataBinding.DevExpress;
using OSPSuite.DataBinding.DevExpress.XtraGrid;
using OSPSuite.UI.Services;
using OSPSuite.UI.Extensions;
using OSPSuite.UI.RepositoryItems;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
Expand All @@ -13,17 +7,23 @@
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraLayout.Utils;
using OSPSuite.Assets;
using OSPSuite.Core.Domain;
using OSPSuite.DataBinding;
using OSPSuite.DataBinding.DevExpress;
using OSPSuite.DataBinding.DevExpress.XtraGrid;
using OSPSuite.Presentation.DTO;
using OSPSuite.Presentation.Extensions;
using OSPSuite.Presentation.Views;
using OSPSuite.UI.Extensions;
using OSPSuite.UI.RepositoryItems;
using OSPSuite.UI.Services;
using PKSim.Assets;
using PKSim.Core.Model;
using PKSim.Presentation.DTO.Individuals;
using PKSim.Presentation.Presenters.Individuals;
using PKSim.Presentation.Views.Individuals;
using OSPSuite.Assets;
using PKSim.UI.Views.Core;
using OSPSuite.Core.Domain;
using OSPSuite.Presentation.DTO;
using OSPSuite.Presentation.Extensions;
using OSPSuite.Presentation.Views;

namespace PKSim.UI.Views.Individuals
{
Expand Down Expand Up @@ -190,16 +190,18 @@ public void HideWarning()
layoutItemWarning.Visibility = LayoutVisibility.Never;
}

public void AddMoleculePropertiesView(IView view)
public void RefreshData()
{
AddViewTo(layoutItemMoleculeProperties, view);
_gridViewBinder.Rebind();
}

public override bool HasError
public void AddMoleculePropertiesView(IView view)
{
get { return _screenBinder.HasError || _gridViewBinder.HasError; }
AddViewTo(layoutItemMoleculeProperties, view);
}

public override bool HasError => _screenBinder.HasError || _gridViewBinder.HasError;

public void Clear()
{
_gridViewBinder.DeleteBinding();
Expand Down

0 comments on commit 5fba12b

Please sign in to comment.