/// <summary> /// Add sensor tile /// </summary> /// <param name="gridRow"></param> /// <param name="gridCol"></param> private void AddSensorTile(ISensor sensor, int gridRow, int gridCol, string sensorCategory) { var s = new SensorTile(); Color backgroundColor = Colors.White; switch (sensorCategory) { case "CPU": backgroundColor = ColorHelper.GetColorFromString(this.applicationConfigFile.Sections["TileSettings"].Settings["CpuTilesColor"].Value); break; case "GPU": backgroundColor = ColorHelper.GetColorFromString(this.applicationConfigFile.Sections["TileSettings"].Settings["GpuTilesColor"].Value); break; case "Mainboard": backgroundColor = ColorHelper.GetColorFromString(this.applicationConfigFile.Sections["TileSettings"].Settings["MainboardTilesColor"].Value); break; } s.HardwareSensor = sensor; s.TileBackground = new SolidColorBrush(backgroundColor); s.SetValue(Grid.RowProperty, gridRow); s.SetValue(Grid.ColumnProperty, gridCol); this.MainGrid.Children.Add(s); }