public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            CommandLinkIcon icon = CommandLinkIcon.None;

            if (value is CommandLinkIcon)
            {
                icon = (CommandLinkIcon)value;
            }
            return((icon != CommandLinkIcon.None) ? Visibility.Visible : Visibility.Collapsed);
        }
Exemple #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            CommandLinkIcon icon = CommandLinkIcon.None;

            if (value is CommandLinkIcon)
            {
                icon = (CommandLinkIcon)value;
            }
            if (icon == CommandLinkIcon.None)
            {
                return(Visibility.Collapsed);
            }
            return((icon == CommandLinkIcon.Arrow ^ System.Convert.ToBoolean(parameter)) ? Visibility.Visible : Visibility.Collapsed);
        }
Exemple #3
0
 /// <summary>
 /// Raises the <see cref="E:System.Windows.Controls.CommandLink.IconChanged" /> routed event.
 /// </summary>
 /// <param name="oldValue">
 /// Old value of the <see cref="P:System.Windows.Controls.CommandLink.Icon" /> property
 /// </param>
 /// <param name="newValue">
 /// New value of the <see cref="P:System.Windows.Controls.CommandLink.Icon" /> property
 /// </param>
 protected virtual void OnIconChanged(CommandLinkIcon oldIcon, CommandLinkIcon newIcon)
 {
     RaiseIconChangedEvent(oldIcon, newIcon);
 }
Exemple #4
0
 private void RaiseIconChangedEvent(CommandLinkIcon oldIcon, CommandLinkIcon newIcon)
 {
     RaiseEvent(new RoutedPropertyChangedEventArgs <object>(oldIcon, newIcon, CommandLink.IconChangedEvent));
 }
 /// <summary>
 /// Raises the <see cref="E:System.Windows.Controls.CommandLink.IconChanged" /> routed event. 
 /// </summary>
 /// <param name="oldValue">
 /// Old value of the <see cref="P:System.Windows.Controls.CommandLink.Icon" /> property
 /// </param>
 /// <param name="newValue">
 /// New value of the <see cref="P:System.Windows.Controls.CommandLink.Icon" /> property
 /// </param>
 protected virtual void OnIconChanged(CommandLinkIcon oldIcon, CommandLinkIcon newIcon)
 {
     RaiseIconChangedEvent(oldIcon, newIcon);
 }
 private void RaiseIconChangedEvent(CommandLinkIcon oldIcon, CommandLinkIcon newIcon)
 {
     RaiseEvent(new RoutedPropertyChangedEventArgs<object>(oldIcon, newIcon, CommandLink.IconChangedEvent));
 }