Silverlight Project開發
Page.xaml
Page.xaml.cs
Silverlight.js
TestPage.html
TestPage.html.js
---------------------------------------------------------------------------------------------------------------------------------
Page.xaml:
<Canvas x:Name="parentCanvas"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Loaded="Page_Loaded"
x:Class="SilverlightProject5.Page;assembly=ClientBin/SilverlightProject5.dll"
Width="640"
Height="480"
Background="White"
>
<Canvas Width="100" Height="30" Background="Gray" MouseLeftButtonUp="OnClick">
<TextBlock>Click me</TextBlock>
</Canvas>
</Canvas>
Page.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace SilverlightProject5
{
public partial class Page : Canvas
{
public void Page_Loaded(object o, EventArgs e)
{
InitializeComponent();
}
public void OnClick(object sender, MouseEventArgs e)
{
Canvas cc = sender as Canvas;
SolidColorBrush sb = new SolidColorBrush();
sb.Color = Colors.Red;
cc.Background = sb;
TextBlock tb = cc.Children[0] as TextBlock;
tb.Text = "Clicked...";
}
}
}
---------------------------------------------------------------------------------------------------------------------------
Page.xaml:
<Canvas x:Name="parentCanvas"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Loaded="Page_Loaded"
x:Class="SilverlightProject5.Page;assembly=ClientBin/SilverlightProject5.dll"
Width="640"
Height="480"
Background="White"
>
<Canvas x:Name="Button1" Width="100" Height="30" Background="Gray"> //這裡不同
<TextBlock>Click me</TextBlock>
</Canvas>
</Canvas>
Page.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace SilverlightProject5
{
public partial class Page : Canvas
{
public void Page_Loaded(object o, EventArgs e)
{
InitializeComponent();
Button1.MouseLeftButtonUp+=new MouseEventHandler(OnClick);
}
public void OnClick(object sender, MouseEventArgs e)
{
Canvas cc = sender as Canvas;
SolidColorBrush sb = new SolidColorBrush();
sb.Color = Colors.Red;
cc.Background = sb;
TextBlock tb = cc.Children[0] as TextBlock;
tb.Text = "Clicked...";
}
}
}
------------------------------------------------------------------------------------------------------------------------
相關文章
- Silverlight的開發工具
- SuperMap iClient for Silverlight開發準備client
- 配置silverlight 2的開發環境開發環境
- Silverlight開發實踐--PicZoomShow(源)OOM
- 《Project DT》:主機動作遊戲,開發中Project遊戲
- Silverlight遊戲開發:引擎”Night”解析遊戲開發
- ArcGIS API for Silverlight開發入門準備API
- C#開發WPF/Silverlight動畫及遊戲系列C#動畫遊戲
- Silverlight開發中的程式碼安全性
- website project team member 角色及開發過程概念圖WebProject
- silverlight 在企業應用開發中的定位
- ArcGIS API for Silverlight開發中常用問題彙總API
- SuperMap iClient for Silverlight開發筆記(不斷補充中)client筆記
- Qt開發,報錯:Error while building/deploying project untitled (kit: ....)QTErrorWhileUIProject
- Silverlight 遊戲開發小技巧:技能冷卻效果1(Cooldown)遊戲開發
- Silverlight C# 遊戲開發:Balder的3D世界C#遊戲開發3D
- Silverlight/WPF/Windows Phone 開發之MVVM設計模式之入門WindowsMVVM設計模式
- 一個破 1K Stars 的 side project 開發經驗談IDEProject
- Windows Phone 7 開發 31 日談——第21日:Silverlight Toolkit for Windows PhoneWindows
- 收集的一些關於ArcGIS API for Silverlight開發的連線API
- Project: OCFSProject
- OA projectProject
- Project Loom帶來Java併發模型革命? - infoworldProjectOOMJava模型
- WPF and Silverlight 學習筆記(一):開發環境及參考資料筆記開發環境
- 【開發參考】Silverlight 4控制元件對應裝配檔案表控制元件
- jsp+tomcat+ 建立project 配置projectJSTomcatProject
- 如何在開源世界打造自己的明星 Project?Project
- Silverlight監測工具:Silverlight Spy
- 歡迎參與討論POP(Project Oriented Project)Project
- 使用Entity Framework和WCF Ria Services開發SilverLight之6:查詢指定欄位Framework
- Silverlight C# 遊戲開發:Flyer08用Blend做一個新遊戲C#遊戲開發
- Prettier your projectProject
- sbt建立projectProject
- 微軟公開測試Symbian版Silverlight【轉】微軟
- Silverlight Toolkit
- 如何進入開源世界並打造自己的明星 Project?Project
- Sekai Project的世界AIProject
- Code Project精彩分享Project