Hey,
I have some properties who are binded in xaml code and when i change some values of those properties then it dosent sync over to the xaml code...
I guess that i miss something but cant find what...
Any suggestions?
Here is my XAML Code:
<StackLayout Orientation="Horizontal">
<ImageButton Source="Left_Arrow.png"
x:Name="PreviousButton"
HorizontalOptions="StartAndExpand"
Command="{Binding BackOneDayCommand}"
BackgroundColor="Transparent">
</ImageButton>
<Label x:Name="CurrentDayLbl"
FontSize="28"
HorizontalOptions="Center"
Text="{Binding CurrentDay}">
</Label>
<ImageButton Source="Right_Arrow.png"
Command="{Binding ForwardOneDayCommand}"
HorizontalOptions="EndAndExpand"
BackgroundColor="Transparent">
</ImageButton>
</StackLayout>
And here is my C# Code:
public string CurrentDay { get; set; }
public Command BackOneDayCommand { get; }
public Command ForwardOneDayCommand { get; }
public bool WorkoutsListVisible { get; set; }
public bool NoTrainingLblVisible { get; set; }
public ObservableCollection<Workouts> WorkoutsListSource { get; set; }
public TodaysWorkoutViewModel()
{
CurrentSelectedWeekDay = DateTime.Today;
CurrentDay = CurrentSelectedWeekDay.DayOfWeek.ToString();
BackOneDayCommand = new Command(PreviousButton_Clicked);
ForwardOneDayCommand = new Command(NextButton_Clicked);
}
public void PreviousButton_Clicked()
{
CurrentSelectedWeekDay = CurrentSelectedWeekDay.AddDays(-1);
CurrentDay = CurrentSelectedWeekDay.DayOfWeek.ToString();
}
public void NextButton_Clicked()
{
CurrentSelectedWeekDay = CurrentSelectedWeekDay.AddDays(+1);
CurrentDay = CurrentSelectedWeekDay.DayOfWeek.ToString();
}
Thankful for some help!