c# - Image.Source not showing image when using a string formatted binding -
I am currently using the following code: Changed value "=" province code "item source =" {binding provinces, relative Soros = {relative serge ancestor type = {name} = "Cb_Provinces" text = "province" selection = changed "combo box selection" X: type user control}}} & gt; combobox.itemTemplate & gt; & gt; DataTemplate & gt; & lt; stackPanel & gt; & lt; stackPanel x: name = "stk_ComboTemplate" orientation = "horizontal "Horizontal Alignment =" Left "& gt; Image Width =" 25 "Margin =" 10 "Source =" {Binding Province Code, Stringf Ormet = / Canada Trysvisiintrfes; Component / resource / img / flag / \ {0 \}. GIF} "/> Output Result: The best option is Example: Usage: < / P> combo box to flag images and the Canadian province Name to control with Although images are not visible in control I have tested the binding and have generated this place properly, but the image is not just under control.
string format only works when the target type is
string because
image from
source type
URI string will never be used in
binding
IValueCo To format the nverter to
string and
Image
source property.
& lt; window; Resources & gt; & lt; local: provinceNameToImageSourceConverter x: key = "ImageConverter" /> & lt; /Window.Resources> ....... ........... & lt; image source = "{binding province code, converter = {static resource image converters}}" /> < / Html>
Comments
Post a Comment