C# 字符串上的最后一个字符不会在MVVM的setter中跳跃

C# 字符串上的最后一个字符不会在MVVM的setter中跳跃,c#,wpf,mvvm,C#,Wpf,Mvvm,我现在真的迷路了。我有一个表单,它是为检查OCR阅读器的SPZ而开发的。我的文本框中几乎没有条件。这些条件启用/禁用其他按钮和单选按钮。在一些记录中,它工作得非常好。但在某些方面,我有一个有趣的问题。我得到了一段代码: // Loading can be if: // SPZ Ocr is different // SPZ Notified is OK // SPZ Final (real) OK // SPZ notified == real, but its different from

我现在真的迷路了。我有一个表单,它是为检查OCR阅读器的SPZ而开发的。我的文本框中几乎没有条件。这些条件启用/禁用其他按钮和单选按钮。在一些记录中,它工作得非常好。但在某些方面,我有一个有趣的问题。我得到了一段代码:

// Loading can be if:  
// SPZ Ocr is different
// SPZ Notified is OK
// SPZ Final (real) OK
// SPZ notified == real, but its different from OCR: then i can enable button continue loading. When i click, then i can detail window activate.                   
else if (_licencePlate != PlateInformation.LicencePlateOCR && _licencePlate == PlateInformation.LicencePlateNotified)
{
    CheckedWaitState = false;
    CanEnableButton = true;
    NotifyPropertyChanged("CanEnableButton");
    ConfirmCheckSPZ = false;
    NotifyPropertyChanged("ConfirmCheckSPZ");
    CheckWaitStateEnable = false;
    NotifyPropertyChanged("CheckWaitStateEnable");
    CheckReturnStateEnable = false;
    NotifyPropertyChanged("CheckReturnStateEnable");
    NotifyPropertyChanged("LicencePlate");
}
如果我在这个特殊的文本框中写一些SPZ,它在这种情况下的飞跃是很好的。但只有字符串的最后一个字符不是。以前的角色跳得很好。你知道为什么吗?当然,当最后一个字符没有跳转到条件时,就没有任何东西被激活

有一段xaml代码:

<TextBox x:Name="txtCheckSpz" Grid.Column="0" Grid.Row="2" Margin="63,10,0,0" Text="{Binding LicencePlate, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Style="{StaticResource NormalTextBox1}" Width="128" Height="33" >

在带有UpdateSourceTrigger=PropertyChanged的双向绑定中,文本框中键入(或删除)的每个字符都将触发一组目标属性(在您的示例中为“LicencePlate”)。 在该属性集中,您可以调用其他代码,这些代码将在分析接收到的值后更改所需的任何状态。 例如:

private string m_LicencePlate
public string LicencePlate
{
     get { return m_LicencePlate; }
     set 
     {
        if (value == m_LicencePlate) return;
        m_LicencePlate = value;
        UpdateStateAfterLicensePlateChange();
     }
}

SPZ是什么意思?当你写“leap-in”时,你的意思是(没有)执行条件代码吗?英语似乎不是你的第一语言——这没关系,但我们仍然需要澄清你的问题到底是什么。