How to use LostFocus in Caliburn Micro

152 Views Asked by At

I need to validate the value in the text box when the users finish their input. When they go to the next text box, the previous text box will validate the range of input (100~100000 steps 100 and format is "###,###"). And my opinion is Lost Focus Event is the good way to solve this. I have this property which I want to use Lost Focus

    private string resultCommandNote02;
    public string ResultCommandNote02
    {
        get
        {
            return resultCommandNote02;
        }
        set
        {
            resultCommandNote02 = value;
            NotifyOfPropertyChange(() => ResultCommandNote02);
        }
    }

And here is the code of View.XAML

<TextBox Grid.Column="1" Margin="0 0 0 4" Text="{Binding ResultCommandNote01}"
                                 cal:Message.Attach="[Event LostFocus] = [Action TxtCmdNote01_LostFocus]"></TextBox>
0

There are 0 best solutions below