silverlight(一.安装和新建项目)
生活随笔
收集整理的這篇文章主要介紹了
silverlight(一.安装和新建项目)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.下載安裝silverlight:Microsoft? Silverlight? 3 Tools (安裝之前需要升級VS2008到SP1)
2.和多數人一樣我的程序新建好運行調試報錯,提示“未安裝silverlight托管調試包”,后來我使用VS2010新建的時候提示安裝silverlight更高版本Silverlight_Developer.exe,我安裝好后就OK了,然后運行VS2008的項目也沒有報錯了,整理一下我自己的安裝順序: VS2008(后來又安裝了VS2010),framework3.5-SP1, VS2008—SP1 ,silverlight3,Silverlight_Developer.exe。
3.新建項目 新建一個silverlight導航應用程序
然后找到Views中的Home.xaml文件 F5調試運行
然后添加silverlight控件:button 和 textbox
雙擊按鈕書寫代碼
Home.xaml頁面代碼:
代碼 <navigation:Page?x:Class="SilverlightApplication3.Home"?xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"?xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"?xmlns:d="http://schemas.microsoft.com/expression/blend/2008"?xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"?xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"?mc:Ignorable="d"?d:DesignWidth="640"?d:DesignHeight="480"?Title="主頁"?Style="{StaticResource?PageStyle}"?xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input">????<Grid?x:Name="LayoutRoot">
????????<ScrollViewer?x:Name="PageScrollViewer"?Style="{StaticResource?PageScrollViewerStyle}">
????????????<StackPanel?x:Name="ContentStackPanel">
????????????????<TextBlock?x:Name="HeaderText"?Style="{StaticResource?HeaderTextStyle}"?Text="主頁"/>
????????????????<Button?Content="點我"?Height="42"?Name="button1"?Width="119"?Click="button1_Click"?FontSize="16"?FontWeight="Bold"?/>
????????????????<TextBlock?x:Name="ContentText"?Style="{StaticResource?ContentTextStyle}"?Text="主頁內容"/>
????????????????<TextBox?Height="23"?Name="textBox1"?Width="120"?/>
????????????</StackPanel>
????????</ScrollViewer>
????</Grid>
</navigation:Page>
?
Home.xaml.cs
代碼 using?System;using?System.Collections.Generic;
using?System.Linq;
using?System.Net;
using?System.Windows;
using?System.Windows.Controls;
using?System.Windows.Documents;
using?System.Windows.Input;
using?System.Windows.Media;
using?System.Windows.Media.Animation;
using?System.Windows.Navigation;
using?System.Windows.Shapes;
namespace?SilverlightApplication3
{
????public?partial?class?Home?:?Page
????{
????????public?Home()
????????{
????????????InitializeComponent();
????????}
????????//?當用戶導航到此頁面時執行。
????????protected?override?void?OnNavigatedTo(NavigationEventArgs?e)
????????{
????????}
????????private?void?button1_Click(object?sender,?RoutedEventArgs?e)
????????{
????????????HeaderText.Text?=?"我的第一個silverlight應用程序!";
????????????textBox1.Text?=?DateTime.Now.ToString();
????????}
????}
}
?
?
?
轉載于:https://www.cnblogs.com/Simcoder/archive/2010/09/28/1837228.html
總結
以上是生活随笔為你收集整理的silverlight(一.安装和新建项目)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 软件测试管理者会遇到那些问题?
- 下一篇: 2020年第十七届中国研究生数学建模竞赛