New answers tagged

-1

You can already do this with regular eventargs by placing the same event handler name in several button click properties and then converting sender to button to access it's properties. You can also already call a button click event from some arbitrary element by way of using a delegate so there again, not sure how this is better, it's just different is all I ...


4

Your coworker is incorrect. When working with UI logic in MVVM, it's common to have properties for binding that are derived from other data. In these cases, you don't want to create another private member - that just adds a point of failure with no benefit. Side note: If you're using C# 6 then instead of hardcoded strings you can do ...


3

Getters like your colleague expects, are a code smell. They're only there for language niggles anyway. What they're doing is exposing a private variable. To be honest, you might as well just access the private variable directly if that's all you're using getters for and cut out a layer of middleman. Originally OO languages supported the use of accessor ...



Top 50 recent answers are included