Ejemplo n.º 1
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            context = (NoteNavigationContext)e.Parameter;

            noteheader.Text = context.NoteHeader;
            notebody.Text   = context.NoteBody != null? context.NoteBody:"";
        }
Ejemplo n.º 2
0
        private void listview_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var si           = (ListViewItem)listview.SelectedItem;
            var name         = si.Content;
            var selectedNote = notes.FirstOrDefault(x => x.Name == name.ToString());

            NoteNavigationContext nnc = new NoteNavigationContext()
            {
                NoteHeader  = selectedNote.Name,
                NoteBody    = selectedNote.Content,
                UserContext = context.UserContext
            };

            Frame.Navigate(typeof(EditNote), nnc);
        }
Ejemplo n.º 3
0
        private void save_Click(object sender, RoutedEventArgs e)
        {
            var result = ServiceCalls.CreateNote(context.UserContext.UserName, context.UserContext.Password, title.Text);

            if (result)
            {
                NoteNavigationContext nnc = new NoteNavigationContext()
                {
                    NoteHeader  = title.Text,
                    NoteBody    = "", //The note is empty by default...no need to fetch anything just yet
                    UserContext = context.UserContext
                };

                Frame.Navigate(typeof(EditNote), nnc);
            }
        }