1

I'm confused which type I use to create model in project, Struct or Class? There're about ten struct and some collections. I'm a newbie.

SubmarineX
  • 840
  • 5
  • 17
  • 38

3 Answers3

2

You should never create a mutable struct.

View models should always be classes.

Community
  • 1
  • 1
SLaks
  • 837,282
  • 173
  • 1,862
  • 1,933
2

You should always use classes as ViewModel or Model in WPF.

Nikhil Agrawal
  • 44,717
  • 22
  • 115
  • 201
1

As a newbie, don't use structs. There are subtleties to the way they work that will mess you up.

spender
  • 112,247
  • 30
  • 221
  • 334