コード例 #1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            this.toolBar = Template.FindName("PART_TOOLBAR", this) as StoryBoardToolBar;

            this.toolBar.ValueChanged += (l, k) =>
            {
                this.BeginRefresh();
            };

            if (this.Chart != null)
            {
                this.toolBar.LeftPercent  = 0.0;
                this.toolBar.RightPercent = 1.0;

                this.BeginRefresh();
            }

            this.SizeChanged += (l, k) =>
            {
                if (this.IsLoaded)
                {
                    this.RefreshByData();
                }
            };

            this.Loaded += (l, k) =>
            {
                this.RefreshByData();
            };
        }
コード例 #2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            this.toolBar = Template.FindName("PART_TOOLBAR", this) as StoryBoardToolBar;

            this.toolBar.ValueChanged += (l, k) =>
            {
                //  Do :工具栏操作刷新
                Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, new Action(() =>
                {
                    this.BeginRefresh();
                }));

                //this.BeginRefresh();
            };

            if (this.Chart != null)
            {
                this.toolBar.LeftPercent  = 0.0;
                this.toolBar.RightPercent = 1.0;

                this.BeginRefresh();
            }

            this.SizeChanged += (l, k) =>
            {
                if (this.IsLoaded)
                {
                    //  Do :尺寸改变刷新
                    Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, new Action(() =>
                    {
                        this.RefreshByData();
                    }));
                }
                //this.RefreshByData();
            };

            this.Loaded += (l, k) =>
            {
                //  Do :加载时刷新
                Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, new Action(() =>
                {
                    this.RefreshByData();
                }));
                //this.RefreshByData();
            };
        }