Beispiel #1
0
        protected void GetItemAppearance(int index, object item, out string text, out Image image)
        {
            text  = (item != null) ? item.ToString() : "null";
            image = null;
            if (this.ItemAppearance != null)
            {
                if (this.cachedEventItemAppearance == null)
                {
                    this.cachedEventItemAppearance = new TiledViewItemAppearanceEventArgs(this);
                }

                this.cachedEventItemAppearance.ModelIndex     = index;
                this.cachedEventItemAppearance.Item           = item;
                this.cachedEventItemAppearance.DisplayedText  = text;
                this.cachedEventItemAppearance.DisplayedImage = image;

                this.ItemAppearance(this, this.cachedEventItemAppearance);

                text  = this.cachedEventItemAppearance.DisplayedText;
                image = this.cachedEventItemAppearance.DisplayedImage;
            }
        }
Beispiel #2
0
 private void tiledView_ItemAppearance(object sender, TiledViewItemAppearanceEventArgs e)
 {
     e.DisplayedText = e.Item.ToString();
     switch (e.Item.GetHashCode() % 5)
     {
         default:
         case 0: e.DisplayedImage = bmpItemSmall; break;
         case 1: e.DisplayedImage = bmpItemBig; break;
         case 2: e.DisplayedImage = bmpItemHigh; break;
         case 3: e.DisplayedImage = bmpItemWide; break;
         case 4: e.DisplayedImage = null; break;
     }
 }