public void Refresh()
 {
     VendorCache.GetInstance().Clear();
     Vendors = new ObservableCollection <Vendor>(VendorCache.GetInstance().Vendors);
     ListViewVendors.ItemsSource  = Vendors;
     ListViewVendors.SelectedItem = GetFirstVendor();
 }
 private void SaveVendor(Vendor vendorToSave)
 {
     if (vendorToSave.Id > 0)
     {
         VendorCache.GetInstance().Update(vendorToSave);
     }
     else
     {
         VendorCache.GetInstance().Insert(vendorToSave);
     }
     Vendors = new ObservableCollection <Vendor>(VendorCache.GetInstance().Vendors);
 }
 private void DeleteSelectedVendor()
 {
     VendorCache.GetInstance().Delete(ListViewVendors.SelectedItem as Vendor);
     Vendors = new ObservableCollection <Vendor>(VendorCache.GetInstance().Vendors);
 }