//
        // OnApplyTemplate
        //

        /// <summary>
        /// Called when ApplyTemplate is called.
        /// </summary>
        public override void OnApplyTemplate()
        {
            PreOnApplyTemplate();
            base.OnApplyTemplate();
            this.picker = WpfHelp.GetTemplateChild <PickerBase>(this, "PART_Picker");
            PostOnApplyTemplate();
        }
        /// <summary>
        /// Checks whether columns can be restored.
        /// </summary>
        /// <param name="subject">Target ManagementList.</param>
        /// <param name="callback">RetryActionAfterLoaded callback method.</param>
        /// <returns>True iff columns restorable.</returns>
        /// <exception cref="InvalidOperationException">
        /// ManagementList.AutoGenerateColumns not supported.
        /// </exception>
        private static bool VerifyColumnsRestorable(ManagementList subject, RetryActionCallback <ManagementList> callback)
        {
            if (WpfHelp.RetryActionAfterLoaded <ManagementList>(subject, callback, subject))
            {
                return(false);
            }

            if (WpfHelp.RetryActionAfterLoaded <ManagementList>(subject.List, callback, subject))
            {
                return(false);
            }

            if (subject.List == null)
            {
                return(false);
            }

            // Columns are not savable/restorable if AutoGenerateColumns is true.
            if (subject.List.AutoGenerateColumns)
            {
                throw new InvalidOperationException("View Manager is not supported when AutoGenerateColumns is set.");
            }

            return(true);
        }
예제 #3
0
        //
        // OnApplyTemplate
        //

        /// <summary>
        /// Called when ApplyTemplate is called.
        /// </summary>
        public override void OnApplyTemplate()
        {
            PreOnApplyTemplate();
            base.OnApplyTemplate();
            this.viewManager = WpfHelp.GetTemplateChild <ListOrganizer>(this, "PART_ViewManager");
            this.viewSaver   = WpfHelp.GetTemplateChild <PickerBase>(this, "PART_ViewSaver");
            PostOnApplyTemplate();
        }
        //
        // OnApplyTemplate
        //

        /// <summary>
        /// Called when ApplyTemplate is called.
        /// </summary>
        public override void OnApplyTemplate()
        {
            PreOnApplyTemplate();
            base.OnApplyTemplate();
            this.dropDown       = WpfHelp.GetTemplateChild <DismissiblePopup>(this, "PART_DropDown");
            this.dropDownButton = WpfHelp.GetTemplateChild <ToggleButton>(this, "PART_DropDownButton");
            PostOnApplyTemplate();
        }
예제 #5
0
        //
        // OnApplyTemplate
        //

        /// <summary>
        /// Called when ApplyTemplate is called.
        /// </summary>
        public override void OnApplyTemplate()
        {
            PreOnApplyTemplate();
            base.OnApplyTemplate();
            this.leftGrip  = WpfHelp.GetTemplateChild <Thumb>(this, "PART_LeftGrip");
            this.rightGrip = WpfHelp.GetTemplateChild <Thumb>(this, "PART_RightGrip");
            PostOnApplyTemplate();
        }
예제 #6
0
        //
        // OnApplyTemplate
        //

        /// <summary>
        /// Called when ApplyTemplate is called.
        /// </summary>
        public override void OnApplyTemplate()
        {
            PreOnApplyTemplate();
            base.OnApplyTemplate();
            this.deleteButton = WpfHelp.GetTemplateChild <Button>(this, "PART_DeleteButton");
            this.editBox      = WpfHelp.GetTemplateChild <TextBox>(this, "PART_EditBox");
            this.linkButton   = WpfHelp.GetTemplateChild <Button>(this, "PART_LinkButton");
            this.renameButton = WpfHelp.GetTemplateChild <ToggleButton>(this, "PART_RenameButton");
            PostOnApplyTemplate();
        }
        private static bool VerifyRulesSavableAndRestorable(ManagementList subject, RetryActionCallback <ManagementList> callback)
        {
            if (WpfHelp.RetryActionAfterLoaded <ManagementList>(subject, callback, subject))
            {
                return(false);
            }

            if (subject.AddFilterRulePicker == null)
            {
                return(false);
            }

            if (subject.FilterRulePanel == null)
            {
                return(false);
            }

            if (subject.SearchBox == null)
            {
                return(false);
            }

            return(true);
        }