Exemplo n.º 1
0
        public IRegion AdaptView(DependencyObject regionHost)
        {
            if (regionHost == null) throw new ArgumentNullException("regionHost");
            if (!(regionHost is ToolBarTray))
                throw new InvalidOperationException(
                    "This adapter only supports regionHosts that are Toolbars");

            var tabControl = (ToolBarTray) regionHost;
            var region = new MultipleActiveViewRegion();
            new SynchronizeToolbarsBehavior().Attach(region, tabControl);
            return region;
        }
Exemplo n.º 2
0
        public IRegion AdaptView(DependencyObject regionHost)
        {
            if (regionHost == null) throw new ArgumentNullException("regionHost");
            if (!(regionHost is ItemsControl))
                throw new InvalidOperationException(
                    "This adapter only supports regionHosts that are ItemsControls");

            var itemsControl = (ItemsControl)regionHost;
            var region = new MultipleActiveViewRegion();

            new SynchronizeItemsBehavior().Attach(region, itemsControl);
            new ActiveAwareBehavior().Attach(region, itemsControl);
            return region;
        }