/// <summary> /// 刷新页面状态 /// </summary> /// <param name="overViewState"></param> /// <param name="strValue"></param> private void BindStates(OverViewState overViewState, string strValue) { if (!Dispatcher.CheckAccess()) // 不在主线程的话放到主线程 { this.Dispatcher.Invoke(new Action(delegate { BindStates(overViewState, strValue); })); return; } switch (overViewState) { case OverViewState.ReactTemp: this.txtTempReact.Text = strValue + "℃"; break; case OverViewState.ReagentTemp: this.txtTempReagent.Text = strValue + "℃"; break; case OverViewState.TubeCount: txtTubeLeft.Text = strValue; txtTubeLeft.Foreground = (strValue == "充足") ? Brushes.Green : Brushes.Red; break; case OverViewState.WashState: txtWashLeft.Text = strValue; txtWashLeft.Foreground = (strValue == "充足") ? Brushes.Green : Brushes.Red; break; case OverViewState.WastTubeState: txtWashLeft.Text = strValue; txtWashLeft.Foreground = (strValue == "正常") ? Brushes.Green : Brushes.Red; break; default: break; } }
标签:case,放到,Text,Brushes,主线,break,OverViewState,strValue,wpf From: https://www.cnblogs.com/lingmin/p/17236509.html