Note that there are some explanatory texts on larger screens.

plurals
  1. POmvvm how to pass data from one view model to another view model
    primarykey
    data
    text
    <p>I have One View which has one Data grid with radio Button , onchecking radio Box , the selected row should go to other View Screen Textbox</p> <p>here is my first ViewModel</p> <pre><code>public class CampaignSearchResultsViewModel : ViewModelBase { public CampaignSearchResultsViewModel(List&lt;Lead&gt; obj) { foreach(Lead lead in obj) { SelectedLead = lead; } } public CampaignSearchResultsViewModel() { this.Commands.Add("CheckedCommand", new ActionCommand&lt;Lead&gt;(CheckIt)); Commands.Add("OutboundSelect", new ActionCommand&lt;Object&gt;(OutboundSelection)); _leads = new ObservableCollection&lt;Lead&gt;(); } public ICommand OutboundSelect { get { return Commands["OutboundSelect"]; } } public void OutboundSelection(Object obj) { } private void CheckIt(Lead lead) { SelectedLead = lead; LeadViewModel lmv = new LeadViewModel(this); } #region Private private ObservableCollection&lt;Lead&gt; _leads; public bool IsChecked { get; set; } private ICommand _checkedCommand; private object _testProperty; private Lead _selectedLead; private ICollectionView icv; #endregion private ICommand _checkedRadioCommand; private bool _inboundChecked; #region Properties public ObservableCollection&lt;Lead&gt; Leads { get { return _leads; } set { _leads = value; FirePropertyChanged("Leads"); } } public Lead SelectedLead { get { return _selectedLead; } set { _selectedLead = value; } } public ICommand CheckedCommand { get { return Commands["CheckedCommand"]; } } public bool InboundChecked { get { return _inboundChecked; } private set { if (_inboundChecked != value) { _inboundChecked = value; FirePropertyChanged("InboundChecked"); } } } #endregion } </code></pre> <p>i have to map SelectedLead to the other view model i have pass info to SearchCampaignMembers() method , how </p> <pre><code> public partial class LeadViewModel : ViewModelBase { public void SearchCampaignMembers() { _service.Load(_service.SearchCampaignMembersQuery(Entity.FirstName, Entity.LastName), lo =&gt; { if (!lo.HasError) { ListLead = lo.Entities.ToList(); _savedLeadStatusId = Entity.LeadStatusId; EntitySet = _service.Leads; if (ListLead.Count == 1) { if (Entity != null) { IsVendorLead = Entity.LeadTypeId == Lookups.LeadType.VendorLead; //Lead Update History EntityQuery&lt;LeadUpdateHistory&gt; historyquery = null; historyquery = _service.GetLeadUpdateHistoryByLeadIdQuery(Entity.LeadId); _service.Load(historyquery, l =&gt; { if (!l.HasError) { EntityHistory = _service.LeadUpdateHistories; } }, null); //Lead Assignment EntityQuery&lt;LeadsAssignment&gt; assignmentquery = null; assignmentquery = _service.GetLeadsAssignmentByLeadIdQuery(Entity.LeadId); _service.Load(assignmentquery, l =&gt; { if (!l.HasError) { EntityAssignment = _service.LeadsAssignments; } }, null); if (Entity.LeadTypeId == Lookups.LeadType.PhoneLead) { IsInboundLead = Entity.VendorId == null; IsOutboundLead = Entity.VendorId != null; } else { IsInboundLead = false; IsOutboundLead = false; } //SelectTimeToCall(Entity); if (IsOutboundLead) SelectedCampaign = Entity.LeadCampaigns.FirstOrDefault().Campaign; else SelectCampaign(Entity); OperationsListener listener = new OperationsListener(); listener.Completed += (s, args) =&gt; { CompleteInitializing(); //SwitchTab(param.InitialTab); Action action = () =&gt; { SelectDealer(Entity); }; //GetDealerRecommendation(Entity.Address.ZipCode, action); SelectStatus(Entity); //if (callback != null) // callback(); }; LoadLookupData(listener); listener.Start(); } } else if (ListLead.Count &gt;= 1) { CampaignSearchResultsViewModel vm = new CampaignSearchResultsViewModel(); foreach (Lead lead in ListLead) { vm.Leads.Add(lead); ObservableCollection&lt;Lead&gt; abc; abc = new ObservableCollection&lt;Server.DataAccess.Lead&gt;(); } ViewController.OpenDialog("SearchCampaignResults", vm, r =&gt; { }); } else if (ListLead.Count == 0) { ViewController.OpenDialog("NoResults", (r) =&gt; { }); } } else { //if (callback != null) // callback(); } }, null); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload