private static void OnIndicatorVisiableChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { //Get access to the instance of CircularGaugeConrol whose property value changed StateIndicator1 depObj = d as StateIndicator1; depObj.elipIndicator.Visibility = ((bool)e.NewValue)?Visibility.Visible:Visibility.Hidden; }
private static void OnLabelContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { //Get access to the instance of CircularGaugeConrol whose property value changed StateIndicator1 depObj = d as StateIndicator1; depObj.lbIndicator.Content = e.NewValue; }
private static void OnIndicatorColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { //Get access to the instance of CircularGaugeConrol whose property value changed StateIndicator1 depObj = d as StateIndicator1; LinearGradientBrush lineBrush = new LinearGradientBrush(); lineBrush.EndPoint = new Point(0.5, 1); lineBrush.StartPoint = new Point(0.5, 0); GradientStop gradStop1 = new GradientStop(); gradStop1.Offset = 0.1; GradientStop gradStop2 = new GradientStop(); gradStop2.Offset = 0.8; switch ((StateIndicatorColor)e.NewValue) //on { case StateIndicatorColor.Gray: //gray { gradStop1.Color = Color.FromArgb(0xFF, 0x9B, 0xAD, 0xA2); gradStop2.Color = Color.FromArgb(0xFF, 0x3F, 0x41, 0x41); break; } case StateIndicatorColor.Yellow: //yellow { gradStop1.Color = Color.FromArgb(0xFF, 0xF8, 0xF8, 0x20); gradStop2.Color = Color.FromArgb(0xFF, 0x6C, 0xB7, 0x15); break; } case StateIndicatorColor.Green: //green { gradStop1.Color = Color.FromArgb(0xFF, 0x1B, 0xD1, 0x62); gradStop2.Color = Color.FromArgb(0xFF, 0x0C, 0x69, 0x69); break; } case StateIndicatorColor.Red: //red { gradStop1.Color = Color.FromArgb(0xFF, 0xF8, 0x28, 0x20); gradStop2.Color = Color.FromArgb(0xFF, 0x9B, 0x2E, 0x15); break; } default: break; } lineBrush.GradientStops.Add(gradStop1); lineBrush.GradientStops.Add(gradStop2); depObj.elipIndicator.Fill = lineBrush; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.vbNormalPage = ((System.Windows.Controls.Viewbox)(target)); return; case 2: this.gdNormalPage = ((System.Windows.Controls.Grid)(target)); return; case 3: this.gdUartInfo = ((System.Windows.Controls.Grid)(target)); return; case 4: this.cbCanType = ((System.Windows.Controls.ComboBox)(target)); return; case 5: this.cbDeviceIndex = ((System.Windows.Controls.ComboBox)(target)); return; case 6: this.cbCanIndex = ((System.Windows.Controls.ComboBox)(target)); #line 64 "..\..\..\..\..\Controls\PageControls\BootloaderPage.xaml" this.cbCanIndex.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ComboBox_SelectionChanged); #line default #line hidden return; case 7: this.cbCanBaudrate = ((System.Windows.Controls.ComboBox)(target)); #line 72 "..\..\..\..\..\Controls\PageControls\BootloaderPage.xaml" this.cbCanBaudrate.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ComboBox_SelectionChanged); #line default #line hidden return; case 8: this.btnCanConnect = ((System.Windows.Controls.Button)(target)); #line 84 "..\..\..\..\..\Controls\PageControls\BootloaderPage.xaml" this.btnCanConnect.Click += new System.Windows.RoutedEventHandler(this.btnConnectCan_Click); #line default #line hidden return; case 9: this.gdBody = ((System.Windows.Controls.Grid)(target)); return; case 10: this.sIDstatusOfMcuReset = ((BeatfanControls.Indicators.StateIndicator1)(target)); return; case 11: this.btnResetMcu = ((System.Windows.Controls.Button)(target)); #line 107 "..\..\..\..\..\Controls\PageControls\BootloaderPage.xaml" this.btnResetMcu.Click += new System.Windows.RoutedEventHandler(this.btnResetMcu_Click); #line default #line hidden return; case 12: this.sIDstatusOfBootloader = ((BeatfanControls.Indicators.StateIndicator1)(target)); return; case 13: this.btnEnterBootloader = ((System.Windows.Controls.Button)(target)); #line 109 "..\..\..\..\..\Controls\PageControls\BootloaderPage.xaml" this.btnEnterBootloader.Click += new System.Windows.RoutedEventHandler(this.btnEnterBootloader_Click); #line default #line hidden return; case 14: this.tbSelectedHexFilePath = ((System.Windows.Controls.TextBox)(target)); #line 118 "..\..\..\..\..\Controls\PageControls\BootloaderPage.xaml" this.tbSelectedHexFilePath.PreviewDrop += new System.Windows.DragEventHandler(this.TextBox_Drop); #line default #line hidden #line 118 "..\..\..\..\..\Controls\PageControls\BootloaderPage.xaml" this.tbSelectedHexFilePath.PreviewDragOver += new System.Windows.DragEventHandler(this.TextBox_DragOver); #line default #line hidden return; case 15: this.btnSelectHexFile = ((System.Windows.Controls.Button)(target)); #line 119 "..\..\..\..\..\Controls\PageControls\BootloaderPage.xaml" this.btnSelectHexFile.Click += new System.Windows.RoutedEventHandler(this.btnSelectHexFile_Click); #line default #line hidden return; case 16: this.psbProgress = ((System.Windows.Controls.ProgressBar)(target)); return; case 17: this.btnStartBurn = ((System.Windows.Controls.Button)(target)); #line 131 "..\..\..\..\..\Controls\PageControls\BootloaderPage.xaml" this.btnStartBurn.Click += new System.Windows.RoutedEventHandler(this.btnStartBurn_Click); #line default #line hidden return; case 18: this.gdMsg = ((System.Windows.Controls.Grid)(target)); return; case 19: this.btnClearMsg = ((System.Windows.Controls.Button)(target)); #line 151 "..\..\..\..\..\Controls\PageControls\BootloaderPage.xaml" this.btnClearMsg.Click += new System.Windows.RoutedEventHandler(this.btnClearMsg_Click); #line default #line hidden return; case 20: this.btnShowMsg = ((System.Windows.Controls.Button)(target)); #line 152 "..\..\..\..\..\Controls\PageControls\BootloaderPage.xaml" this.btnShowMsg.Click += new System.Windows.RoutedEventHandler(this.btnShowMsg_Click); #line default #line hidden return; case 21: this.rtbMsg = ((System.Windows.Controls.RichTextBox)(target)); return; case 22: this.paraMsg = ((System.Windows.Documents.Paragraph)(target)); return; } this._contentLoaded = true; }