public static WrapPanel GeneratePredictionWrapPanel(int mode, String iconPath, String parameterKey, String Value, String error, String errorRatio) { WrapPanel panel = new WrapPanel() { Orientation = Orientation.Horizontal, Margin = new System.Windows.Thickness(6), }; Image icon = new Image() { Source = SvgIcon(iconPath), Width = 40, Height = 40, Margin = new System.Windows.Thickness(10), ToolTip = StringFormater.GetParameterFromKey(parameterKey), Effect = shadowEffect, }; panel.Children.Add(icon); TextBlock value = new TextBlock() { VerticalAlignment = System.Windows.VerticalAlignment.Center, Margin = new System.Windows.Thickness(2), Text = Value, FontSize = textSize, Effect = shadowEffect }; panel.Children.Add(value); if (mode == PredictionSystem.PredictionSystem.CEP) { TextBlock err = new TextBlock() { VerticalAlignment = System.Windows.VerticalAlignment.Center, Margin = new System.Windows.Thickness(2), Text = " \u00B1" + error, ToolTip = "Varie de : " + errorRatio, FontSize = textSize, Effect = shadowEffect }; panel.Children.Add(err); } else { value.Margin = new System.Windows.Thickness(10, 0, 10, 0); } return(panel); }