Click here to Skip to main content
15,886,799 members
Articles / Desktop Programming / WPF

Visual Studio 2012 Metro Styles for WPF

Rate me:
Please Sign up or sign in to vote.
4.77/5 (75 votes)
9 Dec 2012CPOL8 min read 363.1K   60.8K   222  
Black Metro Styles for Button, ListBox, Menu, ScrollBar, TabControl, TextBox, ComboBox, DataGrid and GroupBox
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using Selen.Wpf.GenericAppTree;
using Selen.Wpf.GenericAppTree.Contracts;
using Image = System.Drawing.Image;

namespace Selen.Wpf.DemoApplication
{
    /// <summary>
    /// Interaction logic for AddRocketDialog.xaml
    /// </summary>
    public partial class AddRocketDialog
    {
        public AddRocketDialog()
        {
            InitializeComponent();

            var bmp = (Bitmap)Image.FromFile(Path.Combine(new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory).FullName, @"Images\standard.png"));
            DataContext = new AppTreeGenerator().Generate(new List<IAppTreeDataProvider>()
            {
                new Test("Rockets", "ADR 13 (antiDest)", bmp),
                new Test("Rockets", "Cybercontrolled S30", bmp),
                new Test("Rockets/LongRange", "<< 33Km (antiBorg integrated)", bmp),
                new Test("Rockets/LongRange", "<< 50Km", bmp),
                new Test("Rockets/LongRange", "<< 200Km", bmp),
                new Test("Rockets/ShortRange", "Rapid missile (2.7 sps)", bmp),
                new Test("Rockets/ShortRange", "Tank breaking missile (1.5 sps)", bmp),
                new Test("SpaceCannons/Laser", "5600V standard", bmp),
                new Test("SpaceCannons/Laser", "AK74 - L hand automatic", bmp),
                new Test("SpaceCannons/Laser", "SK81 rapid", bmp),
                new Test("SpaceCannons/Cyborg", "Cyberspace master (long range)", bmp),
                new Test("SpaceCannons/Cyborg", "Head Cannon standard", bmp),
                new Test("Guns", "Glück Auf Gewehre ST 2 (BwDe)", bmp),
                new Test("Guns", "MG 'Finsternis' 4.9T (BwDe)", bmp),
                new Test("Guns", "Gatling Gun 'Echt Erzgebirge' (BwDe)", bmp),
                new Test("Guns", "Star 4", bmp),
                new Test("Guns", "MG 45 acc (12 sps)", bmp),
                new Test("Guns", "MG 45 rapid (30 sps)", bmp)
            }, true);
        }
    }

    public class Test : IAppTreeDataProvider
    {
        public Test(string path, string name, Bitmap icon)
        {
            Name = name;
            Path = path;
            Icon = icon;
        }

        public string Name
        {
            get;
            set;
        }

        public string Path
        {
            get;
            set;
        }

        public Bitmap Icon
        {
            get;
            set;
        }

        public bool CanBeDisplayed
        {
            get 
            {
                return true;
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student
Germany Germany
I´m a student and hobby programmer from Germany.

Comments and Discussions