{"id":15637241,"url":"https://github.com/wongjiahau/displaying-xaml","last_synced_at":"2025-04-30T06:42:17.407Z","repository":{"id":89456051,"uuid":"98502480","full_name":"wongjiahau/Displaying-XAML","owner":"wongjiahau","description":"This library is for display the XAML code of theme library for WPF (e.g. MaterialDesignInXamlToolkit)","archived":false,"fork":false,"pushed_at":"2017-11-12T09:21:39.000Z","size":530,"stargazers_count":40,"open_issues_count":0,"forks_count":20,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-18T21:31:34.213Z","etag":null,"topics":["code-display","demo","theme-library","wpf","xaml"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wongjiahau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-27T06:41:12.000Z","updated_at":"2025-02-25T08:55:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"f974d24a-6738-4628-b7c5-1e81aa73e24d","html_url":"https://github.com/wongjiahau/Displaying-XAML","commit_stats":{"total_commits":95,"total_committers":3,"mean_commits":"31.666666666666668","dds":0.04210526315789476,"last_synced_commit":"5701c21049d4cbac24def1df4f0851634582c83c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wongjiahau%2FDisplaying-XAML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wongjiahau%2FDisplaying-XAML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wongjiahau%2FDisplaying-XAML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wongjiahau%2FDisplaying-XAML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wongjiahau","download_url":"https://codeload.github.com/wongjiahau/Displaying-XAML/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251658165,"owners_count":21622818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-display","demo","theme-library","wpf","xaml"],"created_at":"2024-10-03T11:10:53.969Z","updated_at":"2025-04-30T06:42:17.374Z","avatar_url":"https://github.com/wongjiahau.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Displaying-XAML\nThis library is for display the XAML code of theme library for WPF (e.g. MaterialDesignInXamlToolkit/MahApps)\n\n## Why is this library written ?\nBecause the demo app for the theme library I'm using ([MaterialDesignInXamlToolkit](https://github.com/ButchersBoy/MaterialDesignInXamlToolkit)) is too hard to use.   \nFor 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.\n\n## Demo\n![newdemo](https://user-images.githubusercontent.com/23183656/30123252-f3db094c-9363-11e7-9ae8-911789b6ae08.gif)\n\n## How to use this library ? \n### 1. Install from nuget \n`Install-Package XamlDisplayerPackage -Version 1.0.3 `\n\n### 2. Call the XamlDisplayerPanel initializer at the app startup \n```C#\n        private void App_OnStartup(object sender, StartupEventArgs e) {\n            XamlDisplayerPanel.Initialize(\n                source:\n                    XamlDisplayerPanel.SourceEnum.LoadFromLocal ,\n                defaultLocalPath:\n                    @\"C:\\Users\\User\\Source\\Repos\\Displaying-XAML\\XamlDisplayer\\Demo\\\" ,\n                defaultRemotePath:\n                    \"https://raw.githubusercontent.com/wongjiahau/Displaying-XAML/master/XamlDisplayer/Demo/\" ,\n                attributesToBeRemoved:\n                  new List\u003cstring\u003e()\n                  {\n                    \"xmlns=\\\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\\\"\" ,\n                    \"xmlns:materialDesign=\\\"http://materialdesigninxaml.net/winfx/xaml/themes\\\"\" ,\n                    \"xmlns:x=\\\"http://schemas.microsoft.com/winfx/2006/xaml\\\"\"\n                  }\n            );\n        }\n```\n- `source` determine where you want to load the XAML source file (either from local(your computer) or remote(e.g. GitHub)\n- `defaultLocalPath` determine where the files shall be loaded by default if you set `source` as `LoadFromLocal`\n- `defaultRemotePath` determine where the files shall be loaded by default if you set `source` as `LoadFromRemote`\n- `attributesToBeRemoved` specifies the attributes that should be filetered out when displaying the code for each control\n_Refer [here](https://msdn.microsoft.com/en-us/library/system.windows.application.startup(v=vs.110).aspx) to learn more about App_OnStartup method_\n\n\n### 3. At the place where all the pages are hosted (usually MainWindow.xaml), place in the XamlDisplayerHost\n```xml\n\u003cWindow x:Class=\"DisplayXamlDemo.MainWindow\"\u003e    \n        \u003ccodeDisplayer:XamlDisplayerHost x:Name=\"XamlDisplayerHost\"/\u003e        \n\u003c/Window\u003e\n```\nThe XamlDisplayerHost is actually a Frame, so you can call the `Navigate` method using it.\n\n### 4. For each of the page that is going to be navigated, surround all the controls with XamlDisplayerPanel\n```xml\n\u003cUserControl x:Class=\"XamlDisplayerDemo.Page1\"\u003e  \n    \u003ccodeDisplayer:XamlDisplayerPanel\u003e\n        \u003c!--All the controls here--\u003e\n    \u003c/codeDisplayer:XamlDisplayerPanel\u003e                    \n\u003c/UserControl\u003e     \n```\n_Note : The XamlDisplayerPanel can be placed on any level of depth_\n\n### 5. Navigate to each pages by calling Navigate method of XamlDisplayerHost\n```C#\n        public MainWindow() {\n            InitializeComponent();\n            XamlDisplayerHost.Navigate(new Page1());\n        }\n```\n_Actually, you can also use binding to bind its `Content`, because `XamlDisplayerHost` is inherited directly from `Frame`_\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwongjiahau%2Fdisplaying-xaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwongjiahau%2Fdisplaying-xaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwongjiahau%2Fdisplaying-xaml/lists"}