private void CreateSubLevelCollection(DecoCatalogItem dci)
        {
            DecoCollection = new ObservableCollection <DecoCatalogItem>();
            int count = 0;

            for (int y = 0; y < dci.DecoMetadata.SheetRows; y++)
            {
                for (int x = 0; x < dci.DecoMetadata.SheetColumns; x++)
                {
                    count++;
                    SelectionMode selection = dci.DecoMetadata.ActiveFrames.Contains(count) ? SelectionMode.Active : SelectionMode.None;
                    var           newDci    = new DecoCatalogItem(this, dci.ImagePath, dci.DecoMetadata, Args.ItemWidth, Args.ItemHeight);
                    newDci.SourceRect = new Int32Rect(newDci.ItemWidth * x, newDci.ItemHeight * y, newDci.ItemWidth, newDci.ItemHeight);
                    newDci.Selection  = selection;
                    DecoCollection.Add(newDci);
                    if (count == dci.DecoMetadata.FrameCount)
                    {
                        break;
                    }
                }
                if (count == dci.DecoMetadata.FrameCount)
                {
                    break;
                }
            }
        }
Beispiel #2
0
 private void SelectDeco(DecoCatalogItem decoCatalogItem)
 {
     decoCatalogItem.Selection = SelectionMode.Selected;
 }
 internal void EnterSubLevel(DecoCatalogItem dci)
 {
     cachedDecoCollection = DecoCollection;
     CreateSubLevelCollection(dci);
     IsLocalSubLevel = true;
 }