- silverlightintroduction_src.zip
- CSSL3Animation
- CSSL3DeepZoom
- CSSL3DeepZoom.sln
- CSSL3DeepZoom.Web
- App_Code
- Bin
- DeepZoomTools.DLL
- DeepZoomTools.DLL.refresh
- ClientBin
- GeneratedImages
- Default.html
- GenerateDeepZoomService.svc
- Silverlight.js
- SourceImages
- atom.png
- background.jpg
- cell.png
- dna.png
- Molecular.png
- neutron.png
- seed.png
- wrap in bamboo.png
- Web.config
- CSSL3DeepZoom
- ReadMe.mht
- CSSL3HTMLBridge
- CSSL3Input
- CSSL3LocalMessage
- CSSL3MediaElement
- CSSL3PixelShader
- CSSL3WriteableBitmap
- VBSL3Animation
- VBSL3DeepZoom
- VBSL3DeepZoom.sln
- VBSL3DeepZoom.Web
- App_Code
- App_Data
- Bin
- DeepZoomTools.DLL
- DeepZoomTools.DLL.refresh
- ClientBin
- GeneratedImages
- Default.html
- GenerateDeepZoomService.svc
- Silverlight.js
- SourceImages
- atom.png
- background.jpg
- cell.png
- dna.png
- Molecular.png
- neutron.png
- seed.png
- wrap in bamboo.png
- Web.config
- VBSL3DeepZoom
- VBSL3HTMLBridge
- VBSL3Input
- VBSL3LocalMessage
- VBSL3MediaElement
- VBSL3PixelShader
|
'****************************** Module Header ******************************'
' Module Name: MainPage.xaml.vb
' Project: VBSL3HTMLBridge
' Copyright (c) Microsoft Corporation.
'
' HTML bridge samples code behind file.
'
' This source is subject to the Microsoft Public License.
' See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
' All other rights reserved.
'
' History:
' * 10/22/2009 15:21 PM Mog Liang Created
'***************************************************************************'
Imports System.Windows.Browser
Partial Public Class MainPage
Inherits UserControl
Public Sub New()
InitializeComponent()
' Register Scriptable Object.
HtmlPage.RegisterScriptableObject("silverlightPage", Me)
' Attach Html Element event.
HtmlPage.Document.GetElementById("Text2").AttachEvent("onkeyup", New EventHandler(AddressOf HtmlKeyUp))
AddHandler tb1.TextChanged, AddressOf tb1_TextChanged
AddHandler tb4.TextChanged, AddressOf tb4_TextChanged
End Sub
' Call javascript when first textbox text changed.
Private Sub tb1_TextChanged(ByVal sender As Object, ByVal e As TextChangedEventArgs)
HtmlPage.Window.Invoke("changetext", tb1.Text)
End Sub
' Handle html textbox keyup event.
Private Sub HtmlKeyUp(ByVal sender As Object, ByVal e As EventArgs)
Me.tb2.Text = DirectCast(sender, HtmlElement).GetProperty("value").ToString()
End Sub
' Create method for javascript.
<ScriptableMember()> _
Public Sub ChangeTB3Text(ByVal text As String)
tb3.Text = text
End Sub
' Create event allow registering by javascript.
<ScriptableMember()> _
Public Event TextChanged As EventHandler(Of TextEventArgs)
Private Sub tb4_TextChanged(ByVal sender As Object, ByVal e As TextChangedEventArgs)
Dim myargs = New TextEventArgs()
myargs.Text = tb4.Text
RaiseEvent TextChanged(Me, myargs)
End Sub
End Class
Public Class TextEventArgs
Inherits EventArgs
Private _text As String
<ScriptableMember()> _
Public Property [Text]() As String
Get
Return _text
End Get
Set(ByVal value As String)
_text = value
End Set
End Property
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Microsoft All-In-One Code Framework delineates the framework and skeleton of Microsoft development techniques through typical sample codes in three popular programming languages (Visual C#, VB.NET, Visual C++). Each sample is elaborately selected, composed, and documented to demonstrate one frequently-asked, tested or used coding scenario based on our support experience in MSDN newsgroups and forums. If you are a software developer, you can fill the skeleton with blood, muscle and soul. If you are a software tester or a support engineer like us, you may extend the sample codes a little to fit your specific test scenario or refer your customer to this project if the customer's question coincides with what we collected.
http://cfx.codeplex.com/