Ejemplo n.º 1
0
 public static IEnumerable <Photograph> GetPhotographs()
 {
     foreach (string resourceName in SharedResources.GetImageNames())
     {
         yield return(new Photograph(resourceName));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the Catalog class.
 /// </summary>
 /// <param name="resourceName">Name of the resource defining the Image of the media.</param>
 /// <param name="mediaName">Name of the media.</param>
 /// <param name="description">Description of the media.</param>
 /// <param name="date">Date Stump for the media.</param>
 public MediaItem(string resourceName, string mediaName, string description, DateTime date)
 {
     MediaName   = mediaName;
     Description = description;
     Image       = SharedResources.GetImage(resourceName);
     Date        = date;
 }
 /// <summary>
 /// Initializes a new instance of the ThemeCatologItem class.
 /// </summary>
 /// <param name="themeName">Name of the theme.</param>
 /// <param name="resourceName">
 /// Name of the resource defining the Thumbnail for the theme.
 /// </param>
 /// <param name="themeXamlPath">
 /// Path to the XAML file for this theme.
 /// </param>
 /// <param name="preferredBackground">
 /// Preferred Background for the theme.
 /// </param>
 internal ThemeCatalogItem(string themeName, string resourceName, string themeXamlPath, Brush preferredBackground)
 {
     ThemeName           = themeName;
     ThumbnailImage      = SharedResources.GetImage(resourceName);
     ThemeXamlPath       = themeXamlPath;
     PreferredBackground = preferredBackground;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Helper function to set the embedded image source.
        /// </summary>
        /// <param name="resourceName">Resource name to be loaded.</param>
        private void SetEmbeddedImage(string resourceName)
        {
            Image image         = GetTemplateChild(ImageLoaderName) as Image;
            Image embeddedImage = SharedResources.GetIcon(resourceName);

            if (image != null & embeddedImage != null)
            {
                image.Source = embeddedImage.Source;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Helper method to create menu items.
        /// </summary>
        /// <param name="resourceName">Name of the resource to be loaded.</param>
        /// <param name="text">Text representing the menu item.</param>
        /// <returns>Returns a stack panel with Image and Text.</returns>
        private static StackPanel CreateMenuItem(string resourceName, string text)
        {
            StackPanel sampleStackPanel = new StackPanel();

            sampleStackPanel.Orientation = Orientation.Horizontal;
            TextBlock textBlock = CreateTextBlock(text);
            Image     icon      = SharedResources.GetIcon(resourceName);

            icon.Stretch = Stretch.None;
            sampleStackPanel.Children.Add(icon);
            sampleStackPanel.Children.Add(textBlock);
            return(sampleStackPanel);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the Photograph class.
 /// </summary>
 /// <param name="resourceName">
 /// Name of the resource defining the photograph.
 /// </param>
 internal Photograph(string resourceName)
 {
     Name  = resourceName;
     Image = SharedResources.GetImage(resourceName);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the Catalog class.
 /// </summary>
 /// <param name="catalogName">Name of the catalog.</param>
 /// <param name="resourceName">
 /// Name of the resource representing the catalog thumbnail.
 /// </param>
 public Catalog(string catalogName, string resourceName)
 {
     CatalogName  = catalogName;
     CatalogImage = SharedResources.GetImage(resourceName);
     MediaItems   = new Collection <MediaItem>();
 }
 /// <summary>
 /// Initializes a new instance of the ThemeCatologItem class.
 /// </summary>
 /// <param name="themeName">Name of the theme.</param>
 /// <param name="resourceName">
 /// Name of the resource defining the Thumbnail for the theme.
 /// </param>
 /// <param name="constructor">
 /// Constructs a new Theme instance.
 /// </param>
 internal ThemeCatalogItem(string themeName, string resourceName, Func <Theme> constructor)
 {
     ThemeName        = themeName;
     ThumbnailImage   = SharedResources.GetImage(resourceName);
     ThemeConstructor = constructor;
 }