Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
R

Renovatio1510

@Renovatio1510
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Images in a listbox
    R Renovatio1510

    Hi. Thank you for the answer! Yes i use a virtualizingstackpanel for the listbox. Anyway i think that the problem is that i didn't understand the real behaviour of the virtualization. I thought that when an item of my domain becomes invisible its container (listboxitem) is reused for another item. Instead, when an item is no more visible its container is disposed (only the UI element) and another one is created for the item that becomes visible. Anyway, i don't know why the image element in the data template is not garbage-collected when the listbox containing it is disposed (there are no more references to that image). Any helps? Thank you.

    WCF and WF wpf wcf performance question

  • Images in a listbox
    R Renovatio1510

    Hi. I want to display 1000 albums in a listbox. An album is presented using the title, the artist and the cover. As i've understood, the virtualization performed by a listbox (with the virtualizingstackpanel) permits to generate (present) only those items which are visible. In every moment i've only 6 items (albums) visible, so i suppose that the listbox, when my application starts, generates only 6 ListBoxItems, one for each album that is initially visible. I also suppose that, when the user scrolls, the ListBoxItems are re-used to present the albums that become visible. Anyway, when my application starts i see that the memory used is around 300 mbytes, while the memory usage whithout the listbox is 50 mbytes. So i think that the data-template used to present the albums is instantiated for all the 1000 albums and not only for the first 6 albums visible. It is possibile that i have to explicitly write code to load and onload images when the listboxitems where the images are shown becomes visible/invisible? My data-template is this one:

    <DataTemplate x:Key="DataTemplate">
    <StackPanel
    HorizontalAlignment="Left"
    Orientation="Horizontal">
    <Image
    HorizontalAlignment="Left"
    Name="image"
    Tag="image"
    Source="{Binding Path=Items[0].PreviewLocation}"
    Stretch="UniformToFill"
    Margin="0,0,5,0"/>
    <StackPanel
    HorizontalAlignment="Left"
    VerticalAlignment="Center"
    Width="85">
    <TextBlock
    Text="{Binding Path=Name}"
    Margin="0,0,0,1"
    TextTrimming="CharacterEllipsis"/>
    <TextBlock
    Name="Artist"
    Text="{Binding Path=Items[0].Artist}"
    FontWeight="Normal"
    FontSize="7"
    Foreground="#4b4b4

    WCF and WF wpf wcf performance question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups