整数のみを受け入れ、35 以下の数値のみを受け入れるように WPF テキストボックスを制限するために、次のように記述しました。
WindowLoaded イベントで、「OnPaste」のハンドラーを作成します。
DataObject.AddPastingHandler(textBoxWorkflowCount, OnPaste);
OnPaste は以下で構成されます。
private void OnPaste(object sender, DataObjectPastingEventArgs e)
{
    if (!IsNumeric(e.Source.ToString(), NumberStyles.Integer)) e.Handled = true;
}
数値のみを強制する関数は次のとおりです。
public bool IsNumeric(string val, NumberStyles numberStyle)
{
    double result;
    return double.TryParse(val, numberStyle, CultureInfo.CurrentCulture, out result);
}
エラーが発生している特定のテキスト ボックスも、35 以下の数値に制限する必要があります。これを行うために、次の TextChanged イベントを追加しました。
private void TextBoxWorkflowCountTextChanged(object sender, TextChangedEventArgs e)
        {
            try
            {
                if (textBoxWorkflowCount == null || textBoxWorkflowCount.Text == string.Empty || Convert.ToInt32(textBoxWorkflowCount.Text) <= 35) return;
                MessageBox.Show("Number of workflow errors on one submission cannot be greater then 35.", "Workflow Count too high", MessageBoxButton.OK, MessageBoxImage.Warning);
                textBoxWorkflowCount.Text = "";
            }
            catch(Exception)
            {
                // todo: Oh the horror! SPAGHETTI! Must fix. Temporarily here to stop 'pasting of varchar' bug
                if (textBoxWorkflowCount != null) textBoxWorkflowCount.Text = "";
            }
        }
これは仕事をしてうまくいきますが、それは非常に厄介/ハックであり、自分自身を改善するためにどうすればもっとうまくできるか知りたいです...特に例外を飲み込む必要はありません.