C
C#2y ago
Elio

❔ Multiple command

Hello, i'd like to implement 2 command on 1 button. I wanna confirm if this composite command class is a good way of resolving my problem or if here is other solution that i'm not aware of.
8 Replies
ero
ero2y ago
I'd maybe add some operators or Add methods Not sure about using IEnumerable here Maybe List would be better (especially for future adding)
Elio
ElioOP2y ago
IEnurable should be fine for my case cause i do not want to add futher command after the creation of my command what do u mean i'm not sure to understand ohh i think i've understand your thought, you mean to add more command i'm i wrong ?
ero
ero2y ago
That's right
Elio
ElioOP2y ago
cause on internet i've found these 2 solutions and wanna know if mine is fine too compared to them https://stackoverflow.com/questions/22803913/binding-two-commands-to-one-button
ero
ero2y ago
Does it work? Then it's fine. Does it not work? Then it's not fine It's as easy as that
Elio
ElioOP2y ago
i agree ahah but some time there is easier solution to implement 😄 i will go with that then thanks for your tips 🙂
sibber
sibber2y ago
make sure to implement CanExecute too
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server