Beispiel #1
0
        private static void OnAttachChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (controller == null)
            {
                return;
            }
            if (e.NewValue == e.OldValue)
            {
                return;
            }

            var attachText = e.NewValue as string;

            if (string.IsNullOrEmpty(attachText))
            {
                return;
            }

            var triggers = new RoutedMessageTriggerCollection();

            foreach (var trigger in parser.Parse(d, attachText))
            {
                triggers.Add((BaseMessageTrigger)trigger);
            }

            SetTriggers(d, triggers);
        }
Beispiel #2
0
 /// <summary>
 /// Sets the triggers.
 /// </summary>
 /// <param name="d">The d.</param>
 /// <param name="triggers">The triggers.</param>
 public static void SetTriggers(DependencyObject d, RoutedMessageTriggerCollection triggers)
 {
     d.SetValue(TriggersProperty, triggers);
 }