private void setup()
        {
            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                return;
            }

            var parent = this.Parent as FrameworkElement;

            while (parent != null)
            {
                if (parent.Parent == null)
                {
                    var window = parent as ContentControl;

                    if (window != null)
                    {
                        this.window      = window;
                        this.togglChrome = new TogglChrome();
                        var oldContent = window.Content as UIElement;
                        window.Content = this.togglChrome;
                        this.togglChrome.SetContent(oldContent);

                        this.refreshData();

                        return;
                    }
                }
                parent = parent.Parent as FrameworkElement;
            }
            throw new Exception("TogglWindowDesignTimeConverter must be descendend of ContentControl.\n\nTry rebuilding.");
        }
        private void setup()
        {
            if (!DesignerProperties.GetIsInDesignMode(this))
                return;

            var parent = this.Parent as FrameworkElement;
            while (parent != null)
            {
                if (parent.Parent == null)
                {
                    var window = parent as ContentControl;

                    if (window != null)
                    {
                        this.window = window;
                        this.togglChrome = new TogglChrome();
                        var oldContent = window.Content as UIElement;
                        window.Content = this.togglChrome;
                        this.togglChrome.SetContent(oldContent);

                        this.refreshData();

                        return;
                    }
                }
                parent = parent.Parent as FrameworkElement;
            }
            throw new Exception("TogglWindowDesignTimeConverter must be descendend of ContentControl.\n\nTry rebuilding.");
        }
Пример #3
0
        private void replaceChrome()
        {
            this.chrome = new TogglChrome
            {
                DataContext  = this,
                IsToolWindow = this.IsToolWindow,
                CanClickIcon = this.CanClickIcon
            };

            this.SetIconState(true);

            this.setupChromeEvents();

            var oldContent = this.Content;

            this.Content = this.chrome;

            this.chrome.SetContent(oldContent as UIElement);
        }
Пример #4
0
        private void replaceChrome()
        {
            this.chrome = new TogglChrome
            {
                DataContext = this,
                IsToolWindow = this.IsToolWindow,
                CanClickIcon = this.CanClickIcon
            };

            this.SetIconState(true);

            this.setupChromeEvents();

            var oldContent = this.Content;
            this.Content = this.chrome;

            this.chrome.SetContent(oldContent as UIElement);
        }