Ejemplo n.º 1
0
        private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            // Parse Navigation Args
            List <object> itemPageNavList = (List <object>)e.NavigationParameter;

            pivotPageRef   = (PivotPage)itemPageNavList.ElementAt <object>(0);
            fireflyClicked = (Firefly)itemPageNavList.ElementAt <object>(1);

            // Load details
            tblId.Text = fireflyClicked.Id;

            if (fireflyClicked.Attribute != "")
            {
                txtAttribute.Text      = fireflyClicked.Attribute;
                txtAttribute.FontStyle = Windows.UI.Text.FontStyle.Normal;
            }
            else
            {
                txtAttribute.Text      = "Not set!";
                txtAttribute.FontStyle = Windows.UI.Text.FontStyle.Italic;
            }

            if (fireflyClicked.LastUpdateTime != new DateTime(0))
            {
                tblLastUpdate.Text      = fireflyClicked.LastUpdateTime.ToString();
                tblLastUpdate.FontStyle = Windows.UI.Text.FontStyle.Normal;
            }
            else
            {
                tblLastUpdate.Text      = "Unknown";
                tblLastUpdate.FontStyle = Windows.UI.Text.FontStyle.Italic;
            }

            setLocationText();
        }
Ejemplo n.º 2
0
        private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            // Parse Navigation Args
            List <object> itemPageNavList = (List <object>)e.NavigationParameter;

            pivotPageRef = (PivotPage)itemPageNavList.ElementAt <object>(0);
            nodeClicked  = (Node)itemPageNavList.ElementAt <object>(1);

            // Load details
            tblId.Text = nodeClicked.Id;

            if (nodeClicked.Location != "")
            {
                txtLocation.Text      = nodeClicked.Location;
                txtLocation.FontStyle = Windows.UI.Text.FontStyle.Normal;
            }
            else
            {
                txtLocation.Text      = "Not set!";
                txtLocation.FontStyle = Windows.UI.Text.FontStyle.Italic;
            }

            if (nodeClicked.LastUpdateTime != new DateTime(0))
            {
                tblLastUpdate.Text      = nodeClicked.LastUpdateTime.ToString();
                tblLastUpdate.FontStyle = Windows.UI.Text.FontStyle.Normal;
            }
            else
            {
                tblLastUpdate.Text      = "Unknown";
                tblLastUpdate.FontStyle = Windows.UI.Text.FontStyle.Italic;
            }

            if (nodeClicked.FirefliesList.Count != 0)
            {
                nodeFireflies = new FireflyCollection();

                foreach (JsonValue firefly in nodeClicked.FirefliesList)
                {
                    nodeFireflies.Add(pivotPageRef.fireflies.GetById(firefly.GetString()));
                }

                lstFireflies.ItemsSource = nodeFireflies;
            }
            else
            {
                lstFireflies.Visibility = Visibility.Collapsed;
            }
        }