Thursday 15 May 2014

c# - Cannot show quickly list of images in WPF ItemsControl -


I have the item control (listbox) with some custom complex data templates. And something to show the window with this listbox Take seconds!

My list box contains an image in the datataplet:

  & lt; Image Stretch = "Uniform" x: name = "image" Grid.ColumnSpan = "1" source = "{Binding ImagePath}" Horizontal Alignment = "Statch" Vertical Alignment = "Stretch" width = "Auto" Grid. Column = "0" minway = "20" minhite = "20" D: layoutoverride = "gridbox" margin = "1,0,1, 1" />   

Almost all the emailpaths are faucet. I saw that this generates a blank exception, but the wpf engine hides it! I think this is the source of the problem, is it possible to disable image loading when I know the image path is zero !?

Add this datatyger your DataTemplate : < / P>

  & lt; Data Trigger Binding = "{Binding Image Path}" Value = "{x: Faucet}" & gt; & Lt; Setter target name = "image" property = "source" value = "{x: faucet}" /> & Lt; / DataTrigger & gt;    

No comments:

Post a Comment