久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

silverlight教程(4)---使用風(fēng)格元素,以更好地概括外觀與感覺

 莣ヤㄋ莪 2009-05-07
 wpf和silverlight支持一種風(fēng)格機(jī)制,,使我們能夠控制拮據(jù)的財(cái)產(chǎn)價(jià)值作為一個(gè)可重復(fù)使用的資源,,我們可以存儲(chǔ)這些風(fēng)格報(bào)關(guān)單單獨(dú)文件從網(wǎng)頁,并重新使用它們橫跨多個(gè)控制和網(wǎng)頁應(yīng)用程序(以及再利用他們跨多個(gè)應(yīng)用程序) ,,這是在概念上類似于使用CSS與HTML的時(shí)候,,做基礎(chǔ)定制的情況。

Note: In addition to defining basic property settings (Color, Font, Size, Margins, etc), styles in WPF and Silverlight can also be used to define and re-use Control Templates - which enable super rich skinning and adaptation of control structure (and support customization scenarios not possible with CSS in HTML today).  I discuss Control Templates in Part 7 of this series. 注:除界定基本屬性的設(shè)置(顏色,,字體,,大小,利潤(rùn)率等) ,,風(fēng)格wpf和silverlight也可以被用來界定和再利用控制模板-使超級(jí)富豪的s kinning功能和適應(yīng)的控制結(jié)構(gòu)(并支持個(gè)性化的情況,,不可能同的CSS在HTML今日) ,討論控制模板,,在第7部的這一系列,。

For our Digg sample application we'll define our Style declarations within the App.xaml file of our project.  This will enable them to be reused across all pages and controls in the application:我們digg采樣應(yīng)用,我們將確定我們的作風(fēng)報(bào)關(guān)單內(nèi)app.xaml檔案,,我們的項(xiàng)目,,這將使他們能夠重復(fù)使用,所有的頁面和控制中的應(yīng)用:

Let's start by encapsulating styles for the <Border> control (and the <TextBlock> title contained within it) of our Digg page:讓我們先灌封作風(fēng),為<border>控制(以及<textblock>標(biāo)題中包含它)我國(guó)Digg頁面:

We can create two Style elements within our App.xaml file that encapsulate the <Border> and <TextBlock> settings we were previously declaring inline using the markup below:我們可以制造兩個(gè)風(fēng)格分子,,我們app.xaml文件,概括了<border>和<textblock>設(shè)置我們以前曾經(jīng)申報(bào)直列用標(biāo)記如下:

Note how we are giving each Style a unique "Key" value above.  We can then update our <Border> and <TextBlock> controls to reference the Styles using these keys.  We'll be using a XAML feature called "markup extensions" to do this.  Markup extensions are used when there are non-literal values that we want to set (another example of where we'll use this feature is with databinding expressions).說明我們?nèi)绾巫屆恳粋€(gè)風(fēng)格獨(dú)特的"鑰匙"的價(jià)值以上,,我們便可以更新我們的<border>和<textblock>管制,,以提述方式使用這些鑰匙,我們都會(huì)用xaml功能叫做"標(biāo)記延伸"做到這一點(diǎn),。標(biāo)記延用的時(shí)候,,是有非字面的價(jià)值觀,我們要設(shè)置(另一個(gè)例子,,我們將在使用此功能是和數(shù)據(jù)綁定表達(dá)式) ,。

When we update the other controls within our Page.xaml file to use styles as well, we are left with a file that looks like below:當(dāng)我們更新其他管制措施,我們page.xaml檔案使用作風(fēng)好,,我們只剩下一個(gè)文件看起來像下面:

Encapsulate the style settings this way allows developers to better focus on the behavior semantics of the application, and also enables us to re-use styles across other controls/pages we build.概括了樣式設(shè)置這種方式允許開發(fā),,以更好地著眼于行為語義學(xué)的應(yīng)用,也使我們得以重新使用風(fēng)格跨越其他管制/頁,,我們建立的,。

Note: One issue to be aware of with Beta1 is that the error message when you mistype style names and property declarations is not very clear (it raises an exception but doesn't tell you what isn't set correctly).  This will be improved in Beta2. 注:一個(gè)問題,他們必須明白,,與素beta1是錯(cuò)誤的訊息,,當(dāng)你錯(cuò)誤的作風(fēng)姓名及財(cái)產(chǎn)申報(bào)不很清楚(它提出了一個(gè)例外,但并沒有告訴你什么是不正確設(shè)置) ,,這將得到改善在間諜軟件,。 In the meantime if you see an error loading a style make sure to look carefully for typos. 在此期間,如果你看到一個(gè)錯(cuò)誤裝載的風(fēng)格一定要仔細(xì)看看,,為錯(cuò)別字,。

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點(diǎn),。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,,謹(jǐn)防詐騙,。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào),。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多