private void OnDataContextPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName != "IsFocused") { return; } PropertyInfo isFocusedProperty = sender.GetType().GetProperty("IsFocused"); if (isFocusedProperty == null) { return; } bool isFocused = (bool)isFocusedProperty.GetValue(sender); expandTimer.Enabled = isFocused; if (isFocused || !isExpanded) { return; } TagPanel.BeginAnimation(HeightProperty, colapseAnimation); isExpanded = false; }
private void OnExpandTimerElapsed(object sender, ElapsedEventArgs e) { Application.Current.Dispatcher?.Invoke(() => { TagPanel.BeginAnimation(HeightProperty, expandAnimation); isExpanded = true; }); }