C#C
C#2y ago
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();
        }
    }


ViewModel.cs
        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
Was this page helpful?