public ContentCardImage(Canvas parent_canvas, Color highlight_color, ExplorerContentImage explorer_image) : base(parent_canvas, highlight_color) { explorerImage = explorer_image; StackPanel background = new StackPanel(); background.Orientation = Orientation.Vertical; background.Background = new SolidColorBrush(Color.FromRgb(255, 255, 255)); background.Margin = new Thickness(5); Image image = explorerImage.getImage(); image.MaxWidth = 300; image.MaxHeight = 400; image.Margin = new Thickness(0, 0, 0, 5); background.Children.Add(image); Label caption = new Label(); caption.Content = explorerImage.getName(); caption.FontSize = 20; caption.MaxWidth = 300; caption.FontWeight = FontWeights.Bold; background.Children.Add(caption); setContent(background); }
public ExplorerContentsContainer(ExplorerConfiguration configuration, XmlNode contents_node) { foreach (XmlNode childNode in contents_node.ChildNodes) { ExplorerContentBase newItem; if (childNode.Name == configuration.getImageTag()) { newItem = new ExplorerContentImage(configuration, childNode); } else if (childNode.Name == configuration.getVideoTag()) { newItem = new ExplorerContentVideo(configuration, childNode); } else if (childNode.Name == configuration.getTextTag()) { newItem = new ExplorerContentText(configuration, childNode); } else if (childNode.Name == configuration.getMapTag()) { newItem = new ExplorerContentMap(configuration, childNode); } else { throw new ExplorerParseXMLException("Unknown child node: " + childNode.Name, null); } contentList.Add(newItem.getLocalId(), newItem); } }