新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
Silverlight用戶控件屬性添加方法介紹
Silverlight工具的推出,對(duì)于開發(fā)人員來(lái)說(shuō)是一個(gè)劃時(shí)代的產(chǎn)物。它的靈活應(yīng)用,方便的實(shí)現(xiàn)了開發(fā)人員操作音頻視頻的簡(jiǎn)單步驟。并且這款開發(fā)工具能夠支持各種平臺(tái),方便使用。#t#

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛(ài)。我們立志把好的技術(shù)通過(guò)有效、簡(jiǎn)單的方式提供給客戶,將通過(guò)不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:域名注冊(cè)、網(wǎng)站空間、營(yíng)銷軟件、網(wǎng)站建設(shè)、扎囊網(wǎng)站維護(hù)、網(wǎng)站推廣。
Silverlight用戶控件屬性的添加代碼示例如下:
- < Grid x:Name="LayoutRoot" Background="White">
- < Rectangle HorizontalAlignment=
"Stretch" VerticalAlignment="Stretch" - Opacity="0.7" Fill="#FF8A8A8A"/>
- < Border CornerRadius="15" Width="400"
Height="150" Background="LightPink"
Opacity="0.9"> - < Grid>
- < Grid.RowDefinitions>
- < RowDefinition Height="60">< /RowDefinition>
- < RowDefinition Height="90">< /RowDefinition>
- < /Grid.RowDefinitions>
- < Grid.ColumnDefinitions>
- < ColumnDefinition>< /ColumnDefinition>
- < /Grid.ColumnDefinitions>
- < TextBlock x:Name="message"
FontSize="18" Foreground="White" - HorizontalAlignment="Left"
VerticalAlignment="Center" - Margin="50 20 0 0"/>
- < StackPanel Orientation="Horizontal"
Height="50" Grid.Row="1"> - < Image Source="info.png"
Margin="10 0 0 0">< /Image> - < Button Background="Red"
Width="120" Height="40" - Content="OK" Margin="10 0 0 0"
FontSize="18"/> - < Button Background="Red"
Width="120" Height="40" - Content="Cancel" Margin="50 0 0 0"
FontSize="18"/> - < /StackPanel>
- < /Grid>
- < /Border>
- < /Grid>
定義Silverlight用戶控件屬性:
- public partial class
ConfirmBox : UserControl- {
- public ConfirmBox()
- {
- InitializeComponent();
- }
- public String Message
- {
- get { return this.message.Text; }
- set { this.message.Text = value; }
- }
- }
在頁(yè)面使用Silverlight用戶控件屬性,XAML編輯器能夠識(shí)別出屬性并給出提示。
為ConfirmBox控件的Message屬性賦值:
- < Grid x:Name="LayoutRoot"
Background="#46461F">- < uc:ConfirmBox x:Name="mybox"
Message="使用用戶控件成功">- < /uc:ConfirmBox>
- < /Grid>
本文名稱:Silverlight用戶控件屬性添加方法介紹
瀏覽地址:http://m.fisionsoft.com.cn/article/cdiiejc.html


咨詢
建站咨詢
