Source code of WP7 notepad

Source: Internet
Author: User

First

This notebook is easy to operate and has powerful functions. It adds the ability to send text messages and emails Based on the notebook. This application has also been certified by Microsoft. The 115 network disk is the latest one.
QQ: 29992379
:

Http://115.com/file/e7bxlvs9 #

Memo. xap

Entity class

Public class note <br/>{< br/> Public String noteguid {Get; Set ;}< br/> Public String notecontent {Get; Set ;} <br/> Public String notetime {Get; Set ;}< br/>}
Generate a storage structure in the independent storage.

 

 

If (! Isolatedstoragesettings. applicationsettings. contains ("Notes") <br/>{< br/> List <Note> Notes = new list <Note> (); <br/> isolatedstoragesettings. applicationsettings ["Notes"] = notes as list <Note >;< br/> isolatedstoragesettings. applicationsettings. save (); </P> <p>}
BindArticleAnd sort by serial number in a descending order.

 

 

Public partial class mainpage: phoneapplicationpage <br/>{< br/> // constructor <br/> Public mainpage () <br/>{< br/> initializecomponent (); <br/> bingdata (); <br/>}< br/> List <Note> Notes = new list <Note> (); <br/> private void bingdata () <br/>{< br/> Notes = isolatedstoragesettings. applicationsettings ["Notes"] As list <Note >;</P> <p> var descinfo = from I in notes orderby I. notetime descending select I; </P> <p> mainlistbox. itemssource = descinfo; <br/>}</P> <p> private void applicationbariconbutton_click (Object sender, eventargs e) <br/>{< br/> navigationservice. navigate (New uri ("/Add. XAML ", urikind. relativeorabsolute); <br/>}</P> <p> protected override void onbackkeypress (system. componentmodel. canceleventargs e) <br/>{< br/> E. cancel = true; <br/> app. quit (); <br/> base. onbackkeypress (E); <br />}</P> <p> private void applicationbariconbutton_click_1 (Object sender, eventargs e) <br/>{< br/> navigationservice. navigate (New uri ("/about. XAML ", urikind. relativeorabsolute); <br/>}</P> <p> private void stackpanel_mouseleftbuttonup (Object sender, mousebuttoneventargs E) <br/>{< br/> string noteguid = (textblock) (stackpanel) sender ). children. first ())). tag. tostring (); <br/> navigationservic E. navigate (New uri ("/detailspage. XAML? Noteguid = "+ noteguid, urikind. Relative); <br/>}< br/>}
Page displayed in the article and a series of functions

 

 

Public partial class detailspage: phoneapplicationpage <br/>{< br/> // constructor <br/> Public detailspage () <br/>{< br/> initializecomponent (); <br/>}< br/> string noteguid; <br/> protected override void onnavigatedto (navigationeventargs e) <br/>{< br/> bingdata (); <br/> noteguid = navigationcontext. querystring ["noteguid"]. tostring (); <br/> foreach (VAR item in notes) <br/>{< br/> If (item. notegui D = noteguid) <br/>{< br/> contenttext. TEXT = item. notecontent; <br/> timetext. TEXT = item. notetime; <br/> return; <br/>}</P> <p> List <Note> Notes = new list <Note> (); <br/> private void bingdata () <br/>{< br/> Notes = isolatedstorageset.pdf. applicationsettings ["Notes"] As list <Note >;< br/>}</P> <p> private void edit_click (Object sender, eventargs E) <br/>{< br/> navigationservic E. navigate (New uri ("/edit. XAML? Noteguid = "+ noteguid. tostring (), urikind. relativeorabsolute); <br/>}</P> <p> protected override void onbackkeypress (system. componentmodel. canceleventargs e) <br/>{< br/> E. cancel = true; <br/> navigationservice. navigate (New uri ("/mainpage. XAML ", urikind. relativeorabsolute); <br/> base. onbackkeypress (E); <br/>}< br/> // Delete <br/> private void del_click (Object sender, eventargs E) <br/> {<br/> for (INT I = 0; I <notes. count; I ++) <br/>{< br/> If (Notes [I]. noteguid = noteguid) <br/>{< br/> notes. removeat (I); <br/>}< br/> isolatedstoragesettings. applicationsettings ["Notes"] = notes as list <Note >;< br/> isolatedstoragesettings. applicationsettings. save (); <br/> navigationservice. navigate (New uri ("/mainpage. XAML ", urikind. relativeorabsolute); <br/>}< br/> // send an email <br/> private void email_click (Object sender, eventargs E) <br/>{< br/> emailcomposetask email = new emailcomposetask (); <br/> email. body = contenttext. text. tostring (); <br/> email. show (); <br/>}< br/> // send a text message <br/> private void message_click (Object sender, eventargs E) <br/>{< br/> smscomposetask SMS = new smscomposetask (); <br/> SMS. body = contenttext. text. tostring (); <br/> SMS. show (); <br/>}< br/>}Article editing page Code
Public partial class EDIT: phoneapplicationpage <br/>{< br/> Public edit () <br/>{< br/> initializecomponent (); <br/>}</P> <p> private void applicationbariconbutton_click (Object sender, eventargs e) <br/>{< br/> foreach (VAR item in notes) <br/>{< br/> If (item. noteguid = noteguid) <br/>{< br/> item. notecontent = contenttext. text; <br/> item. notetime = timetext. text; <br/>}</P> <p> isol Atedstoragesettings. applicationsettings ["Notes"] = notes as list <Note >;< br/> isolatedstoragesettings. applicationsettings. save (); <br/> navigationservice. navigate (New uri ("/detailspage. XAML? Noteguid = "+ noteguid. tostring (), urikind. relativeorabsolute); <br/>}< br/> string noteguid; <br/> protected override void onnavigatedto (navigationeventargs E) <br/>{< br/> bingdata (); <br/> noteguid = navigationcontext. querystring ["noteguid"]. tostring (); <br/> foreach (VAR item in notes) <br/>{< br/> If (item. noteguid = noteguid) <br/>{< br/> contenttext. TEXT = item. notecontent; <br/> timetext. TEXT = item. notetime; <br/> return; <br/>}</P> <p> List <Note> Notes = new list <Note> (); <br/> private void bingdata () <br/>{< br/> Notes = isolatedstorageset.pdf. applicationsettings ["Notes"] As list <Note >;< br/>}< br/>}
Address: http://www.cnblogs.com/wildfeng/archive/2012/03/23/2412071.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.