您的位置:首页 > 其它

wp8.1 边开发边学习记录

2015-10-14 13:16 295 查看
1. 拦截后退按钮

Protected Overrides Sub OnNavigatedTo(e As Navigation.NavigationEventArgs)
AddHandler HardwareButtons.BackPressed, AddressOf MainPage_BackPressed
End Sub

Protected Overrides Sub OnNavigatedFrom(e As NavigationEventArgs)
RemoveHandler HardwareButtons.BackPressed, AddressOf MainPage_BackPressed
End Sub

Private Sub MainPage_BackPressed(sender As Object, e As BackPressedEventArgs)
e.Handled = True
//todo
End Sub


2. 程序退出

Application.Current.Exit()


3.系统自带json

Imports Windows.Data.Json


4.保留页面缓存

Public Sub New()

' This call is required by the designer.
InitializeComponent()

' Add any initialization after the InitializeComponent() call.
Me.NavigationCacheMode = Navigation.NavigationCacheMode.Required
End Sub


5.httpclient不读缓存

Dim http As New HttpClient()
http.DefaultRequestHeaders.Add("Cache-Control", "no-cache")

6.计时器-1

Dim WithEvents dt As DispatcherTimer = New DispatcherTimer()
Private Sub dt_Tick(sender As Object, e As Object) Handles dt.Tick
'todo
End Sub
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  wp8