XAML defines constants and processing space on string (chord)

Source: Internet
Author: User

XML version= "1.0" encoding= "UTF-8"?

> (1) Basic usage methods you can instantiate various objects in XAML, such as defining string constants in ResourceDictionary:
< ResourceDictionary xmlns = "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"                     xmlns : x = "Http://schemas.microsoft.com/winfx/2006/xaml"                     xmlns : system = "Clr-namespace:system;assembly=mscorlib" >         < FontFamily x : Key = "uid_globalfont_family" > Microsoft Yahei </ FontFamily >     < system : String x : Key = "Uid_refresh" > Refresh </ system : String > </ ResourceDictionary >

The above resource dictionary defines the string constant Uid_refresh, which is actually used in steps: 1. In the XAML used by resourcedictionary.mergeddictionariesImport the above resources
< usercontrol.resources >         < ResourceDictionary >             < resourcedictionary.mergeddictionaries >                 < ResourceDictionary Source = "/xxxxxxxxxxxxxxx;component/xxxxxxxxxxx.xaml"/>             </ resourcedictionary.mergeddictionaries > </ResourceDictionary >     </ usercontrol.resources >2. Refer to this string constant by DynamicResource or StaticResource < TextBlock   Text ="{ DynamicResource Uid_refresh }" />


(2) Existing problems the definition of the above Uid_refresh has a space, the actual display but no space

(3) solve the method with & #160; replace the space.
< system : String x : Key = "Uid_refresh" > & #160; refresh& #160; </ system : String >

Copyright notice: This article Bo main original article, welcome reprint. Please sign only

XAML defines constants and processing space on string (chord)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.