public TwitterList(TopLevelPage top) { InitializeComponent(); _topLevelPage = top; listTweetsInTheScrollViewer(); setupScreenAnimation(); }
/// <summary> /// Home page for the How Can I Help Section /// </summary> /// <param name="tlpage">Access Object to the Home page</param> public hcihHomeControl(TopLevelPage tlpage) { InitializeComponent(); topLevelPage = tlpage; Color colour = Util._pageColDict["How Can I Help?"]; //Set the images for all the poloroids donate.setImage("images\\HowCanIHelp\\donate.png"); donate.setCaption("Donate"); donate.setColour(colour); beadsOfCourage.setImage("images\\HowCanIHelp\\beads.png"); beadsOfCourage.setCaption("Beads of Courage"); beadsOfCourage.setColour(colour); schools.setImage("images\\HowCanIHelp\\schools.png"); schools.setCaption("Schools"); schools.setColour(colour); volunteer.setImage("images/Home/howCanIHelp.png"); volunteer.setCaption("Volunteer"); volunteer.setColour(colour); campaigns.setImage("images\\HowCanIHelp\\camp.png"); campaigns.setCaption("Campaigns"); campaigns.setColour(colour); shop.setImage("images\\HowCanIhelp\\bb.png"); shop.setCaption("Online Shop"); shop.setColour(colour); fundraise.setImage("images\\HowCanIHelp\\fundraise.png"); fundraise.setCaption("Fundraise"); fundraise.setColour(colour); gift.setImage("images\\HowCanIHelp\\gift.png"); gift.setCaption("Make a Gift"); gift.setColour(colour); //This maintains a list of all the poloroids that need to be animated on screen change components = new List<Animatiable>(); components.Add(donate); components.Add(beadsOfCourage); components.Add(schools); components.Add(volunteer); components.Add(campaigns); components.Add(shop); components.Add(fundraise); components.Add(gift); }
/// <summary> /// Helper method to help animate the twitterBox screen /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void pushTwitterList(object sender, EventArgs e) { // create a new subscreen and push it into the stack of subscreens TopLevelPage nextScreen = new TopLevelPage(ParentWindow, "Twitter"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("Twitter"), Util._pageColDict["Extra"], new TwitterList(nextScreen), "Our Tweets"); nextScreen.AnimateIn(); dt.Stop(); }
private void pushNews(object sender, EventArgs e) { // create a new subscreen and push it into the stack of subscreens TopLevelPage nextScreen = new TopLevelPage(ParentWindow, "News"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("News"), news.colour, new ScrollableView("News"), ""); nextScreen.AnimateIn(); dt.Stop(); }
private void pushHCIH(object sender, EventArgs e) { // create a new subscreen and push it into the stack of subscreens TopLevelPage nextScreen = new TopLevelPage(ParentWindow, "How Can I Help?"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("How Can I Help?"), howCanIHelp.colour, new hcihHomeControl(nextScreen), ""); nextScreen.AnimateIn(); dt.Stop(); }
private void pushFS(object sender, EventArgs e) { // create a new subscreen and push it into the stack of subscreens TopLevelPage nextScreen = new TopLevelPage(ParentWindow, "Family Support"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("Family Support"), familySupport.colour, new fsHomeControl(), ""); nextScreen.AnimateIn(); dt.Stop(); }
private void pushCU(object sender, EventArgs e) { // create a new subscreen and push it into the stack of subscreens TopLevelPage nextScreen = new TopLevelPage(ParentWindow, "Contact Us"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("Contact Us"), contactUs.colour, new ContactUs(), ""); nextScreen.AnimateIn(); dt.Stop(); }
private void pushBeads(object sender, EventArgs e) { // create a new subscreen and push it into the stack of subscreens TopLevelPage nextScreen = new TopLevelPage(ParentWindow, "Beads of Courage"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("Beads of Courage"), playBeads.colour, new BeadsOfCourage(), ""); nextScreen.AnimateIn(); dt.Stop(); }
private void pushAbout(object sender, EventArgs e) { TopLevelPage nextScreen = new TopLevelPage(ParentWindow, "About"); String path = Path.Combine(Path.GetFullPath("."), "Resources/xml/About.xml"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("About"), about.colour, new GridView(XMLUtilities.GetContentFromFile(path)), ""); nextScreen.AnimateIn(); dt.Stop(); }
/// <summary> /// This event takes care of moving around contents of the stack and the re-laying the buttons on the right /// </summary> /// <param name="sender">The sender needs to be of type RightButton</param> /// <param name="e"></param> private void Button_Click(object sender, MouseButtonEventArgs e) { TopWindow ParentWindow = (TopWindow) Window.GetWindow(this); TopLevelPage nextScreen; String caption = (sender as RightButton).Caption; Color colour = (sender as RightButton).Colour; Console.WriteLine("Button clocked - {0}", caption); //Set next screen to add to the stack and it's contents depending on the button clicked String path; switch (caption) { case "About": nextScreen = new TopLevelPage(ParentWindow, "About"); path = Path.Combine(Path.GetFullPath("."), "Resources/xml/About.xml"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("About"), colour, new GridView(XMLUtilities.GetContentFromFile(path)), ""); break; case "News": nextScreen = new TopLevelPage(ParentWindow, "News"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("News"), colour, new ScrollableView("News"), ""); break; case "How Can I Help?": nextScreen = new TopLevelPage(ParentWindow, "How Can I Help?"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("How Can I Help?"), colour, new hcihHomeControl(nextScreen), ""); break; case "Events": nextScreen = new TopLevelPage(ParentWindow, "Events"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("Events"), colour, new ScrollableView("Events"), ""); break; case "Family Support": nextScreen = new TopLevelPage(ParentWindow, "Family Support"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("Family Support"), colour, new fsHomeControl(), ""); break; case "Beads of Courage": nextScreen = new TopLevelPage(ParentWindow, "Beads of Courage"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("Beads of Courage"), colour, new BeadsOfCourage(), ""); break; case "Contact Us": nextScreen = new TopLevelPage(ParentWindow, "Contact Us"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("Contact Us"), colour, new ContactUs(), ""); break; case "Twitter": nextScreen = new TopLevelPage(ParentWindow, "Twitter"); ParentWindow.pushScreenOnStack(nextScreen, Util.getLinks("Twitter"), colour, new TwitterList(nextScreen), "Our Tweets"); break; default: //This should never happen. throw new ArgumentException("Button Target not defined. Button caption: " + caption, "sender"); } }
/// <summary> /// push the given screen into the screen stack /// </summary> public void pushScreenOnStack(TopLevelPage nextScreen, String[] buttons, Color colour, UserControl content, String Subtitle) { nextScreen.setButtons(buttons); nextScreen.setTitleColour(colour); nextScreen.setContent(content); nextScreen.setSubtitle(Subtitle); popAll(); pushScreen(nextScreen); try { (content as Animatiable).AnimateIn(); } catch (NullReferenceException) { //Do nothing with this } }
/// <summary> /// setter of the topLevelPage /// </summary> /// <param name="top"></param> public void setTopPage(TopLevelPage top) { topLevelPage = top; }