Пример #1
0
        public MainPage()
        {
            InitializeComponent();
            Header.Text = $"{UserInfo.Username}'s Journal";

            List <JournalList> mylist = ViewJournals.view(UserInfo.UserId);

            int total = mylist.Count();

            for (int count = 0; count < total; count++)
            {
                int    journalID = mylist[count].JournalID;
                string title     = mylist[count].Title;
                string entry     = mylist[count].Entry;


                Hyperlink link = new Hyperlink();

                link.Click += (object sender, RoutedEventArgs e) =>
                {
                    NavigationService nav = NavigationService.GetNavigationService(this);
                    nav.Navigate(new ViewEntry(journalID, title, entry));
                };

                link.Inlines.Add(title);
                TextBlock block = new TextBlock();
                block.Inlines.Add(link);
                stacker.Children.Add(block);
            }
        }
Пример #2
0
 public void SetUp()
 {
     _journals     = new Journal[] { };
     _viewJournals = new ViewJournals(this);
 }
 public void SetUp()
 {
     _journalGateway = new InMemoryJournalGateway();
     _viewJournals = new ViewJournals(_journalGateway);
     _postJournal = new PostJournal(_journalGateway);
 }