Ejemplo n.º 1
0
        // When page is navigated to set data context to selected item in list
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            string projectId, workItemId;
            if (NavigationContext.QueryString.TryGetValue("project", out projectId) &&
                NavigationContext.QueryString.TryGetValue("workitem", out workItemId))
            {
                Guid pId = Guid.Parse(projectId);
                Guid wId = Guid.Parse(workItemId);

                project = Service.Instance.Projects.FirstOrDefault(p => p.Id == pId);
                if (project != null)
                {
                    workItem = project.WorkItems.FirstOrDefault(w => w.Id == wId);
                }

                if (workItem == null)
                {
                    NavigationService.GoBack();
                    return;
                }

                DataContext = workItem;
            }
        }
Ejemplo n.º 2
0
 public bool Equals(WorkItem other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other.Id.Equals(Id);
 }