示例#1
0
        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;
        }
示例#2
0
 private void OnExpandTimerElapsed(object sender, ElapsedEventArgs e)
 {
     Application.Current.Dispatcher?.Invoke(() => {
         TagPanel.BeginAnimation(HeightProperty, expandAnimation);
         isExpanded = true;
     });
 }