Everything start here.
Windows8 Tech
C++博客
首頁(yè)
新隨筆
聯(lián)系
聚合
管理
隨筆 - 55 文章 - 15 trackbacks - 0
<
2012年10月
>
日
一
二
三
四
五
六
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
常用鏈接
我的隨筆
我的評(píng)論
我參與的隨筆
留言簿
給我留言
查看公開(kāi)留言
查看私人留言
隨筆分類(lèi)
Windows 8(8)
隨筆檔案
2013年2月 (1)
2013年1月 (8)
2012年10月 (10)
2012年9月 (1)
2012年6月 (6)
2012年5月 (16)
2012年4月 (5)
2012年3月 (4)
2012年2月 (4)
搜索
最新評(píng)論
1.?re: Window 8 學(xué)習(xí)筆記(三)-- 如何創(chuàng)建一個(gè)可變尺寸的GridView
樓主能提供完整的源碼么,想系統(tǒng)學(xué)習(xí)下,謝謝啦,
--墮落1990
2.?re: Windows 8 學(xué)習(xí)筆記(四)--創(chuàng)建Variable Sized GridView之PrepareContainerForItemOverride方法
@Dino-Tech
@Dino-Tech
OK,期待你加我的QQ.
--英明神武可愛(ài)
3.?re: Windows 8 學(xué)習(xí)筆記(四)--創(chuàng)建Variable Sized GridView之PrepareContainerForItemOverride方法
評(píng)論內(nèi)容較長(zhǎng),點(diǎn)擊標(biāo)題查看
--Dino-Tech
4.?re: Windows 8 學(xué)習(xí)筆記(四)--創(chuàng)建Variable Sized GridView之PrepareContainerForItemOverride方法
評(píng)論內(nèi)容較長(zhǎng),點(diǎn)擊標(biāo)題查看
--英明神武可愛(ài)
5.?re: Windows 8 學(xué)習(xí)筆記(四)--創(chuàng)建Variable Sized GridView之PrepareContainerForItemOverride方法
你可以加我的qq嗎,我按你的方法繼承了gridview,但是編譯不過(guò)。
--英明神武可愛(ài)
閱讀排行榜
1.?Dino Windows 8 學(xué)習(xí)筆記(十四)--BackgroundTask 15問(wèn)(3485)
2.?Dino Windows 8 學(xué)習(xí)筆記(十)-- 一個(gè)異常引發(fā)的文章之Resource Dictionary(3209)
3.?Dino Windows 8 學(xué)習(xí)筆記(十三)-- Toast(2857)
4.?Window 8 學(xué)習(xí)筆記(二)--如何創(chuàng)建自定義類(lèi)型的MessageDialog(2501)
5.?Windows 8 學(xué)習(xí)筆記(四)--創(chuàng)建Variable Sized GridView之PrepareContainerForItemOverride方法(2171)
評(píng)論排行榜
1.?Windows 8 學(xué)習(xí)筆記(四)--創(chuàng)建Variable Sized GridView之PrepareContainerForItemOverride方法(7)
2.?Thinking in C++--第三章 平時(shí)不太注意的編程細(xì)節(jié)(3)
3.?Windows 8 基本概念(1)
4.?Window 8 學(xué)習(xí)筆記(三)-- 如何創(chuàng)建一個(gè)可變尺寸的GridView (1)
5.?Dino Windows 8 學(xué)習(xí)筆記(十二) - 動(dòng)態(tài)瓷貼(1)
Dino Windows 8 學(xué)習(xí)筆記(十二) - 動(dòng)態(tài)瓷貼
31 Days of Windows 8 -- Live Tiles:
http://www.jeffblankenburg.com/2012/11/09/31-days-of-windows-8-day-9-live-tiles/
MSDN--創(chuàng)建瓷貼和鎖屏 :
http://msdn.microsoft.com/library/windows/apps/Hh465377
創(chuàng)建瓷貼的步驟:
1. 命名空間:
using
namespace
Windows::UI::Notifications;
using
namespace
Windows::Data::Xml::Dom;
2. 選取模板
http://msdn.microsoft.com/zh-CN/library/windows/apps/xaml/windows.ui.notifications.tiletemplatetype
3. 設(shè)置模板中的屬性,最好將WideTile和SquareTile合并在一起,這樣不論你的Tile是哪種形態(tài)都有動(dòng)態(tài)效果。
4. 更新Tile
下面是一個(gè)完整步驟:
1
using
namespace
Windows::UI::Notifications; //
Notification命名空間
2
using
namespace
Windows::Data::Xml::Dom; //
DOM標(biāo)準(zhǔn)函數(shù)命名空間
3
namespace
WFC
=
Windows::Foundation::Collections;
4
5
XmlDocument
^
tileXml
=
TileUpdateManager::GetTemplateContent(TileTemplateType::TileWideImageAndText01
);//獲得模板
6
7
XmlNodeList
^
tileTextAttributes
=
tileXml
->
GetElementsByTagName(
"
text
"
);
8
tileTextAttributes
->
Item(
0
)
->
InnerText
=
"
Hello World! My very own tile notification
"
;//
設(shè)置text屬性
9
10
XmlNodeList
^
tileImageAttributes
=
tileXml
->
GetElementsByTagName(
"
image
"
);
11
static_cast
<
XmlElement
^>
(tileImageAttributes
->
Item(
0
))
->
SetAttribute(
"
src
"
,
"
ms-appx:///images/redWide.png
"
);
//此處如果要使用Assets中的圖片的話,直接用SetAttribute("src","Tile.png");
12
static_cast
<
XmlElement
^>
(tileImageAttributes
->
Item(
0
))
->
SetAttribute(
"
alt
"
,
"
red graphic
"
);// 設(shè)置image屬性
13
14
XmlDocument
^
squareTileXml
=
TileUpdateManager::GetTemplateContent(TileTemplateType::TileSquareText04);
//獲得方形模板
15
XmlNodeList
^
squareTileTextAttributes
=
squareTileXml
->
GetElementsByTagName(
"
text
"
);
16
squareTileTextAttributes
->
Item(
0
)
->
AppendChild(squareTileXml
->
CreateTextNode(
"
Hello World! My very own tile notification
"
));//設(shè)置text屬性
17
IXmlNode
^
node
=
tileXml
->
ImportNode(squareTileXml
->
GetElementsByTagName(
"
binding
"
)
->
GetAt(
0
),
true
);
18
tileXml
->
GetElementsByTagName(
"
visual
"
)
->
Item(
0
)
->
AppendChild(node);
//
將方形模板插入Wide模板
19
20
TileNotification
^
tileNotification
=
ref
new
TileNotification(tileXml);
21
22
int
seconds
=
10
;
23
auto cal
=
ref
new
Windows::Globalization::Calendar();
24
cal
->
AddSeconds(seconds);
25
tileNotification
->
ExpirationTime
=
cal
->
GetDateTime();//
設(shè)置消失時(shí)間
26
27
TileUpdateManager::CreateTileUpdaterForApplication()
->
Update(tileNotification);
//顯示Tile
28
29
也可以使用XML文件設(shè)置屬性:
1
//
create a string with the tile template xml
2
auto tileXmlString
=
"
<tile>
"
3
+
"
<visual>
"
4
+
"
<binding template='TileWideText03'>
"
5
+
"
<text id='1'>Hello World! My very own tile notification</text>
"
6
+
"
</binding>
"
7
+
"
<binding template='TileSquareText04'>
"
8
+
"
<text id='1'>Hello World! My very own tile notification</text>
"
9
+
"
</binding>
"
10
+
"
</visual>
"
11
+
"
</tile>
"
;
12
13
//
create a DOM
14
auto tileDOM
=
ref
new
Windows::Data::Xml::Dom::XmlDocument();
15
16
//
load the xml string into the DOM, catching any invalid xml characters
17
tileDOM
->
LoadXml(tileXmlString);
18
19
//
create a tile notification
20
auto tile
=
ref
new
TileNotification(tileDOM);
21
22
//
Send the notification to the app's application tile
23
TileUpdateManager::CreateTileUpdaterForApplication()
->
Update(tile);
24
25
OutputTextBlock
->
Text
=
tileDOM
->
GetXml();
清理瓷貼
TileUpdateManager::CreateTileUpdaterForApplication()->Clear();
使用瓷貼隊(duì)列
一個(gè)應(yīng)用程序中最多能使用5個(gè)瓷貼,如果開(kāi)啟了瓷貼隊(duì)列,會(huì)按照先后順序放入隊(duì)列中。之后TileNotification的顯示時(shí)間和顯示順序?qū)⒉皇艹绦蚩刂疲@時(shí)的控制權(quán)是在系統(tǒng)手中的。
為了便于控制瓷貼的顯示,我們一般給瓷貼一個(gè)Tag用于辨識(shí),當(dāng)新的瓷貼的Tag與舊瓷貼的Tag相同時(shí),舊瓷貼被新瓷貼代替。如果不同,隊(duì)列頭上的瓷貼被踢出隊(duì)列。
最近的瓷貼總是被立即顯示。另外,當(dāng)隊(duì)列中已經(jīng)有了5個(gè)瓷貼的時(shí)候,其中一個(gè)使用了Expirate,那么當(dāng)這個(gè)瓷貼消失之后,將不再在隊(duì)列中,也不會(huì)再顯示它了。
使用瓷貼隊(duì)列的方法是:
TileUpdateManager::CreateTileUpdaterForApplication()->EnableNotificationQueue(true);
禁止瓷貼隊(duì)列的方法:
TileUpdateManager::CreateTileUpdaterForApplication()->EnableNotificationQueue(false);
瓷貼的圖片問(wèn)題
用于Tile的圖片不能大于200K,像素不能大于1024*1024,但是我們的Tile最大是310*150,所以我們?cè)谑褂脠D片的時(shí)候要考慮到大小問(wèn)題。
posted on 2013-01-03 14:31
Dino-Tech
閱讀(1461)
評(píng)論(1)
編輯
收藏
引用
所屬分類(lèi):
Windows 8
FeedBack:
#
re: Dino Windows 8 學(xué)習(xí)筆記(十二) - 動(dòng)態(tài)瓷貼
2013-01-04 00:46
custom research papers
Very ncie good spot s oncie great!
回復(fù)
更多評(píng)論
刷新評(píng)論列表
只有注冊(cè)用戶
登錄
后才能發(fā)表評(píng)論。
【推薦】100%開(kāi)源!大型工業(yè)跨平臺(tái)軟件C++源碼提供,建模,組態(tài)!
相關(guān)文章:
Dino Windows 8 學(xué)習(xí)筆記 (十六)-- 一個(gè)小問(wèn)題 禁用GridView的特定Item
Dino Windows 8 學(xué)習(xí)筆記(十五)-- App Settings
Dino Windows 8 學(xué)習(xí)筆記(十四)--BackgroundTask 15問(wèn)
溫故而知新系列--Windows 8 的異步編程(一)表面上的東西
Dino Windows 8 學(xué)習(xí)筆記(十二) - 動(dòng)態(tài)瓷貼
Dino Windows 8 學(xué)習(xí)筆記(十)-- 一個(gè)異常引發(fā)的文章之Resource Dictionary
Dino Windows 8 學(xué)習(xí)筆記(九)-- 如何在App中添加喜愛(ài)的照片
Windows 8 學(xué)習(xí)筆記(六)-- 創(chuàng)建不同風(fēng)格的GridView item
網(wǎng)站導(dǎo)航:
博客園
IT新聞
BlogJava
博問(wèn)
Chat2DB
管理
Copyright ©2025 Dino-Tech Powered by:
博客園
模板提供:
滬江博客
www.久久热.com
|
欧美亚洲国产精品久久久久
|
久久综合亚洲欧美成人
|
国内精品久久久久久99
|
一级做a爰片久久毛片16
|
久久精品国产国产精品四凭
|
伊人久久成人成综合网222
|
久久精品人人做人人爽97
|
久久一区二区三区99
|
1000部精品久久久久久久久
|
色播久久人人爽人人爽人人片AV
|
久久婷婷五月综合国产尤物app
|
国产亚洲精午夜久久久久久
|
婷婷综合久久中文字幕蜜桃三电影
|
精品久久人人妻人人做精品
|
欧洲精品久久久av无码电影
|
久久亚洲精品国产精品婷婷
|
狠狠色丁香久久婷婷综合五月
|
人妻丰满?V无码久久不卡
|
九九久久99综合一区二区
|
人妻久久久一区二区三区
|
亚洲伊人久久综合影院
|
国产女人aaa级久久久级
|
久久精品天天中文字幕人妻
|
国产精品久久新婚兰兰
|
无码人妻少妇久久中文字幕
|
伊人久久大香线蕉影院95
|
久久精品国产只有精品2020
|
嫩草伊人久久精品少妇AV
|
一本久久知道综合久久
|
久久婷婷五月综合国产尤物app
|
18岁日韩内射颜射午夜久久成人
|
精品乱码久久久久久夜夜嗨
|
国产成人精品久久亚洲高清不卡
|
精品久久久久久久无码
|
男女久久久国产一区二区三区
|
国产精品久久久久久久久免费
|
99热成人精品免费久久
|
国产成人精品久久一区二区三区
|
国产精品99久久99久久久
|
精品精品国产自在久久高清
|