All Projects → wongjiahau → Displaying-XAML

wongjiahau / Displaying-XAML

Licence: GPL-3.0 license
This library is for display the XAML code of theme library for WPF (e.g. MaterialDesignInXamlToolkit)

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Displaying-XAML

AdminRunasMenu
A WPF menu driven by powershell to perform administrator functions
Stars: ✭ 26 (-31.58%)
Mutual labels:  xaml, wpf
Code Samples
Just some code samples for MahApps and other experiments...
Stars: ✭ 205 (+439.47%)
Mutual labels:  xaml, wpf
Mvvmvalidation
Lightweight library that helps reduce boilerplate when implementing validation in XAML MVVM applications
Stars: ✭ 141 (+271.05%)
Mutual labels:  xaml, wpf
IconPacks.Browser
The Browser for all available Icon packages from MahApps.Metro.IconPacks
Stars: ✭ 74 (+94.74%)
Mutual labels:  xaml, wpf
Toast
🍞 The rounded and animated Android Toast for .NET WPF/XAML
Stars: ✭ 25 (-34.21%)
Mutual labels:  xaml, wpf
Fluent.ribbon
WPF Ribbon control like in Office
Stars: ✭ 1,895 (+4886.84%)
Mutual labels:  xaml, wpf
Modernwpf
Modern styles and controls for your WPF applications
Stars: ✭ 2,610 (+6768.42%)
Mutual labels:  xaml, wpf
Materialdesigninxamltoolkit
Google's Material Design in XAML & WPF, for C# & VB.Net.
Stars: ✭ 11,603 (+30434.21%)
Mutual labels:  xaml, wpf
MahApps.Metro.netcoreapp30
.NET Core 3.1 MahApps.Metro sample
Stars: ✭ 15 (-60.53%)
Mutual labels:  xaml, wpf
Wpftoolkit
All the controls missing in WPF. Over 1 million downloads.
Stars: ✭ 2,970 (+7715.79%)
Mutual labels:  xaml, wpf
Steamtools
🛠「Steam++」是一个开源跨平台的多功能Steam工具箱。
Stars: ✭ 4,458 (+11631.58%)
Mutual labels:  xaml, wpf
SharpDiskSweeper
Reveal outstanding files or folders that are eating up your disk space
Stars: ✭ 21 (-44.74%)
Mutual labels:  xaml, wpf
Forge.forms
Dynamically generated forms and dialogs in WPF
Stars: ✭ 131 (+244.74%)
Mutual labels:  xaml, wpf
SpicyTaco.AutoGrid
A magical replacement for the built in WPF Grid and StackPanel
Stars: ✭ 67 (+76.32%)
Mutual labels:  xaml, wpf
Arcgis Toolkit Dotnet
Toolkit for ArcGIS Runtime SDK for .NET
Stars: ✭ 125 (+228.95%)
Mutual labels:  xaml, wpf
Gridextra
Custom panel controls for WPF/UWP.
Stars: ✭ 149 (+292.11%)
Mutual labels:  xaml, wpf
Xaml Code Experiences
A collection of the experiences I have collected during days of Xamarin and Wpf, while following the MVVM design pattern.
Stars: ✭ 114 (+200%)
Mutual labels:  xaml, wpf
Aura.ui
A Library with a lot of Controls for AvaloniaUI
Stars: ✭ 114 (+200%)
Mutual labels:  xaml, wpf
Handycontrol
Contains some simple and commonly used WPF controls
Stars: ✭ 3,349 (+8713.16%)
Mutual labels:  xaml, wpf
FileRenamerDiff
A File Renamer App featuring a difference display before and after the change.
Stars: ✭ 32 (-15.79%)
Mutual labels:  xaml, wpf

Displaying-XAML

This library is for display the XAML code of theme library for WPF (e.g. MaterialDesignInXamlToolkit/MahApps)

Why is this library written ?

Because the demo app for the theme library I'm using (MaterialDesignInXamlToolkit) is too hard to use.
For example, when I want to use a control in the demo, I have to search through its GitHub repo for the code. Obviously, this is a pain, therefore I wrote this library, so that the code can be displayed besides each control.

Demo

newdemo

How to use this library ?

1. Install from nuget

Install-Package XamlDisplayerPackage -Version 1.0.3

2. Call the XamlDisplayerPanel initializer at the app startup

        private void App_OnStartup(object sender, StartupEventArgs e) {
            XamlDisplayerPanel.Initialize(
                source:
                    XamlDisplayerPanel.SourceEnum.LoadFromLocal ,
                defaultLocalPath:
                    @"C:\Users\User\Source\Repos\Displaying-XAML\XamlDisplayer\Demo\" ,
                defaultRemotePath:
                    "https://raw.githubusercontent.com/wongjiahau/Displaying-XAML/master/XamlDisplayer/Demo/" ,
                attributesToBeRemoved:
                  new List<string>()
                  {
                    "xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"" ,
                    "xmlns:materialDesign=\"http://materialdesigninxaml.net/winfx/xaml/themes\"" ,
                    "xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\""
                  }
            );
        }
  • source determine where you want to load the XAML source file (either from local(your computer) or remote(e.g. GitHub)
  • defaultLocalPath determine where the files shall be loaded by default if you set source as LoadFromLocal
  • defaultRemotePath determine where the files shall be loaded by default if you set source as LoadFromRemote
  • attributesToBeRemoved specifies the attributes that should be filetered out when displaying the code for each control Refer here to learn more about App_OnStartup method

3. At the place where all the pages are hosted (usually MainWindow.xaml), place in the XamlDisplayerHost

<Window x:Class="DisplayXamlDemo.MainWindow">    
        <codeDisplayer:XamlDisplayerHost x:Name="XamlDisplayerHost"/>        
</Window>

The XamlDisplayerHost is actually a Frame, so you can call the Navigate method using it.

4. For each of the page that is going to be navigated, surround all the controls with XamlDisplayerPanel

<UserControl x:Class="XamlDisplayerDemo.Page1">  
    <codeDisplayer:XamlDisplayerPanel>
        <!--All the controls here-->
    </codeDisplayer:XamlDisplayerPanel>                    
</UserControl>     

Note : The XamlDisplayerPanel can be placed on any level of depth

5. Navigate to each pages by calling Navigate method of XamlDisplayerHost

        public MainWindow() {
            InitializeComponent();
            XamlDisplayerHost.Navigate(new Page1());
        }

Actually, you can also use binding to bind its Content, because XamlDisplayerHost is inherited directly from Frame

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].