예제 #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 13 "..\..\MainWindow.xaml"
                ((Test.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.temperature = ((TemperatureGuage.TemperatureGuageControl)(target));
                return;

            case 3:
                this.circleBar = ((CircleProcessBar.CircularProcessBarControl)(target));
                return;

            case 4:
                this.loading = ((LoadingCircle.LoadingCircleControl)(target));
                return;
            }
            this._contentLoaded = true;
        }
예제 #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ThreadPool.QueueUserWorkItem(x =>
            {
                while (true)
                {
                    Thread.Sleep(2000);

                    this.Dispatcher.Invoke((Action)(() =>
                    {
                        TemperatureGuage.TemperatureGuageControl control = this.temperatureGrid.Children[r.Next(0, 3)] as TemperatureGuageControl;
                        if (control != null)
                        {
                            control.CurrentValue = r.NextDouble() * (control.MaxValue - control.MinHeight);
                        }

                        CircleProcessBar.CircularProcessBarControl control1 = this.processBarGrid.Children[r.Next(0, 3)] as CircularProcessBarControl;
                        if (control1 != null)
                        {
                            control1.SuccessRate = r.Next(0, 101);
                        }
                    }));
                }
            });
        }
        //值和刻度都更新
        private static void OnAllChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TemperatureGuageControl tg = d as TemperatureGuageControl;

            tg.OnApplyTemplate();
            tg.CurrentValueChanged(e);
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.tg = ((TemperatureGuage.TemperatureGuageControl)(target));
                return;

            case 2:
                this.btnStart = ((System.Windows.Controls.Button)(target));

            #line 16 "..\..\TemperatureControlTest.xaml"
                this.btnStart.Click += new System.Windows.RoutedEventHandler(this.btnStart_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.lbCounter = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.pb = ((System.Windows.Controls.ProgressBar)(target));
                return;

            case 5:
                this.tbErrorCount = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.tbMaxRange = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.lbCounter_Copy = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }