문제

Is there any good tutorial on how to use ResourceManager in WPF binding ? I know how to use it with the GetString function to retrieve a specific resource, but I also would like to use in in binding.

something like

<TextBlock Text="{Binding Resource.EnterName}"/>

thanks

도움이 되었습니까?

해결책

A binding would not do much except getting the value once as the resources do not provide any notifications as far as i know. You can get the values using x:Static, e.g.:

<TextBlock xmlns:prop="clr-namespace:AppAssemblyName.Properties"
           Text="{x:Static prop:Resources.ResourceName}"/>

(The resource's accessors need to be set to public)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top