Пример #1
0
        void SetLayout(int layoutId)
        {
            Window window = NUIApplication.GetDefaultWindow();

            switch (mCurrentLayout)
            {
            case (int)AllImagesLayouts.SPIRAL_LAYOUT:
            case (int)AllImagesLayouts.DEPTH_LAYOUT:
            {
                window.GetDefaultLayer().Behavior = Layer.LayerBehavior.Layer3D;
                break;
            }

            case (int)AllImagesLayouts.GRID_LAYOUT:
            {
                window.GetDefaultLayer().Behavior = Layer.LayerBehavior.LayerUI;
                break;
            }
            }

            Size windowSize = window.Size;

            if (layoutId == (int)AllImagesLayouts.DEPTH_LAYOUT)
            {
                mDepthLayout.Insert((int)DefaultItemLayoutProperty.ITEM_SIZE, new PropertyValue(DepthLayoutItemSizeFunctionPortrait(800)));
                mLayout.Clear();
                mLayout.PushBack(new PropertyValue(mSpiralLayout));
                mLayout.PushBack(new PropertyValue(mDepthLayout));
                mLayout.PushBack(new PropertyValue(mGridLayout));
                mItemView.Layout = mLayout;
            }

            // Enable anchoring for depth layout only
            mItemView.SetAnchoring(layoutId == (int)AllImagesLayouts.DEPTH_LAYOUT);

            // Activate the layout
            mItemView.ActivateLayout((uint)layoutId, new Vector3(800, 800, 800), 0.0f);
        }