c# - Navigating records in a databound WPF window -
i'm new wpf , i've been reading many tutorials , yet while find many guides showed how bind data textboxes , such, couldn't find navigating such data through back/forward/etc. buttons.
this current situation: have customer class containing data on single customer , customers class observablecollection of customer. data loaded sqlite database (and opens can of worms because don't know exact approach working out doesn't pertain current issue since more or less got work) , every customer added collection.
then in viewmodel main form have following stuff:
private customer _objcustomer; private customers _customers; private customer _selectedcustomer; public customer selection { { return _selectedcustomer; } set { if (object.referenceequals(value, _selectedpartecipante)) { return; } _selectedcustomer = value; base.onpropertychanged("selection"); } } public customers customers { { return _partecipanti; } set { _customers = value; base.onpropertychanged("customers"); } } public customer customer { { return _objcustomer; } set { _objcustomer = value; base.onpropertychanged("customer"); } } public string name { { return _objcustomer.name; } set { _objcustomer.name = value; base.onpropertychanged("name"); } } public int id { { return _objcustomer.id; } } public subscriptionsviewmodel() { _customers = customers.loadcustomers(); //this 1 loads items database _objcustomers = _customers.first(); _selectedcustomer = _objcustomer; } this wrong still can't find way fix it, supposed work navigation working? , how data in current record saved when pressing button on form?
try put exact property in onpropertychanged("customers"); in case, property lower case.
Comments
Post a Comment