TechSapphire Monday, 2024-12-09, 3:31 PM
Site menu
Login form
News
Play Games
  • Deep Freeze
  • Ice Slide
  • Gyroball
  • Fat Fish
  • Bush Royal Rampage
  • Metro UI or Modern UI Application WPF using MahApps

    To create Metro or Modern UI looking application in WPF. You just have to follow below steps also to download code shown in demo can be downloaded from link below.

    Step 1: Add Nuget MahApps.Metro

    Step 2: Copy below in App.xaml as App Resource

        <Application.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                    <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                    <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
                    <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Green.xaml" />
                    <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
                    <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml" />
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Application.Resources>

    Note: in above resources you can change theme by chanding BaseLight to BaseDark or by Changing Green to different colors like Blue, Red, etc.

    Step 3: Copy below mentioned xaml name spaces in MainWindow.xaml or any other WPF window:

    xmlns:fsxaml="http://github.com/fsprojects/FsXaml"
    xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls" 

    Step 4: Change class inherited in MainWindow.cs  or other WPF window.cs file with

    MahApps.Metro.Controls.MetroWindow

    Step 5: You are ready :)

    To Download example click here.

     

     

    Categories
    Programming [27]
    Tips for programming
    Security [2]
    Security Tips
    Google [1]
    Use google faster then ever you use
    Project [14]
    HTML [2]
    Electronics [0]
    Data Structure [0]
    Database [16]
    SQL SERVER
    SSRS [1]
    Sql Server Reporting Services
    Copyright MyCorp © 2024