public FileTabControlAutomationPeer(FileTabControl owner)
     : base(owner)
 {
     this.owner = owner;
 }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            this.mover = this.GetTemplateChild("PART_Mover") as FrameworkElement;
            this.fileTabControl = this.GetTemplateChild("PART_FileTabControl") as FileTabControl;

            if (this.mover != null)
            {
                this.mover.MouseDown += OnMoverMouseDown;
            }

            this.sysMenuIcon = this.GetTemplateChild("PART_SysMenuIcon") as FrameworkElement;

            if (this.sysMenuIcon != null)
            {
                this.sysMenuIcon.MouseDown += OnIconMouseDown;
            }

            AssignSizer("PART_TopLeftSizer", SizeTopLeft);
            AssignSizer("PART_TopRightSizer", SizeTopRight);
            AssignSizer("PART_TopSizer", SizeTop);
            AssignSizer("PART_LeftSizer", SizeLeft);
            AssignSizer("PART_RightSizer", SizeRight);
            AssignSizer("PART_BottomLeftSizer", SizeBottomLeft);
            AssignSizer("PART_BottomRightSizer", SizeBottomRight);
            AssignSizer("PART_BottomSizer", SizeBottom);

            this.qatItemsControl = this.GetTemplateChild("PART_QATItemsControl") as QATItemsControl;

            if (this.qatItemsControl != null)
            {
                this.qatItemsControl.ItemContainerGenerator.StatusChanged += (o, e) => { EnableNewWindowButtonDrag(); };
                this.CommandBindings.Add(new CommandBinding(ViewLayoutEditor.CreateNewWindowCommand, (s, e) => { }));
                EnableNewWindowButtonDrag();
            }

            this.LayoutTabControl = this.GetTemplateChild("PART_LayoutTabControl") as LayoutTabControl;
            this.LayoutTabControl.IsVisibleChanged += OnLayoutTabControlIsVisibleChanged;

            this.Application.LayoutDefinitions.CollectionChanged += OnLayoutDefinitionsCollectionChanged;
            RecreateLayoutCollectionFromScratch();

            LoadDeferredWindowState();
            ReplicateLayoutStates();
        }
 public FileTabControlAutomationPeer(FileTabControl owner)
     : base(owner)
 {
     this.owner = owner;
 }