Bin
Bin
CC#
Created by Kekke on 12/19/2022 in #help
✅ Change a variable in method.
or private set;
58 replies
CC#
Created by Kekke on 12/19/2022 in #help
✅ Change a variable in method.
to set it: liquid.Price = (insert new price here)
58 replies
CC#
Created by Kekke on 12/19/2022 in #help
✅ Change a variable in method.
you don't you just reference it, e.g string LiquidName = liquid.name to get the name of the liquid
58 replies
CC#
Created by Kekke on 12/19/2022 in #help
✅ Change a variable in method.
same with getPrice (but type is int, not string)
58 replies
CC#
Created by Kekke on 12/19/2022 in #help
✅ Change a variable in method.
replace getName() with public string Name {get; set;}
58 replies
CC#
Created by Kekke on 12/19/2022 in #help
✅ Change a variable in method.
also rename parameter name i to price for readability, since it is used to pass in into the price of the liquid
58 replies
CC#
Created by Kekke on 12/19/2022 in #help
✅ Change a variable in method.
liquids is plural, rename it to liquid if it is single
58 replies
CC#
Created by Kekke on 12/19/2022 in #help
✅ Change a variable in method.
im a bit late i was disconnedted. did you mean u want to rename the variables quickly? if so, Press F2 if you are using visual studio code if you want to rename variables
58 replies
CC#
Created by Kekke on 12/19/2022 in #help
✅ Change a variable in method.
if you want to just change the variable name, you can assign it to another variable. Beware that if it is a class, it will reflect change made from any variable across different variable where you assign them to different variables
Liquid coffee = new Liquid()
Liquids pepsi = coffee
Liquids fanta = pepsi
Liquid coffee = new Liquid()
Liquids pepsi = coffee
Liquids fanta = pepsi
58 replies
CC#
Created by Kekke on 12/19/2022 in #help
✅ Change a variable in method.
not sure what your intention here, dont understand your question completely, but anyway you could store the result of coffee.getPrice() call to a variable, e.g double coffeePrice = coffee.getPrice() then reuse the same variable of coffeePrice whenever you need to get the price again
58 replies
CC#
Created by Dawnbomb on 12/18/2022 in #help
❔ how can WPF change the hover mouseover color of something like Winforms can?
exactly. Been using winforms to create short project, then introduce myself to wpf, struggling to use it than winform, and now after been patiently adapting myself to the learning curve of wpf, i never looked back to winform
25 replies
CC#
Created by Dawnbomb on 12/18/2022 in #help
❔ how can WPF change the hover mouseover color of something like Winforms can?
i have heard another framework called avalonia, which is similar to wpf but never tried myself
25 replies
CC#
Created by Dawnbomb on 12/18/2022 in #help
❔ how can WPF change the hover mouseover color of something like Winforms can?
haven't develop a GUI desktop application myself for long time so ¯\_(ツ)_/¯
25 replies
CC#
Created by Dawnbomb on 12/18/2022 in #help
❔ how can WPF change the hover mouseover color of something like Winforms can?
i agree
25 replies
CC#
Created by Dawnbomb on 12/18/2022 in #help
❔ how can WPF change the hover mouseover color of something like Winforms can?
either be patience and enjoy the learning progress or yeah...
25 replies
CC#
Created by Dawnbomb on 12/18/2022 in #help
❔ how can WPF change the hover mouseover color of something like Winforms can?
i can understand, i was there. First time i learn a new so called concept MVVM just makes me question "why the hell should i do something that does exaclty same for 10 times much slower in terms of development time". As time pass, now i embrace that concept and never look back
25 replies
CC#
Created by Dawnbomb on 12/18/2022 in #help
❔ how can WPF change the hover mouseover color of something like Winforms can?
mhm, i dont know much about winforms but wpf is very flexible because u are using XAML to do such UI related task
25 replies
CC#
Created by Dawnbomb on 12/18/2022 in #help
❔ how can WPF change the hover mouseover color of something like Winforms can?
i have watched this tutorial a few months back and you could watch it too in case you don't know what a trigger is https://www.youtube.com/watch?v=kc5MapV54e0
25 replies
CC#
Created by Dawnbomb on 12/18/2022 in #help
❔ how can WPF change the hover mouseover color of something like Winforms can?
you can use triggers that trigger when IsMouseOver property is set to true. related question about mouseover change color of button, haven't read it thoroughly yet but i hope you'll get the answer there https://stackoverflow.com/questions/20073294/change-color-of-button-when-mouse-is-over
25 replies
CC#
Created by Oli on 12/18/2022 in #help
✅ Need some help with classes
no offense but this is the first time i heard such mweh probably i never socialize much with someone who codes before
30 replies