使用棱镜Interactionrequest和CustomPopUpWindow我遇到问题,自定义弹出窗口没有调整大小。
第一次调用交互时,它会正确地调整内容的大小,但如果我再次调用它,则会记住此大小,并且不会根据更改的内容更改大小。
这是一个已知问题,还是我做错了?
此致 赖
<i:Interaction.Triggers>
<InteractionRequest:InteractionRequestTrigger SourceObject="{Binding ImportConfirmation, Mode=OneWay}">
<InteractionRequest:PopupWindowAction IsModal="True" CenterOverAssociatedObject="True">
<InteractionRequest:PopupWindowAction.WindowContent>
<Views:ImportMachineDefintionConfirmationView/>
</InteractionRequest:PopupWindowAction.WindowContent>
</InteractionRequest:PopupWindowAction>
</InteractionRequest:InteractionRequestTrigger>
<InteractionRequest:InteractionRequestTrigger SourceObject="{Binding DeleteMachineDefinitionConfirmation, Mode=OneWay}">
<InteractionRequest:PopupWindowAction IsModal="True" CenterOverAssociatedObject="True" >
<InteractionRequest:PopupWindowAction.WindowContent>
<Views:DeleteMachineDefinitionConfirmationView/>
</InteractionRequest:PopupWindowAction.WindowContent>
</InteractionRequest:PopupWindowAction>
</InteractionRequest:InteractionRequestTrigger>
</i:Interaction.Triggers>
private void DeleteMachineDefinitionCommandExecute(IVersionAwareMachineDefinition machineDefinition)
{
var deleteConfirmation =
this.unityContainer.Resolve<IDeleteMachineDefinitionConfirmationViewModel>(
new ParameterOverride("machineDefinitionToDelete", machineDefinition));
this.DeleteMachineDefinitionConfirmation.Raise(
deleteConfirmation,
_ =>
{
if (!_.Confirmed)
{
return;
}
this.repository.DeleteMachineDefinition((MachineType)machineDefinition.MachineTypeId, machineDefinition.MachineNumber);
this.MachineDefinitions =
new ObservableCollection<IVersionAwareMachineDefinition>(this.repository.GetKnownVersionAwareMachineDefinitions());
this.SelectedMachineDefinition = null;
});
}