public FamilySupportSubPage(SurfaceWindow1 window, String name)
        {
            sw1 = window;
            InitializeComponent();

            /* As the user goes through the pages, the next page slides into focus from the right.
             * The current page slides to the left and disappears. Vice versa, as the user goes
             * back, the previous page slides into focus from the left and the current page slides
             * to the right and disappears.
             */
            sw1.hideP = (window.Resources["SlidePageLeftExit"] as Storyboard).Clone();
            sw1.showP = (window.Resources["SlidePageLeftEntry"] as Storyboard).Clone();

            //read the xml file
            XmlDocument xml = new XmlDocument();
            xml.Load("Resources/xml/FamilySupportInfo.xml");

            headingLabel.Content = xml.SelectSingleNode("//pages/"+name+"/heading/text()").Value;
            XmlNode imageNode = xml.SelectSingleNode("//pages/" + name + "/img");

            //show the image if there is one, and reduce the width of the TextBlock to accomodate it
            if (imageNode != null)
            {
                bodyImage.Source = new BitmapImage(new Uri("/CCF2;component/" + imageNode.Attributes["src"].Value, UriKind.Relative));
                bodyImage.Visibility = System.Windows.Visibility.Visible;
                bodyText.Width = 740;
            }
            bodyText.Text = xml.SelectSingleNode("//pages/" + name + "/content").InnerText.Trim();
        }
Пример #2
0
 public SubMenuPage(SurfaceWindow1 window, String name)
 {
     sw1 = window;
     InitializeComponent();
     sw1.hideP = (window.Resources["SlidePageLeftExit"] as Storyboard).Clone();
     sw1.showP = (window.Resources["SlidePageLeftEntry"] as Storyboard).Clone();
 }
Пример #3
0
        public HomePage(SurfaceWindow1 window, string name)
        {
            sw1 = window;
            InitializeComponent();

            /* As the user goes back, the previous page slides into focus from the left and
             * the current page slides to the right and disappears.
             */
            sw1.hideP = (window.Resources["SlidePageLeftExit"] as Storyboard).Clone();
            sw1.showP = (window.Resources["SlidePageLeftEntry"] as Storyboard).Clone();
        }
Пример #4
0
        public HomePage(SurfaceWindow1 window)
        {
            sw1 = window;
            InitializeComponent();

            /* As the user goes through the pages, the next page slides into focus from the right.
             * The current page slides to the left and disappears.
             */
            sw1.hideP = (window.Resources["SlidePageRightExit"] as Storyboard).Clone();
            sw1.showP = (window.Resources["SlidePageRightEntry"] as Storyboard).Clone();
        }
Пример #5
0
        public ContactUsPage(SurfaceWindow1 window, String name)
        {
            sw1 = window;
            InitializeComponent();

            /* As the user goes through the pages, the next page slides into focus from the right.
             * The current page slides to the left and disappears. Vice versa, as the user goes
             * back, the previous page slides into focus from the left and the current page slides
             * to the right and disappears.
             */
            if (name == "testNE")
            {
                sw1.hideP = (window.Resources["SlidePageLeftExit"] as Storyboard).Clone();
                sw1.showP = (window.Resources["SlidePageLeftEntry"] as Storyboard).Clone();
            }
            else
            {
                sw1.hideP = (window.Resources["SlidePageRightExit"] as Storyboard).Clone();
                sw1.showP = (window.Resources["SlidePageRightEntry"] as Storyboard).Clone();
            }

            //Reading in tweets form the XML file
            XDocument doc = XDocument.Load("Resources/xml/Tweets.xml");
            var tweetmes = doc.Element("Tweets").Elements("Tweet");

            ObservableCollection<TweetModel> result = new ObservableCollection<TweetModel>();
            foreach (XElement message in tweetmes)
            {
                TweetModel tweet = new TweetModel()
                {
                    Text = message.Attribute("Text").Value,

                    ScreenName = message.Attribute("ScreenName").Value,
                    UserName = "******" + message.Attribute("UserName").Value,
                    PublicationDate = message.Attribute("PublicationDate").Value,
                    Image = message.Attribute("Image").Value
                };

                result.Add(tweet);
            }

            //Changing the data context to update the tweetlist
            this.Tweets = result;
            this.tweetsListView.DataContext = this;
            this.DataContext = this;

            //UserTweetsWidget = new UserTweetsViewModel("ChildCancerNZ", 20);
            //this.DataContext = this;
        }
Пример #6
0
        public WelcomeScreen(SurfaceWindow1 window)
        {
            sw1 = window;
            InitializeComponent();

            /* As the user goes through the pages, the next page slides into focus from the right.
             * The current page slides to the left and disappears. Vice versa, as the user goes
             * back, the previous page slides into focus from the left and the current page slides
             * to the right and disappears.
             */
            sw1.hideP = (window.Resources["SlidePageRightExit"] as Storyboard).Clone();
            sw1.showP = (window.Resources["SlidePageRightEntry"] as Storyboard).Clone();
            //mainVideo.Source = new Uri("Resources/CCFVideo.mp4" + UriKind.RelativeOrAbsolute);
            //mainVideo.Play();
        }
Пример #7
0
        public testNE(SurfaceWindow1 window, String name)
        {
            sw1 = window;
            InitializeComponent();

            //If new page is initiated from the home page, it comes in the form the right
            if (name == "testNE")
            {
                sw1.hideP = (window.Resources["SlidePageLeftExit"] as Storyboard).Clone();
                sw1.showP = (window.Resources["SlidePageLeftEntry"] as Storyboard).Clone();
            }
            else  // else it comes in the from the left
            {
                sw1.hideP = (window.Resources["SlidePageRightExit"] as Storyboard).Clone();
                sw1.showP = (window.Resources["SlidePageRightEntry"] as Storyboard).Clone();
            }
        }
Пример #8
0
        public EventsPage(SurfaceWindow1 window, String itemID)
        {
            sw1 = window;
            InitializeComponent();

            /* As the user goes through the pages, the next page slides into focus from the right.
             * The current page slides to the left and disappears. Vice versa, as the user goes
             * back, the previous page slides into focus from the left and the current page slides
             * to the right and disappears.
             */
            sw1.hideP = (window.Resources["SlidePageLeftExit"] as Storyboard).Clone();
            sw1.showP = (window.Resources["SlidePageLeftEntry"] as Storyboard).Clone();

            //read the xml file
            XmlDocument xml = new XmlDocument();
            xml.Load("Resources/xml/Events.xml");

            //find the event item in the xml file
            //display the title, date and location (details), blurb and photos
            foreach (XmlNode node in xml.SelectNodes("//Events/item"))
            {
                String id = node.SelectSingleNode("id/text()").Value;
                if (id == itemID)
                {
                    XmlNode imageNode = node.SelectSingleNode("photos/img");
                    headingLabel.Content = node.SelectSingleNode("title/text()").Value;
                    detailsText.Text = node.SelectSingleNode("details/text()").Value;
                    bodyText.Text = node.SelectSingleNode("blurb/text()").InnerText.Trim();

                    if (imageNode != null)
                    {
                        //ignore the first image because it is from the events page, and often an identical one exists in the item page
                        //thus this prevents double-ups
                        foreach (XmlNode n in imageNode.SelectNodes("following-sibling::img"))
                        {
                            Uri imgUri = new Uri(Directory.GetCurrentDirectory() + "/" + n.Attributes["src"].Value, UriKind.Absolute);
                            imagesPanel.Children.Add(new Image() { Source = new BitmapImage(imgUri), Margin = new Thickness(4), Height = 250, Stretch = Stretch.UniformToFill });
                        }
                    }
                }
            }
        }
Пример #9
0
        public WhatWeDo(SurfaceWindow1 window, String name)
        {
            sw1 = window;
            InitializeComponent();

            /* As the user goes through the pages, the next page slides into focus from the right.
             * The current page slides to the left and disappears. Vice versa, as the user goes
             * back, the previous page slides into focus from the left and the current page slides
             * to the right and disappears.
             */
            if (name == "whatwedo")
            {
                sw1.hideP = (window.Resources["SlidePageLeftExit"] as Storyboard).Clone();
                sw1.showP = (window.Resources["SlidePageLeftEntry"] as Storyboard).Clone();
            }
            else
            {
                sw1.hideP = (window.Resources["SlidePageRightExit"] as Storyboard).Clone();
                sw1.showP = (window.Resources["SlidePageRightEntry"] as Storyboard).Clone();
            }
        }
        /* As the user goes through the pages, the next page slides into focus from the right.
         * The current page slides to the left and disappears. Vice versa, as the user goes
         * back, the previous page slides into focus from the left and the current page slides
         * to the right and disappears.
         */
        public OurStoriesSubPage(SurfaceWindow1 window, String name)
        {
            sw1 = window;
            InitializeComponent();
            sw1.hideP = (window.Resources["SlidePageLeftExit"] as Storyboard).Clone();
            sw1.showP = (window.Resources["SlidePageLeftEntry"] as Storyboard).Clone();

            //read the xml file
            XmlDocument xml = new XmlDocument();
            xml.Load("Resources/xml/OurStoriesInfo.xml");

            headingLabel.Content = xml.SelectSingleNode("//pages/" + name + "/heading/text()").Value;
            XmlNode imageNode = xml.SelectSingleNode("//pages/" + name + "/img");

            //show the image if there is one, and reduce the width of the TextBlock to accomodate it
            if (imageNode != null)
            {
                bodyImage.Source = new BitmapImage(new Uri("/CCF2;component/" + imageNode.Attributes["src"].Value, UriKind.Relative));
                bodyImage.Visibility = System.Windows.Visibility.Visible;
                bodyText.Width = 740;
            }
            bodyText.Text = xml.SelectSingleNode("//pages/" + name + "/content").InnerText.Trim();
        }
Пример #11
0
        public NewsAndEvents(SurfaceWindow1 window, String name)
        {
            sw3 = window;
            InitializeComponent();

            showNewsOrEvents("News", newsPanel);
            showNewsOrEvents("Events", eventsPanel);

            /* As the user goes through the pages, the next page slides into focus from the right.
             * The current page slides to the left and disappears. Vice versa, as the user goes
             * back, the previous page slides into focus from the left and the current page slides
             * to the right and disappears.
             */
            if (name == "newsandevents")
            {
                sw3.hideP = (window.Resources["SlidePageLeftExit"] as Storyboard).Clone();
                sw3.showP = (window.Resources["SlidePageLeftEntry"] as Storyboard).Clone();
            }
            else  // else it comes in the from the left
            {
                sw3.hideP = (window.Resources["SlidePageRightExit"] as Storyboard).Clone();
                sw3.showP = (window.Resources["SlidePageRightEntry"] as Storyboard).Clone();
            }
        }