dz̸SilverlightһЩʹÓþ­Ñé

´ó ÖРС  ÎÄÕÂÀ´Ô´£ºÍòÏó»¥Áª ¸üÐÂʱ¼ä£º2012-11-1 17:21:55
·ÖÏí£º

ʹÓÃWPF/Silverlight¿ª·¢ÒÑÓм¸Ä꣬Õ⼸ÄêÀ´Ñ§µ½Á˺ܶණÎ÷£¬´òËã·ÖÏíһЩWPF/Silverlight¿ª·¢×î¼Ñʵ¼ù£¬Ï£ÍûÕâЩ¼¼ÇÉÔÚÄã±à¼­XAML´úÂëʱÄÜÓÐËù°ïÖú¡£

ÔÚXAMLÎļþÖв»ÒªÊ¹ÓÃÎÞÓõÄxmlnsÃüÃû¿Õ¼ä£¬ÕâÑù»áµ¼ÖÂSilverlightÒ³Ãæ¼ÓÔØÊ±¼ä¹ý³¤¡£²»ÒªÔÚµ¥¸öXAMLÒ³ÃæÖÐÔö¼Ó¶à¸öÏàͬµÄÃüÃû¿Õ¼ä£¬ÕâÑù»áÆÆ»µXAML´úÂëµÄ¿Éά»¤ÐÔ£¬ÔËÐÐʱ¶à´Î¼ÓÔØÏàͬÃû³ÆµÄÃüÃû¿Õ¼ä¿ÉÄÜ»áÒýÆð¸÷ÖÖÄÚ´æÎÊÌâ¡£

ΪxmlnsÃüÃû¿Õ¼äǰ׺ʹÓúÏÊʵÄÃû×Ö£¬ÀýÈ磬xmlns:commonControls¾Í±Èxmlns:cctrl¸üÓÐÒâÒ壬ÕâÑù¿ÉÒÔ±ÜÃ⽫À´ÃüÃû¿Õ¼äµÄ¶à´ÎÉùÃ÷¡£XmlnsÃüÃû¿Õ¼äµÄǰ׺Öо¡Á¿±ÜÃâʹÓÃlocal£¬×îºÃÓÃlocalControls»òlocalConverters´úÌæ£¬ÔÚÏàͬµÄ³ÌÐò¼¯ÖпÉÄÜÓÐÁ½¸ö»ò¶à¸öÃüÃû¿Õ¼ä£¨ÈçControls»òConvertersµÈ£©£¬ÔÚÕâÖÖÇé¿öÏ£¬Ê¹ÓúÏÊʵÄǰ׺Ãû½«ÓÐÖúÓÚÕýÈ·Çø±ðËüÃÇ¡£

µ±Ôö¼ÓÒ»¸öÎÞÔªËØµÄ¿Ø¼þʱ£¬×îºÃʹÓÃ×ԱպϱêÇ©¡°/>¡±¹Ø±Õ£¬²»ÒªÊ¹ÓÃÓ²¹Ø±Õ±êÇ©¡°</tag>¡±£¬ÕâÑùXAML´úÂë¿´ÆðÀ´»á¸üÇåˬ¡£Èç¹û×ÊԴûÓб»Ê¹Óã¬×îºÃÒÆ³ýÕâЩ²»±ØÒªµÄ×ÊÔ´¼ü£¬ËüÃÇ»áÏûºÄ¸ü¶àµÄÄڴ棬Äã¿ÉÄÜ»áÒò´ËÓöµ½ºÜ¶àÄÕÈ˵ÄÎÊÌ⣬Èç¹ûÄãºóÃæ»áʹÓõ½ËüÃÇ£¬Äã¿ÉÒÔËæÊ±À´Ìí¼ÓËüÃÇ¡£

²»ÒªÊ¹ÓöîÍâµÄÃæ°å£¨ÈçGrid£¬StackPanel£¬CanvasµÈ£©¡£Èç¹ûÄãÐèҪʹÓÃÆäËüÃæ°å£¬Ê×ÏÈÓ¦¸Ã³¢ÊÔGrid£¬GridÓµÓÐÁé»îµÄUI²¼¾Ö£¬¶Ôµ÷ÕûÓ¦ÓóÌÐò´óСºÜÓÐÓᣲ»ÒªÆóͼ¸øSilverlightÒ³ÃæÖеÄËùÓпؼþÆðÒ»¸öÃû×Ö£¬ÒòΪÔÚ¼ÓÔØÊ±»á´´½¨Ò»Ð©²»±ØÒªµÄ¶ÔÏó£¬Ö»ÐèҪΪÄÇЩºóÃæ½«»áÓõ½µÄ¿Ø¼þÆðÒ»¸öÃû×Ö¼´¿É£¬Èç¹ûÄãÔÚʹÓÃMVVMģʽ£¬Äã¿ÉÒÔÒÆ³ý¼¸ºõËùÓпؼþµÄÃû×Ö¡£

ʹÓÿؼþµÄVisibilityÊôÐÔ´úÌæOpacityÊôÐÔÒþ²ØÄÚÈÝ£¬OpacityÊôÐÔÖµÉèΪ0ËäÈ»¿ÉÒÔÆðµ½Òþ²Ø×÷Ó㬵«ÄÚ´æÕ¼ÓúÍUI¿Õ¼äÕ¼ÓÃÊDz»»á¼õÉٵģ¬Ïà·´£¬VisibilityÊôÐÔ»áÊÍ·ÅÄÚ´æºÍUI¿Õ¼ä£¬Òò´Ë¿ÉÒÔ½«ÓÐÏ޵Ŀռä·ÅÖÃÆäËü¿Ø¼þ¡£ÔÚXAML´úÂëÖÐʹÓÃÕýÈ·µÄ¸ñʽ£¬ÕâÑù»áʹ´úÂë¸üºÃ¿´£¬Ò²¸üÒ×ÓÚά»¤¡£

¾¡¿ÉÄÜΪXAMLÔö¼Ó×¢ÊÍ£¬µ±¹ýÁ˺ܾÃÄãÔٲ鿴ÕâЩ´úÂëʱ£¬Äã²ÅÄÜÏëÆðµ±³õÕâÑùдµÄ¶¯»ú£¬´ËÍ⣬Èç¹ûÊǶàÈËЭ×÷£¬ºÏÀíµÄ×¢ÊÍ»á¼õÉÙÆäËûÈËÔ±µÄ´úÂëÔĶÁºÍÀí½âʱ¼ä£¬´Ù½øÐ­×÷Éú²úÁ¦µÄÌá¸ß¡£Ê¹ÓÃStaticResource´úÌæDynamicResource£¬Ê×ÏÈËü»áÌáÉýÐÔÄÜ£¬Æä´ÎÔÚ¿ª·¢Ê±¿ÉÒÔÅܳöÒì³£ÐÅÏ¢£¬ÓÐÀûÓÚµ÷ÊÔ¡£

ÒÆ³ý²»ÐèÒªµÄÑùʽ¡£Èç¹ûÄãÏë¿çÓ¦ÓóÌÐò¹²ÏíÄãµÄÑùʽ£¬×îºÃÔÚµ¥¶ÀµÄÎļþÖÐÌí¼ÓÄãµÄÑùʽ£¬Èç¹ûÖ»Õë¶Ôij¸öÌØÊâµÄÒ³Ãæ£¬×îºÃÔÚÒ³Ãæ×ÊÔ´ÎļþÖÐÌí¼ÓËüÃÇ¡£

ÎÄÕÂÀ´Ô´£ºhttp://www.hulian.top£¬×ªÔØÇë×¢Ã÷£¡


°æÈ¨ËµÃ÷:±¾Õ¾Ô­´´ÎÄÕÂ,ÓÉÍòÏó»¥ÁªSEOÓÅ»¯·¢±í.
±¾ÎĵØÖ·:https://www.hulian.top/zixun/post/5350.html
ÔÚÏß×Éѯ
  • ÔÚÏßʱ¼ä
  • 8:00-21:00