Задача - сброс параметра при входе

У меня есть Задача при входе в Задачу. Для EditorText задана пустая строка. Я использую FreshMvvm. Вы можете объяснить, почему при входе в Task DecreaseDate EditorText установлен?

Следующее находится в пределах DayLogPageModel.cs

    async Task DecreaseDate()
    {
        _dayLogs.SetLog(_logDate.ConvertToIntShort(), EditorText);

        _logDate.AddDays(-1);
        LogDateString = _logDate.ConvertToStrShort();
        EditorText = _dayLogs.GetLog(_logDate.ConvertToIntShort());
    }
    private string _editorText;
    public String EditorText
    {
        get => _editorText;
        set
        {
            _editorText = value;
            RaisePropertyChanged("EditorText");
        }
    }

и это DayLogPage.xaml

?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
             xmlns:local="clr-namespace:workoutDiaryGridDesignPage1"
             x:Class="workoutDiaryGridDesignPage1.DayLogPage">
    <ContentPage.Content>
        <Grid x:Name="DayLogTrialGrid" RowSpacing="1" ColumnSpacing="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="100" />
                <RowDefinition Height="200" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>          
           <Editor x:Name="DayLogEditor" Text="{Binding EditorText, Mode=TwoWay}"
                   Grid.Row="1" Grid.Column="0" 
                    FontSize="Large" HorizontalOptions="Center" VerticalOptions="Center" 
                    Keyboard="Chat" HeightRequest="100" WidthRequest="500"/>            
        </Grid>
    </ContentPage.Content>
</ContentPage>

0 ответов

Другие вопросы по тегам