private View.Label GetLabel(Label label, double left, double top, double right, double bottom) { View.Label viewLabel = new View.Label { Margin = new Thickness(ConvertMmToPixel(left), ConvertMmToPixel(top), ConvertMmToPixel(right), ConvertMmToPixel(bottom)) }; viewLabel.Border.BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(label.Color.ColorHEX)); viewLabel.FirstName.Text = label.FirstName; viewLabel.FirstName.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(label.Color.ColorHEX)); viewLabel.FirstName.FontFamily = new FontFamily(new Uri(label.Font.BaseURI), "./" + label.Font.Path); viewLabel.FirstName.FontSize = label.Font.FontSize; viewLabel.LastName.Text = label.LastName; viewLabel.LastName.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(label.Color.ColorHEX)); viewLabel.LastName.FontFamily = new FontFamily(new Uri(label.Font.BaseURI), "./" + label.Font.Path); viewLabel.LastName.FontSize = label.Font.FontSize; if (!string.IsNullOrEmpty(label.ImagePath)) { viewLabel.Image.Source = new BitmapImage(new Uri(Environment.CurrentDirectory + "\\img\\" + label.ImagePath + ".png", UriKind.RelativeOrAbsolute)); } return(viewLabel); }
private BlockUIContainer GetSimpleLabel(Label label) { WrapPanel wrapPanel = new WrapPanel { Margin = new Thickness(ConvertMmToPixel(5)) }; for (int i = 0; i < 55; i++) { View.Label viewLabel = GetLabel(label, 3.7, 0, 3.7, 2.4); wrapPanel.Children.Add(viewLabel); } BlockUIContainer container = new BlockUIContainer(wrapPanel); return(container); }