public HandPage() { menu = (Application.Current as App).menu; uri = "http://www.nogizaka46.com/event/20180403.php"; this.InitializeComponent(); Load(uri); }
public ExchangePage() { menu = (Application.Current as App).menu; this.InitializeComponent(); B.Text = "0.0600"; queryAsync(); }
public OshimenPage() { name2 = new ObservableCollection <string>(); name = new ObservableCollection <string>(); menu = (Application.Current as App).menu; ViewModel = (Application.Current as App).ViewModel; Initialization(); this.InitializeComponent(); }
/// <summary> /// 初始化单一实例应用程序对象。这是执行的创作代码的第一行, /// 已执行,逻辑上等同于 main() 或 WinMain()。 /// </summary> public App() { conn = new SQLiteConnection(new SQLitePlatformWinRT(), path); //datebase建表 conn.CreateTable <Models.Member>(); menu = new Models.Menu(); ViewModel = new MemberViewModel(); SongList = new SongViewModels(); this.InitializeComponent(); this.Suspending += OnSuspending; }
public Schedule() { menu = (Application.Current as App).menu; this.InitializeComponent(); TextBlock A = new TextBlock(); TextBlock B = new TextBlock(); A.Text = menu.place; B.Text = menu.sche; place.Add(A); date.Add(B); }
/// <summary> /// 根据url获取html /// 解析html并将信息添加到ListView中 /// </summary> /// <param name="u"></param> async void Load(string u) { try { menu = (Application.Current as App).menu; string html = ""; HttpClient myWebClient = new HttpClient(); Stream myStream = await myWebClient.GetStreamAsync(u); StreamReader sr = new StreamReader(myStream, System.Text.Encoding.GetEncoding("utf-8")); html = sr.ReadToEnd(); //加载源代码,获取文档对象 var doc = new HtmlDocument(); doc.LoadHtml(html); //获取最新博客对应的根节点 var res = doc.DocumentNode.SelectSingleNode(@"/html[1]/body[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[3]/div[1]/div[1]"); //var res = doc.DocumentNode; // 添加题目 LoadTitle(res); // 添加日期 LoadDate(res); // 添加作者 LoadAuthor(res); // 添加正文 await LoadArticleAsync(res.SelectSingleNode(@"div[3]")); } // 异常时弹窗并返回 catch (Exception ee) { string message = ee.Message + "\nA browser will be opened to show the blog net."; var dialog = new MessageDialog(message, "Error"); dialog.Commands.Add(new UICommand(menu.OK, cmd => { }, menu.OK)); dialog.Commands.Add(new UICommand(menu.NO, cmd => { }, menu.NO)); //设置默认按钮,不设置的话默认的确认按钮是第一个按钮 dialog.DefaultCommandIndex = 0; dialog.CancelCommandIndex = 1; //获取返回值 var result = await dialog.ShowAsync(); if (result.Id as string == menu.OK) { await Launcher.LaunchUriAsync(new Uri(u)); } this.Frame.GoBack(); return; } }
public MainPage() { menu = (Application.Current as App).menu; this.InitializeComponent(); }
public BlogPage() { menu = (Application.Current as App).menu; ViewModel = (Application.Current as App).ViewModel; this.InitializeComponent(); }