2

ICommand にバインドされた WPF ウィンドウにボタンがあります

<Button Style="{StaticResource ToolBarButtonSearchTime}">
    <Button.Command>
        <Binding Path="FiltrarPlanillasCommand">
            <Binding.ValidationRules>
                <ExceptionValidationRule/>
            </Binding.ValidationRules>
        </Binding>
    </Button.Command>
</Button>

an これは execute のメソッドです

public void FiltrarPlanillasExecute(object p)
{
    FiltrosDocumento filtro = new FiltrosDocumento();
    filtro.ListaBodegasAcopio = ListaBodegasSeleccionadas;
    filtro.FechaInicial = FechaInicial;
    filtro.FechaFinal = FechaFinal;
    filtro.IntIdmodulo = IntIdModulo;
    try
    {
        filtro.PlanillaAcopioLiquidada = PlanillaAcopioLiquidada;

        ListaPlanillas = null;
        ListaPlanillas = new ObservableCollection<Merlin_MovimientoDocumentosFacturacion_Enc>(
                    ListaDocumentos.PlanillasAcopio(filtro, db)
                );
        ((DelegateCommand)_ICommandParadigmaNPrint).RaiseCanExecuteChanged();
    }
    catch (Exception)
    {
        //    Here this exception wasn't catched 
        throw;
    }
}

<ExceptionValidationRule/>設定されている場合、例外をキャッチしないのはなぜですか? 私のコードで何が問題になっていますか?

4

1 に答える 1