/// <summary> /// Initializes this application. /// </summary> private void Initialize() { // Initialize commands this.DeleteItem = new DeleteItemCommand(this); // Create account list p_AccountList = new ObservableCollection <Account>(); // Subscribe to CollectionChanged event p_AccountList.CollectionChanged += OnAccountListChanged; // Add items to the list IOrganizationService service = ConnectToCRM(); if (service != null) { p_AccountList = FetchXMLSample(service); } // Initialize list index this.AccountList = SequencingService.SetCollectionSequence(this.AccountList); // Update bindings base.RaisePropertyChangedEvent("AccountList"); }
private void OnLoaded() { Users = new ObservableCollection <UserExt>(); Users.CollectionChanged += Users_CollectionChanged; foreach (var usr in UserServices.GetAll(true)) { Users.Add(new UserExt { ID = usr.ID, Username = usr.Username, Password = usr.Password.Substring(usr.Password.Length).PadLeft(usr.Password.Length, '*'), Name = usr.Name, Email = usr.Email, Address = usr.Address, RoleID = usr.RoleID, ModifiedOn = usr.ModifiedOn, ModifiedBy = usr.ModifiedBy, IsEditable = usr.Username == AuthenticatedUser ? true : false }); } PopulateRoleComboBox(); CollectionViewSource.GetDefaultView(Users).Filter = UserFilter; Users = SequencingService.SetCollectionSequence(Users); RaisePropertyChanged("Users"); }
/// <summary> /// Updates the ItemCount Property when the AccountList collection changes. /// </summary> void OnAccountListChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { // Update item count this.ItemCount = this.AccountList.Count; // Resequence list SequencingService.SetCollectionSequence(this.AccountList); }
public void OnResetSearch() { SearchWord = null; //foreach (ARFCN arfcn in _ARFCNs) //{ // if (arfcn != null) // { // Calls.Union(arfcn.Call); // } //} Calls = TransferDB.Calls; SequencingService.SetCollectionSequence(Calls); }
private void OnLoaded() { if (notification.ParentItem != null) { var obj = notification.ParentItem; MaximumValue = obj.Quantity - obj.QtyReceived.GetValueOrDefault(); } EunKGs = new ObservableCollection <EunKGExt>(); EunKGs.CollectionChanged += EunKGs_CollectionChanged; var tempObj = new List <EunKG>(); if (!string.IsNullOrEmpty(State) && State == "RefreshGrid") { tempObj = EunKGServices.GetAll(true).Where(y => y.GRID == notification.ParentItem.ID).ToList(); } else { tempObj = notification.Items.ToList(); } foreach (var item in tempObj) { EunKGs.Add(new EunKGExt { ID = item.ID, GRID = item.GRID, PO = item.GoodsReceive.PurchaseOrder, SAPNO = item.GoodsReceive.Material, EN = item.GoodsReceive.MaterialShortText, EUN = item.GoodsReceive.Eun, Qty = item.Quantity, BIN = item.GoodsReceive.StorageBin, ModifiedOn = item.ModifiedOn, ModifiedBy = item.ModifiedBy, IsChecked = false }); } EunKGs = SequencingService.SetCollectionSequence(EunKGs); RaisePropertyChanged("EunKGs"); CollectionView = new ListCollectionView(EunKGs); CollectionViewSource.GetDefaultView(CollectionView).Filter = EunKGFilter; }
private void OnLoaded() { Location = new ObservableCollection <LocationExt>(); Location.CollectionChanged += Location_CollectionChanged; foreach (var r in LocationServices.GetAll()) { Location.Add(new LocationExt { ID = r.ID, LocationDesc = r.LocationDesc, ModifiedOn = r.ModifiedOn, ModifiedBy = r.ModifiedBy }); } CollectionViewSource.GetDefaultView(Location).Filter = LocationFilter; Location = SequencingService.SetCollectionSequence(Location); RaisePropertyChanged("Location"); }
private void OnLoaded() { Reasons = new ObservableCollection <ReasonExt>(); Reasons.CollectionChanged += Reasons_CollectionChanged; foreach (var r in ReasonServices.GetAll()) { Reasons.Add(new ReasonExt { ID = r.ID, ReasonDesc = r.ReasonDesc, ModifiedOn = r.ModifiedOn, ModifiedBy = r.ModifiedBy }); } CollectionViewSource.GetDefaultView(Reasons).Filter = ReasonFilter; Reasons = SequencingService.SetCollectionSequence(Reasons); RaisePropertyChanged("Reasons"); }
private void OnLoaded() { Countries = new ObservableCollection <CountryExt>(); Countries.CollectionChanged += Countries_CollectionChanged; foreach (var r in CountryServices.GetAll()) { Countries.Add(new CountryExt { ID = r.ID, CountryDesc = r.CountryDesc, ModifiedOn = r.ModifiedOn, ModifiedBy = r.ModifiedBy }); } CollectionViewSource.GetDefaultView(Countries).Filter = CountryFilter; Countries = SequencingService.SetCollectionSequence(Countries); RaisePropertyChanged("Countries"); }
/// <summary> /// Initializes this application. /// </summary> private void Initialize() { // Initialize commands this.DeleteItem = new DeleteItemCommand(this); // Create grocery list p_GroceryList = new ObservableCollection <GroceryItem>(); // Subscribe to CollectionChanged event p_GroceryList.CollectionChanged += OnGroceryListChanged; // Add items to the list p_GroceryList.Add(new GroceryItem("Macaroni")); p_GroceryList.Add(new GroceryItem("Shredded Wheat")); p_GroceryList.Add(new GroceryItem("Fish Filets")); p_GroceryList.Add(new GroceryItem("Hamburger Buns")); p_GroceryList.Add(new GroceryItem("Whipped Cream")); p_GroceryList.Add(new GroceryItem("Soft Drinks")); p_GroceryList.Add(new GroceryItem("Bread")); p_GroceryList.Add(new GroceryItem("Ice Cream")); p_GroceryList.Add(new GroceryItem("Chocolate Pudding")); p_GroceryList.Add(new GroceryItem("Sliced Turkey")); p_GroceryList.Add(new GroceryItem("Turkey Dressing")); p_GroceryList.Add(new GroceryItem("Cranberry Sauce")); p_GroceryList.Add(new GroceryItem("Swiss Cheese")); p_GroceryList.Add(new GroceryItem("Mushrooms")); p_GroceryList.Add(new GroceryItem("Butter")); p_GroceryList.Add(new GroceryItem("Eggs")); p_GroceryList.Add(new GroceryItem("Potatoes")); p_GroceryList.Add(new GroceryItem("Onion")); // Initialize list index this.GroceryList = SequencingService.SetCollectionSequence(this.GroceryList); // Update bindings base.RaisePropertyChangedEvent("GroceryList"); }
public void Initialized() { Search = new RelayCommand(OnSearch); ResetSearch = new RelayCommand(OnResetSearch); Calls = new ObservableCollection <Call>(); //_ARFCNs = TransferDB.ARFCNs; //foreach(ARFCN arfcn in _ARFCNs) //{ // if(arfcn!=null) // { // Calls.Union(arfcn.Call); // } //} Calls = TransferDB.Calls; SequencingService.SetCollectionSequence(Calls); //_Calls.CollectionChanged += _Calls_CollectionChanged; #if (DEBUG) #else #endif }
private void Location_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { ItemCount = Location.Count; SequencingService.SetCollectionSequence(Location); }
private void Reasons_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { ItemCount = Reasons.Count; SequencingService.SetCollectionSequence(Reasons); }
private void Countries_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { ItemCount = Countries.Count; SequencingService.SetCollectionSequence(Countries); }
private void Users_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { ItemCount = Users.Count; SequencingService.SetCollectionSequence(Users); }
private void EunKGs_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { ItemCount = EunKGs.Count; SequencingService.SequenceParent = notification.ParentItem; SequencingService.SetCollectionSequence(EunKGs); }