{"rsdb":{"rid":"197264","subhead":"","postdate":"0","aid":"140195","fid":"100","uid":"1","topic":"1","content":"
\n

\u5728\u5199\u4e00\u4e2a\u770b\u65b0\u95fb\u8f6f\u4ef6\u7684\u65f6\u5019\uff0c\u7528\u5230\u4e86SemanticZoom\u63a7\u4ef6\uff0c\u9047\u5230\u4e86\u4e00\u4e9b\u95ee\u9898\uff0c\u6bd4\u5982\u5982\u4f55\u6839\u636e\u9996\u5b57\u6bcd\u5206\u7c7b\uff0c\u4ee5\u53ca\u653e\u5927\u89c6\u56fe\u4e2d\u6709\u6570\u636e\u7684\u548c\u6ca1\u6570\u636e\u7684\u901a\u8fc7\u80cc\u666f\u8272\u6216\u524d\u666f\u8272\u533a\u5206\uff0c\u5e78\u8fd0\u7684\u662f\uff0call solved\u3002<\/p> \n

\u5148\u6765\u4e2a\u6548\u679c\u56fe<\/p> \n

\"\"<\/p> \n

 \u4e3b\u8981\u662f\u53c2\u8003\u4e86msdn\u7684\u4e00\u7bc7\u535a\u5ba2\uff0c\u5730\u5740\u5df2\u7ecf\u653e\u5728\u53c2\u8003\u94fe\u63a5\u91cc\u4e86\u3002<\/p> \n

\u9996\u5148\u662f\u4e00\u4e2aSemanticZoom\u63a7\u4ef6\uff0c\u8fd9\u4e2a\u63a7\u4ef6\u6709ZoomedInView\u548cZoomedOutView\u4e24\u79cd\u89c6\u56fe\u3002<\/p> \n

ZoomedOutView\u89c6\u56fe\u5c31\u662f\u8fd9\u4e2a<\/p> \n

\"\"<\/p> \n

 \u800cZoomedInView\u89c6\u56fe\u5c31\u662f\u4e00\u4e2a\u5e26\u6709\u5217\u8868\u5934\u7684\u5217\u8868\u7684\u6837\u5b50\uff0c\u8fd8\u662f\u4e0a\u4e2a\u56fe\u597d\u4e86\uff0c\u6211\u4e2a\u4eba\u4e0d\u559c\u6b22\u770b\u4e00\u5927\u6bb5\u7684\u7eaf\u6587\u5b57<\/p> \n

\"\"<\/p> \n

 <\/p> \n

\u9996\u5148\u5f04\u4e2aModel\uff0c\u8fd9\u91cc\u53ebPicture<\/p> \n

\n
1<\/span>  public<\/span> class<\/span> Picture\r\n<\/span>2<\/span>     {\r\n<\/span>3<\/span>         public<\/span> string<\/span> ImageUri { get<\/span>; set<\/span>; }\r\n<\/span>4<\/span>         public<\/span> string<\/span> Title { get<\/span>; set<\/span>; }\r\n<\/span>5<\/span>     }<\/pre> \n <\/div> \n 

\u7136\u540e\u518d\u52a0\u4e2aViewModel\uff0c\u53ebMainPageViewModel\uff0c\u7c7b\u91cc\u5199\u4e00\u4e2a\u6570\u636e\u96c6\u5408\u548c\u52a0\u8f7d\u6570\u636e\u7684\u65b9\u6cd5<\/p> \n

\n
1<\/span>  public<\/span> ObservableCollection<AlphaKeyGroup<Picture>> AllPictures { get<\/span>; set<\/span>; }<\/pre> \n <\/div> \n 

\u5173\u4e8e\u52a0\u8f7d\u6570\u636e\u7684\u65b9\u6cd5\uff0c\u5f88\u663e\u7136\uff0c\u6211\u4eec\u8981\u628a\u6570\u636e\u6309\u7167Title\u7684\u9996\u5b57\u6bcd\u5206\u7ec4\uff0c\u6309\u9996\u5b57\u6bcd\u5206\u7ec4\u8bf4\u5b9e\u8bdd\u6211\u4e0d\u4f1a\uff0c\u7136\u540e\u6211\u5728msdn\u627e\u5230\u4e86\u4e00\u4e2a\u7c7b\u53ebAlphaKeyGroup\uff0c\u8fd9\u4e2a\u7c7b\u53ef\u4ee5\u7528\u6765\u6309\u9996\u5b57\u6bcd\u5206\u7ec4<\/p> \n

\n \"\"\n \"\" \n
\n
 1<\/span> public<\/span> class<\/span> AlphaKeyGroup<T> : List<T>\r\n 2<\/span>     {\r\n<\/span> 3<\/span>         \/\/\/<\/span> <summary><\/span>\r\n 4<\/span>         \/\/\/<\/span> The delegate that is used to get the key information.\r\n<\/span> 5<\/span>         \/\/\/<\/span> <\/summary><\/span>\r\n 6<\/span>         \/\/\/<\/span> <param name="item"><\/span>An object of type T<\/span><\/param><\/span>\r\n 7<\/span>         \/\/\/<\/span> <returns><\/span>The key value to use for this object<\/span><\/returns><\/span>\r\n 8<\/span>         public<\/span> delegate<\/span> string<\/span> GetKeyDelegate(T item);\r\n<\/span> 9<\/span> \r\n10<\/span>         \/\/\/<\/span> <summary><\/span>\r\n11<\/span>         \/\/\/<\/span> The Key of this group.\r\n<\/span>12<\/span>         \/\/\/<\/span> <\/summary><\/span>\r\n13<\/span>         public<\/span> string<\/span> Key { get<\/span>; private<\/span> set<\/span>; }\r\n<\/span>14<\/span> \r\n15<\/span>         \/\/\/<\/span> <summary><\/span>\r\n16<\/span>         \/\/\/<\/span> Public constructor.\r\n<\/span>17<\/span>         \/\/\/<\/span> <\/summary><\/span>\r\n18<\/span>         \/\/\/<\/span> <param name="key"><\/span>The key for this group.<\/span><\/param><\/span>\r\n19<\/span>         public<\/span> AlphaKeyGroup(string<\/span> key)\r\n<\/span>20<\/span>         {\r\n<\/span>21<\/span>             Key = key;\r\n<\/span>22<\/span>         }\r\n<\/span>23<\/span> \r\n24<\/span>         \/\/\/<\/span> <summary><\/span>\r\n25<\/span>         \/\/\/<\/span> Create a list of AlphaGroup<\/span><T><\/span> with keys set by a SortedLocaleGrouping.\r\n<\/span>26<\/span>         \/\/\/<\/span> <\/summary><\/span>\r\n27<\/span>         \/\/\/<\/span> <param name="slg"><\/span>The <\/span><\/param><\/span>\r\n28<\/span>         \/\/\/<\/span> <returns><\/span>Theitems source for a LongListSelector<\/span><\/returns><\/span>\r\n29<\/span>         private<\/span> static<\/span> List<AlphaKeyGroup<T>> CreateGroups(SortedLocaleGrouping slg)\r\n<\/span>30<\/span>         {\r\n<\/span>31<\/span>             List<AlphaKeyGroup<T>> list = new<\/span> List<AlphaKeyGroup<T>>();\r\n<\/span>32<\/span> \r\n33<\/span>             foreach<\/span> (string<\/span> key in<\/span> slg.GroupDisplayNames)\r\n<\/span>34<\/span>             {\r\n<\/span>35<\/span>                 list.Add(new<\/span> AlphaKeyGroup<T>(key));\r\n<\/span>36<\/span>             }\r\n<\/span>37<\/span> \r\n38<\/span>             return<\/span> list;\r\n<\/span>39<\/span>         }\r\n<\/span>40<\/span> \r\n41<\/span>         \/\/\/<\/span> <summary><\/span>\r\n42<\/span>         \/\/\/<\/span> Create a list of AlphaGroup<\/span><T><\/span> with keys set by a SortedLocaleGrouping.\r\n<\/span>43<\/span>         \/\/\/<\/span> <\/summary><\/span>\r\n44<\/span>         \/\/\/<\/span> <param name="items"><\/span>The items to place in the groups.<\/span><\/param><\/span>\r\n45<\/span>         \/\/\/<\/span> <param name="ci"><\/span>The CultureInfo to group and sort by.<\/span><\/param><\/span>\r\n46<\/span>         \/\/\/<\/span> <param name="getKey"><\/span>A delegate to get the key from an item.<\/span><\/param><\/span>\r\n47<\/span>         \/\/\/<\/span> <param name="sort"><\/span>Will sort the data if true.<\/span><\/param><\/span>\r\n48<\/span>         \/\/\/<\/span> <returns><\/span>An items source for a LongListSelector<\/span><\/returns><\/span>\r\n49<\/span>         public<\/span> static<\/span> List<AlphaKeyGroup<T>> CreateGroups(IEnumerable<T> items, CultureInfo ci, GetKeyDelegate getKey, bool<\/span> sort)\r\n<\/span>50<\/span>         {\r\n<\/span>51<\/span>             SortedLocaleGrouping slg = new<\/span> SortedLocaleGrouping(ci);\r\n<\/span>52<\/span>             List<AlphaKeyGroup<T>> list = CreateGroups(slg);\r\n<\/span>53<\/span> \r\n54<\/span>             foreach<\/span> (T item in<\/span> items)\r\n<\/span>55<\/span>             {\r\n<\/span>56<\/span>                 int<\/span> index = 0<\/span>;\r\n<\/span>57<\/span>                 if<\/span> (slg.SupportsPhonetics)\r\n<\/span>58<\/span>                 {\r\n<\/span>59<\/span>                     \/\/<\/span>check if your database has yomi string for item\r\n<\/span>60<\/span>                     \/\/<\/span>if it does not, then do you want to generate Yomi or ask the user for this item.\r\n<\/span>61<\/span>                     \/\/<\/span>index = slg.GetGroupIndex(getKey(Yomiof(item)));<\/span>\r\n62<\/span>                 }\r\n<\/span>63<\/span>                 else<\/span>\r\n64<\/span>                 {\r\n<\/span>65<\/span>                     index = slg.GetGroupIndex(getKey(item));\r\n<\/span>66<\/span>                 }\r\n<\/span>67<\/span>                 if<\/span> (index >= 0<\/span> && index < list.Count)\r\n<\/span>68<\/span>                 {\r\n<\/span>69<\/span>                     list[index].Add(item);","orderid":"0","title":"[UWP] \u4f7f\u7528SemanticZoom\u63a7\u4ef6(\u4e00)","smalltitle":"","mid":"0","fname":"\u5176\u5b83","special_id":"0","bak_id":"0","info":"0","hits":"6890","pages":"4","comments":"0","posttime":"2017-10-11 16:08:04","list":"1507709284","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"https:\/\/www.cppentry.com\/upload_files\/article\/100\/1_wqumm__.gif","ispic":"1","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"UWP<\/A> \u4f7f\u7528<\/A> SemanticZoom<\/A> \u63a7\u4ef6<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"113.108.110.181","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"[UWP] \u4f7f\u7528SemanticZoom\u63a7\u4ef6","lastview":"1711446958","digg_num":"849","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}