private void Connections_OnDataLoaded(EventData e, object data) { DataLoadedNotifyEventArgs args = (DataLoadedNotifyEventArgs)data; for (int i = 0; i < args.To; i++) { Connection connection = (Connection)Connections.GetItem(i); if (connection == null) { return; } connection.PropertyChanged += connection_PropertyChanged; } }
private void Contacts_OnDataLoaded(EventData e, object data) { DataLoadedNotifyEventArgs args = (DataLoadedNotifyEventArgs)data; for (int i = 0; i < args.To; i++) { Contact contact = (Contact)Contacts.GetItem(i); if (contact == null) { return; } contact.PropertyChanged += Contact_PropertyChanged; } }
public void OnSelectedRowsChanged() { SelectedRange[] selectedContacts = Contacts.GetSelectedRows(); if (selectedContacts.Length > 0) { SelectedContact.GetValue().SetValue((Contact)Contacts.GetItem(selectedContacts[0].FromRow.Value)); } else { SelectedContact.GetValue().SetValue(null); } }
void jobsViewModel_OnSelectedRowsChanged() { // Get the selected bulk delete SelectedRange[] selectedRows = JobsViewModel.GetSelectedRows(); if (selectedRows.Length > 0) { ScheduledJob job = SelectedJob.GetValue(); dev1_ScheduledJob item = (dev1_ScheduledJob)JobsViewModel.GetItem(selectedRows[0].FromRow.Value); job.RecurrancePattern.SetValue(item.dev1_RecurrancePattern); RecurrancePatternMapper.DeSerialise(job, item.dev1_RecurrancePattern); job.ScheduledJobId.SetValue(item.dev1_ScheduledJobId); job.Name.SetValue(item.dev1_Name); job.StartDate.SetValue(item.dev1_StartDate); job.RecurrancePattern.SetValue(item.dev1_RecurrancePattern); EntityReference entityName = new EntityReference(null, null, item.dev1_WorkflowName); job.WorkflowId.SetValue(entityName); // Update the dependant data grid string fetchXml = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' returntotalrecordcount='true' no-lock='true' distinct='false' count='{0}' paging-cookie='{1}' page='{2}'> <entity name='bulkdeleteoperation'> <attribute name='name' /> <attribute name='createdon' /> <attribute name='asyncoperationid' /> <filter type='and'> <condition attribute='name' operator='like' value='%" + item.dev1_ScheduledJobId.Value + @"%' /> </filter> <link-entity name='asyncoperation' to='asyncoperationid' from='asyncoperationid' link-type='inner' alias='a0'> <attribute name='postponeuntil' alias='asyncoperation_postponeuntil' /> <attribute name='statecode' alias='asyncoperation_statecode' /> <attribute name='statuscode' alias='asyncoperation_statuscode' /> <attribute name='recurrencepattern' alias='asyncoperation_recurrencepattern' /> </link-entity>{3} </entity> </fetch>"; bulkDeleteJobsViewModel.FetchXml = fetchXml; bulkDeleteJobsViewModel.Reset(); bulkDeleteJobsViewModel.Refresh(); } }
private void OnSelectedRowsChanged() { SelectedRange[] selectedContacts = Lines.GetSelectedRows(); if (selectedContacts.Length > 0) { ObservableQuoteDetail observableQuoteDetail = SelectedQuoteDetail.GetValue(); if (observableQuoteDetail.InnerQuoteDetail != null) { observableQuoteDetail.InnerQuoteDetail.PropertyChanged -= quote_PropertyChanged; } QuoteDetail selectedQuoteDetail = (QuoteDetail)Lines.GetItem(selectedContacts[0].FromRow.Value); if (selectedQuoteDetail != null) { selectedQuoteDetail.PropertyChanged += quote_PropertyChanged; } SelectedQuoteDetail.GetValue().SetValue(selectedQuoteDetail); } else { SelectedQuoteDetail.GetValue().SetValue(null); } }