These are chat archives for picoe/Eto

3rd
May 2017
Simonas G
@SlowLogicBoy
May 03 2017 07:08
Hey, I'm creating a Button from command, how do I change button image when image in Command changes?
In command, Image changes accordingly to it's DataContext property
button.Bind (b => b.Image, self, c => c.Image);
where self is command, but since command does not implement INotifyPropertyChanged it does nothing
Curtis Wensley
@cwensley
May 03 2017 07:13
why not just change the command itself instead of the image in the command?
the image isn't wired up to change the button when it's changed in a command.. yet
Simonas G
@SlowLogicBoy
May 03 2017 07:24
How do I change command in a button within a command ? :)
what partially solved my problem is:
class MyCommand : Command, INotifyPropertyChanged
Curtis Wensley
@cwensley
May 03 2017 07:25
well wouldn't your command be created from a viewmodel? the viewmodel would then just change the command property
so class MyViewModel { Command MyCommand { get; set; } }, with appropriate INotifyPropertyChanged
when you create MyCommand, you can pass MyViewModel or a delegate that can change MyCommand to whatever else
Simonas G
@SlowLogicBoy
May 03 2017 07:27
yea that makes sense, thanks
Curtis Wensley
@cwensley
May 03 2017 07:28
any time!
Simonas G
@SlowLogicBoy
May 03 2017 07:28
I just binddatacontext to button command
Curtis Wensley
@cwensley
May 03 2017 07:34
yup