Hi,
I have a label with two bindings: Text binding and also IsVisible binding.
I have a special situation where I cannot see the content of my label. I know the label control is there because the space is reserved in the UI but no value is displayed. When I start the simulator in debug, I see the problem. Even if I go around the app, the problem is always there. But if I update the Label control and save (hotswap), after the refresh of the App, the problem is fixed!?!
Here is my model. Each ListViewItem has a small arrow at the bottom and when I click on it, I want to hide the label and show another section. When I click again on the arrow, hide the section and show the label. Just toggle between these two.
public class EvaluationContextMemberCell : INotifyPropertyChanged, IProfileUniform { public event PropertyChangedEventHandler PropertyChanged; public EvaluationContextMemberDto EvaluationContextMember { get; set; } ... #region Position public bool HasPosition { get { return EvaluationContextMember.Profile.Position.IsNotEmpty(); } } public bool ShowPosition { get { return HasPosition && !ShowProperties; } } #endregion .. #region Properties public List<ProfilePropertyDto> Properties { get { List<ProfilePropertyDto> properties = new List<ProfilePropertyDto>(EvaluationContextMember.Profile.Properties); if (EvaluationContextMember.Profile.Subject.Gender.HasValue) { ProfilePropertyDto dto = new ProfilePropertyDto { Name = AppResources.Gender, Value = EvaluationContextMember.Profile.Subject.Gender == 2 ? AppResources.GenderFemale : AppResources.GenderMale }; properties.Insert(0, dto); } if (EvaluationContextMember.Profile.Subject.Date.HasValue) { DateTime birthdate = EvaluationContextMember.Profile.Subject.Date.Value; DateTime referenceDate = DateTime.Now; int age = referenceDate.Year - birthdate.Year; if (birthdate > referenceDate.AddYears(-age)) { age--; } ProfilePropertyDto dto = new ProfilePropertyDto { Name = AppResources.Age, Value = age }; properties.Insert(0, dto); } if (EvaluationContextMember.Profile.Position.IsNotEmpty()) { ProfilePropertyDto dto = new ProfilePropertyDto { Name = AppResources.Position, Value = EvaluationContextMember.Profile.Position }; properties.Insert(0, dto); } return properties; } } public bool HasProperties { get { return Properties.IsNotEmpty(); } } public bool ShowProperties { get; set; } #endregion public ICommand ExpandCollapseClickCommand { get; set; } public Action<EvaluationContextMemberCell> IsShowPropertiesChangedAction { get; set; } public EvaluationContextMemberCell() { ExpandCollapseClickCommand = new Command((obj) => { ShowProperties = !ShowProperties; OnPropertyChanged("ShowProperties"); OnPropertyChanged("ShowPosition"); IsShowPropertiesChangedAction.Invoke(this); }); } protected void OnPropertyChanged(string name) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); } }