{"id":16493922,"url":"https://github.com/mrlacey/uwpdesigntimedata","last_synced_at":"2025-08-26T11:38:59.230Z","repository":{"id":141905519,"uuid":"196604102","full_name":"mrlacey/UwpDesignTimeData","owner":"mrlacey","description":"Enable inline design-time data in UWP projects","archived":false,"fork":false,"pushed_at":"2021-03-04T15:03:01.000Z","size":508,"stargazers_count":22,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T20:40:46.179Z","etag":null,"topics":["uwp","visual-studio","xaml"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/UwpDesignTimeData/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrlacey.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":"2019-07-12T15:35:57.000Z","updated_at":"2021-04-03T08:56:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"22adbb8a-8969-42d1-b998-7a800dc068b3","html_url":"https://github.com/mrlacey/UwpDesignTimeData","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlacey%2FUwpDesignTimeData","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlacey%2FUwpDesignTimeData/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlacey%2FUwpDesignTimeData/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlacey%2FUwpDesignTimeData/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrlacey","download_url":"https://codeload.github.com/mrlacey/UwpDesignTimeData/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245104460,"owners_count":20561377,"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":["uwp","visual-studio","xaml"],"created_at":"2024-10-11T14:11:07.143Z","updated_at":"2025-03-23T12:34:50.249Z","avatar_url":"https://github.com/mrlacey.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UWP Design-Time Data\n\n**!IMPORTANT!**\nThis tool should no longer be necessary.  \nThe ablity to use design-time data within the Visual Studio XAML editor was [added in version 16.7](https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-v16.7#xaml-tools-wpf-uwp--xamarinforms).\n\n---\n\nAllow UWP projects to use inline design-time data.\n\n[![NuGet](https://img.shields.io/nuget/v/UwpDesignTimeData.svg)](https://www.nuget.org/packages/UwpDesignTimeData/1.1.0)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n![Works with Visual Studio 2017](https://img.shields.io/static/v1.svg?label=VS\u0026message=2017\u0026color=5F2E96)\n![Works with Visual Studio 2019](https://img.shields.io/static/v1.svg?label=VS\u0026message=2019\u0026color=BB88F3)\n\nIf using localization or bindings in your XAML you can end up with a page that looks empty in the designer.\n\n![Designer with no useful, visible data](./assets/design-time-before.png)\n\nThis makes it hard to know what the UI will look like without running the app.\nThis library provides a way to add data that shows up in the designer without impacting the behavior of the app at run-time.\n\n![Designer showing content at design-time](./assets/design-time-after.png)\n\nDo this:\n\n1. `Install-Package UwpDesignTimeData`\n2. Then, do things like this in your XAML: `dt:DesignTime.Text=\"Only shown in designer.\"`\n\nThen you can see behavior like this:\n\n![Design time data in bindings shown in VS](./assets/design-time-binding.png)\n\nThe `Text` property will show the value from the binding at run-time while showing the design-time data in the designer, so you can have a visual idea of how it will look.\n\n## Support for the following properties\n\nYou can use this library with any of the following `DesignTime` properties.\n\n- Caption\n- Content\n- Date\n- Description\n- FlowDirection\n- Footer\n- Header\n- Icon\n- IsChecked\n- IsOn\n- Maximum\n- MaxRating\n- Minimum\n- OffContent\n- Offset\n- OnContent\n- PaneFooter\n- PaneHeader\n- PaneTitle\n- Password\n- PasswordChar\n- PlaceholderText\n- PlaceholderValue\n- QueryText\n- Source\n- Symbol\n- Text\n- Time\n- Title\n- Value\n\nIf the underlying element has the property the design-time content will be used in the designer. If it doesn't have that property, the design-time value will be ignored.\n\n## Improving the design-time experience\n\nThere are some things you can't visualize in the designer. But these can be seen with this library.\n\nThis includes specifying `Date` for the `DatePicker` and `Time` for the `TimePicker`.\n\n![DatePicker and TimePicker showing values in the designer](./assets/design-time-dateandtime.png)\n\n## Other design-time data solutions\n\nIt's possible to specify a design-time **DataContext** to use and populate the designer. No guarantees are made for using such a solution in combination with this library. Your experience may vary depending on exactly what you're doing.\n\n## Avoid impact at run-time\n\nIgnore the XML namespace alias ('dt' in the example below) to avoid the design-time data being parsed at runtime.\n\n```diff\n    xmlns:dt=\"using:UwpDesignTimeData\"\n\n-   mc:Ignorable=\"d\"\n+   mc:Ignorable=\"d dt\"\n```\n\nEven if you don't do this, the way the code is implemented means that it won't try and overwrite values, at run-time, the way it does in the designer.\n\nThe performance impact of including this library is tiny and should not be noticable. Please feel free to raise an issue if you have a way of reproducing a measurable impact at run-time.\n\n## Why doesn't Visual Studio do this already?\n\nXamarin.Forms already [has this capability](https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/xaml-previewer/design-time-data). Consider this a poly-fill until this functionality is provided by Visual Studio for all XAML dialects. Hopefully this will be soon. :crossed_fingers:\n\nThe hope is that when official support is added, you'll be able to update your code to use it by removing the NuGet reference and replacing '`dt:DesignTime.`' with '`d:`'.\n\n## Important to know\n\nBefore you start using this, you should probably know the following:\n\n- You may need to rebuild the app to force the designer to update and show the [changes to] design-time data.\n- If you specify a property and the design-time version, specify the design-time version second or it may not show in the designer.\n- If you have any questions or suggestions for a new property to support at design-time, please [raise an issue](https://github.com/mrlacey/UwpDesignTimeData/issues/new).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrlacey%2Fuwpdesigntimedata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrlacey%2Fuwpdesigntimedata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrlacey%2Fuwpdesigntimedata/lists"}