Esempio n. 1
0
        /// <inheritdoc />
        public void SetContent <TView>(MainFrameRegion region, params object[] injections)
        {
            if (this.logger.IsDebugEnabled)
            {
                this.logger.Debug("Trying to set {0} to region {1}.", typeof(TView), region);
            }

            object content = this.container.Resolve <TView>(injections);

            this.SetContent(region, content);
        }
Esempio n. 2
0
        /// <inheritdoc />
        public void SetVisibility(MainFrameRegion region, bool isVisible)
        {
            if (this.logger.IsDebugEnabled)
            {
                this.logger.Debug("Trying to set visibility '{0}' to region {1}.", isVisible, region);
            }

            switch (region)
            {
            case MainFrameRegion.Content:
                this.ContentControl.Visibility = isVisible ? Visibility.Visible : Visibility.Collapsed;
                break;

            case MainFrameRegion.Right:
                this.RightRegionContentControl.Visibility = isVisible ? Visibility.Visible : Visibility.Collapsed;
                break;

            case MainFrameRegion.BottomAppBarRightZone:
                this.BottomAppBarRightZoneRegionContentControl.Visibility = isVisible ? Visibility.Visible : Visibility.Collapsed;
                break;

            case MainFrameRegion.Background:
                this.BackgroundContentControl.Visibility = isVisible ? Visibility.Visible : Visibility.Collapsed;
                break;

            case MainFrameRegion.Links:
                this.LinksContentControl.Visibility = isVisible ? Visibility.Visible : Visibility.Collapsed;
                break;

            case MainFrameRegion.SnappedView:
                this.SnappedViewContentControl.Visibility = isVisible ? Visibility.Visible : Visibility.Collapsed;
                break;

            case MainFrameRegion.TopAppBarRightZone:
                this.TopAppBarRightZoneRegionContentControl.Visibility = isVisible ? Visibility.Visible : Visibility.Collapsed;
                break;

            default:
                throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Region {0} is not supported.", region));
            }
        }
Esempio n. 3
0
        /// <inheritdoc />
        public void SetContent(MainFrameRegion region, object content)
        {
            if (this.logger.IsDebugEnabled)
            {
                this.logger.Debug("Trying to set {0} to region {1}.", content, region);
            }

            switch (region)
            {
            case MainFrameRegion.Content:
                this.SetContentRegion(content);
                break;

            case MainFrameRegion.Right:
                this.SetRightRegion(content);
                break;

            case MainFrameRegion.BottomAppBarRightZone:
                this.SetBottomAppBarRightZoneRegion(content);
                break;

            case MainFrameRegion.Background:
                this.SetBackgroundRegion(content);
                break;

            case MainFrameRegion.Links:
                this.SetLinksRegion(content);
                break;

            case MainFrameRegion.SnappedView:
                this.SetSnappedRegion(content);
                break;

            case MainFrameRegion.TopAppBarRightZone:
                this.SetTopAppBarRightZoneRegion(content);
                break;

            default:
                throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Region {0} is not supported.", region));
            }
        }