{"id":28355875,"url":"https://github.com/doomviruz/uiext.markup.wpf","last_synced_at":"2025-08-23T13:12:02.046Z","repository":{"id":143373291,"uuid":"283419862","full_name":"doomviruz/UIExt.Markup.WPF","owner":"doomviruz","description":"WPF extensions library to define UI from code instead of XAML usage.","archived":false,"fork":false,"pushed_at":"2020-11-26T08:17:04.000Z","size":208,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-29T04:24:50.845Z","etag":null,"topics":["csharp","library","markup","wpf"],"latest_commit_sha":null,"homepage":"","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/doomviruz.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,"zenodo":null}},"created_at":"2020-07-29T06:39:14.000Z","updated_at":"2023-11-21T05:31:58.000Z","dependencies_parsed_at":"2023-05-05T02:10:56.062Z","dependency_job_id":null,"html_url":"https://github.com/doomviruz/UIExt.Markup.WPF","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/doomviruz/UIExt.Markup.WPF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doomviruz%2FUIExt.Markup.WPF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doomviruz%2FUIExt.Markup.WPF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doomviruz%2FUIExt.Markup.WPF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doomviruz%2FUIExt.Markup.WPF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doomviruz","download_url":"https://codeload.github.com/doomviruz/UIExt.Markup.WPF/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doomviruz%2FUIExt.Markup.WPF/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271749002,"owners_count":24814102,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["csharp","library","markup","wpf"],"created_at":"2025-05-28T06:10:16.231Z","updated_at":"2025-08-23T13:12:02.039Z","avatar_url":"https://github.com/doomviruz.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UIExt.Markup.WPF\nDraft WPF extensions library to define UI from code instead of XAML usage.\nInspired by VincentH-Net/CSharpForMarkup for Xamarin Forms.\n\n## Nu-get\n\nNu-get package | Description\n---------------|-------------\n[UIExt.Markup.WPF](https://www.nuget.org/packages/UIExt.Markup.WPF) | Now 0.1.0 intial release published.\n\n## Example\n```csharp\npublic void Build() =\u003e\n            this.Content(\n                Grid()\n                    .RowDefs(RowDef.Height(72), RowDef.Height(30), RowDef.Height(385), RowDef.Height(80))\n                    .Childs(\n                        TextBlock()\n                            .Foreground(SolidBrush(\"#ff000000\"))\n                            .Font(family: \"SegoeUI\", size: 20, style: FontStyles.Normal, weight: FontWeights.SemiBold)\n                            .Text(\"SAMPLE DIALOG FOR UIExt.Markup.WPF\")\n                            .HAlignCenter()\n                            .LineHeight(24)\n                            .Row(0)\n                            .Margin(24),\n                        Grid()\n                            .ColDefs(ColDef, ColDef)\n                            .Row(1)\n                            .Childs(\n                                ToggleButton()\n                                    .Content(\"Toggle text visibility\")\n                                    .Command(ViewModel.ToggleTextVisibilityCommand)\n                                    .Column(0),\n                                TextBlock()\n                                    .Column(1)\n                                    .Foreground(Brushes.Red)\n                                    .VAlignCenter()\n                                    .HAlignCenter()\n                                    .Text(\"Some additional text\")\n                                    .Bind(\n                                        VisibilityProperty, \n                                        Binding(nameof(ViewModel.AdditionalTextVisible), Converters.BoolToVisibilityConverter))),\n                        TextBox()\n                            .FocusStyleNone()\n                            .Margin(24, 0, 24, 0)\n                            .Border(1)\n                            .BorderBrush(Black)\n                            .Wrap()\n                            .Row(2)\n                            .Font(\"SegoeUI\")\n                            .FontSize(14)\n                            .ReadOnly()\n                            .Text(\"SOme text\")\n                            .VScrollAuto()\n                            .HScrollAuto(),\n                        Grid()\n                            .Row(3)\n                            .ColDefs(ColDef, ColDef)\n                            .Childs(\n                                Button()\n                                    .Content(\"ACTION\")\n                                    .Name(\"ActionButton\")\n                                    .Style(_accentDialogButtonStyle)\n                                    .Height(32)\n                                    .Width(145)\n                                    .HAlignRight()\n                                    .Column(0)\n                                    .Margin(24, 24, 3, 24)\n                                    .Command(ViewModel.ActionCommand),\n                                Button()\n                                    .Content(\"EXIT\")\n                                    .Name(\"ExitButton\")\n                                    .Style(_dialogButtonStyle)\n                                    .Height(32)\n                                    .Width(145)\n                                    .HAlignLeft()\n                                    .Column(1)\n                                    .Margin(3, 24, 24, 24)\n                                    .Command(ViewModel.ExitCommand))));\n```\n\n---\n\n## Control template definition example\n```csharp\n\tControlTemplate DialogButtonTemplate = new ControlTemplate\n        {\n            TargetType = typeof(Button),\n            VisualTree =\n                BorderElement()\n                    .Background(new TemplateBindingExtension(BackgroundProperty))\n                    .BorderThickness(new TemplateBindingExtension(BorderThicknessProperty))\n                    .BorderBrush(new TemplateBindingExtension(BorderBrushProperty))\n                    .Childs(\n                        BorderElement()\n                            .Childs(\n                                ContentPresenter()\n                                    .SetPropValue(HorizontalAlignmentProperty, HorizontalAlignment.Center)\n                                    .SetPropValue(VerticalAlignmentProperty, VerticalAlignment.Center)))\n                    .Factory\n        };\n```\n---\n\n## Style definition example\n```csharp\nStyle DialogButtonStyle = \n            Style()\n                .Setters(\n                    SnapsToPixels(true),\n                    FontSize(14),\n                    FontFamily(\"SegoeUI\"),\n                    FontWeight(FontWeights.Normal),\n                    FontStyle(FontStyles.Normal),\n                    Foreground(_buttonForegroundBrush),\n                    BorderThickness(2),\n                    BorderBrush(_buttonBorderBrush),\n                    Background(_buttonBorderBrush),\n                    Template(DialogButtonTemplate))\n                .Triggers(_mouseOverTrigger, _pressedTrigger);\n```\n---\n\n## Simple converter example\n```csharp\n    public class BoolToVisibilityConverter : ConverterBase\u003cbool, Visibility\u003e\n    {\n        public override Visibility Convert(bool value, CultureInfo culture) =\u003e value ? Visibility.Visible : Visibility.Hidden;\n\n        public override bool ConvertBack(Visibility value, CultureInfo culture) =\u003e value == Visibility.Visible;\n    }\n```\n---\n\n## Simple FP-style converter example\n```csharp\n    FunctionalConverter\u003cbool, Visibility\u003e InvertBoolToVisibilityConverter = \n        new FunctionalConverter\u003cbool, Visibility\u003e(\n            convert: (value, culture) =\u003e value ? Visibility.Hidden : Visibility.Visible,\n            convertBack: (value, culture) =\u003e value != Visibility.Visible);\n```\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoomviruz%2Fuiext.markup.wpf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoomviruz%2Fuiext.markup.wpf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoomviruz%2Fuiext.markup.wpf/lists"}