© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
24 replies
remi.nz

✅ Problem with Data Binding

Okay so I'm using Items Control to populate a bunch of Expanders, the expander header is supposed to have two buttons and I'm trying to bind the Commands but it's not working, what's weird is that I've set the Data Context properly and other things like AppIcon, AppName and everything else gets binded properly except for the button Commands and Parameters, can you help me?

View.xaml.cs
    public partial class StartupApps : UserControl
    {
        public StartupApps()
        {
            InitializeComponent();
            DataContext = new StartupAppsVM();
        }
    }
    public partial class StartupApps : UserControl
    {
        public StartupApps()
        {
            InitializeComponent();
            DataContext = new StartupAppsVM();
        }
    }


ViewModel.cs
        public ICommand OpenAppLocation { get; set; }
        public ICommand OpenRegLocation { get; set; }

        public StartupAppsVM()
        {
            OpenAppLocation = new RelayCommand(OpenAppLocationCommand);
            OpenRegLocation = new RelayCommand(OpenRegLocationCommand);
            LoadStartupApps();
        }
        public ICommand OpenAppLocation { get; set; }
        public ICommand OpenRegLocation { get; set; }

        public StartupAppsVM()
        {
            OpenAppLocation = new RelayCommand(OpenAppLocationCommand);
            OpenRegLocation = new RelayCommand(OpenRegLocationCommand);
            LoadStartupApps();
        }


XAML: https://paste.mod.gg/llsvpcqqfqjj/0
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Problem with binding
C#CC# / help
13mo ago
✅ Problem with binding (#AvaloniaUI)
C#CC# / help
12mo ago
❔ Data binding
C#CC# / help
3y ago