Click here to Skip to main content
15,912,205 members
Home / Discussions / WPF
   

WPF

 
QuestionWPF xceed CheckcComboBox SelectAll Text Pin
Kevin Marois20-Jun-23 18:17
professionalKevin Marois20-Jun-23 18:17 
AnswerRe: WPF xceed CheckcComboBox SelectAll Text Pin
Richard Deeming20-Jun-23 20:53
mveRichard Deeming20-Jun-23 20:53 
GeneralRe: WPF xceed CheckcComboBox SelectAll Text Pin
Kevin Marois21-Jun-23 10:32
professionalKevin Marois21-Jun-23 10:32 
QuestionList of Images Pin
Kevin Marois9-Jun-23 13:47
professionalKevin Marois9-Jun-23 13:47 
QuestionChange Image URL's Assembly At Runtime Pin
Kevin Marois6-Jun-23 7:15
professionalKevin Marois6-Jun-23 7:15 
AnswerRe: Change Image URL's Assembly At Runtime Pin
Gerry Schmitz6-Jun-23 15:52
mveGerry Schmitz6-Jun-23 15:52 
Questionc# Spotify API not returning correctly. Pin
elfenliedtopfan52-Jun-23 18:03
elfenliedtopfan52-Jun-23 18:03 
AnswerRe: c# Spotify API not returning correctly. Pin
Pete O'Hanlon4-Jun-23 8:42
mvePete O'Hanlon4-Jun-23 8:42 
AnswerRe: c# Spotify API not returning correctly. Pin
jschell5-Jun-23 5:01
jschell5-Jun-23 5:01 
QuestionNeed help please regarding your awesome WPF MultiComboBox project :) Pin
Member 1160463425-May-23 5:21
Member 1160463425-May-23 5:21 
AnswerRe: Need help please regarding your awesome WPF MultiComboBox project :) Pin
jeron125-May-23 5:50
jeron125-May-23 5:50 
AnswerRe: Need help please regarding your awesome WPF MultiComboBox project :) Pin
Richard Deeming25-May-23 21:28
mveRichard Deeming25-May-23 21:28 
QuestionNavigationControl - Part 3 Pin
Kevin Marois14-May-23 8:01
professionalKevin Marois14-May-23 8:01 
AnswerRe: NavigationControl - Part 3 Pin
Richard Deeming14-May-23 21:40
mveRichard Deeming14-May-23 21:40 
GeneralRe: NavigationControl - Part 3 Pin
Kevin Marois15-May-23 17:14
professionalKevin Marois15-May-23 17:14 
QuestionBubbling Event Question Pin
Kevin Marois9-May-23 14:32
professionalKevin Marois9-May-23 14:32 
AnswerRe: Bubbling Event Question Pin
Gerry Schmitz12-May-23 5:28
mveGerry Schmitz12-May-23 5:28 
GeneralRe: Bubbling Event Question Pin
Kevin Marois12-May-23 5:35
professionalKevin Marois12-May-23 5:35 
GeneralRe: Bubbling Event Question Pin
Gerry Schmitz12-May-23 5:46
mveGerry Schmitz12-May-23 5:46 
GeneralRe: Bubbling Event Question Pin
Kevin Marois12-May-23 6:16
professionalKevin Marois12-May-23 6:16 
AnswerRe: Bubbling Event Question Pin
Kenneth Haugland14-May-23 9:55
mvaKenneth Haugland14-May-23 9:55 
GeneralRe: Bubbling Event Question Pin
Kevin Marois14-May-23 10:40
professionalKevin Marois14-May-23 10:40 
GeneralRe: Bubbling Event Question Pin
Kenneth Haugland14-May-23 11:06
mvaKenneth Haugland14-May-23 11:06 
You will need to install the NuGet:
NuGet Gallery | Microsoft.Xaml.Behaviors.Wpf 1.1.39[^]

Then create a class like this one:
public class ButtonAttatchment:Behavior<Button>
{

    protected override void OnAttached()
    {
        AssociatedObject.Click += AssociatedObject_Click;
    }

    protected override void OnDetaching()
    {
        AssociatedObject.Click -= AssociatedObject_Click;
    }


    private void AssociatedObject_Click(object sender, System.Windows.RoutedEventArgs e)
    {
        if (AssociatedObject != null)
        {
            ((ButtonAttatchment)sender).IsSpinning = !((ButtonAttatchment)sender).IsSpinning;
        }
    }

    public static readonly DependencyProperty IsSpinningProperty = DependencyProperty.Register("IsSpinning", typeof(bool),typeof(ButtonAttatchment), new UIPropertyMetadata(false));

    public bool IsSpinning
    {
        get => (bool)GetValue(IsSpinningProperty);
        set => SetValue(IsSpinningProperty, value);
    }

}


This basically creates a code-behind implementation that you could use to fix complicated binding issues.
GeneralRe: Bubbling Event Question Pin
Kevin Marois14-May-23 11:08
professionalKevin Marois14-May-23 11:08 
GeneralRe: Bubbling Event Question Pin
Kenneth Haugland14-May-23 11:19
mvaKenneth Haugland14-May-23 11:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.