{"id":19175022,"url":"https://github.com/StackWM/Stack.Widgets","last_synced_at":"2026-06-20T07:30:19.204Z","repository":{"id":44418000,"uuid":"131921181","full_name":"losttech/Stack.Widgets","owner":"losttech","description":"A collection of widgets for Stack","archived":false,"fork":false,"pushed_at":"2022-12-08T20:25:57.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-04T01:41:59.744Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/losttech.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}},"created_at":"2018-05-03T00:42:33.000Z","updated_at":"2022-12-14T22:49:57.000Z","dependencies_parsed_at":"2023-01-25T07:46:23.445Z","dependency_job_id":null,"html_url":"https://github.com/losttech/Stack.Widgets","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/losttech%2FStack.Widgets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losttech%2FStack.Widgets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losttech%2FStack.Widgets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losttech%2FStack.Widgets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/losttech","download_url":"https://codeload.github.com/losttech/Stack.Widgets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240254181,"owners_count":19772386,"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":[],"created_at":"2024-11-09T10:20:28.758Z","updated_at":"2026-06-20T07:30:19.152Z","avatar_url":"https://github.com/losttech.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stack.Widgets\nA collection of widgets for Stack\n\n- [Widgets](#widgets)\n  - [Usage](#usage)\n  - [WebView](#webview)\n  - [Underlay](#underlay)\n- [Data Sources](#data-sources)\n  - [Usage](#usage)\n  - [WebDataSource](#webdatasource)\n  - [RefreshableDataSource](#refreshabledatasource)\n  - [Refreshable data sources](#refreshable-data-sources)\n- [Parsers and data binding](docs/DataBinding.md)\n- [Samples](http://stack.blogs.losttech.software/Inline-Widgets/)\n\n# Widgets\n## Usage\nRequires Stack v2.1+ (release planned for the end of June 2018).\n\nReference widgets library in your layout like this:\n```xml\nxmlns:widgets=\"clr-namespace:LostTech.Stack.Widgets;assembly=LostTech.Stack.Widgets\"\n```\n\nInsert your widget(s):\n```xml\n\u003cwidgets:__SOME__WIDGET__ ...\u003e\u003c/widgets:__SOME__WIDGET__\u003e\n```\n\n## WebView\nExample:\n```xml\n\u003cwidgets:WebView URL=\"https://detectmybrowser.com/\"/\u003e\n```\n\n**URL** (bindable, *OneWay*) - get or set the URL to display\n\nCurrent version uses IE engine.\n\n## Underlay\n\nThere's an easy way to hide widgets from layout grid, when you are dragging a window:\n```xml\n\u003cwidgets:__WIDGET__ ... zones:Layout.IsUnderlay=\"True\" .../\u003e\n```\n\nSetting this will automatically hide your widget from the dragging overlay. Note, this setting is an opposite of **IsHint**, which shows element only in the overlay.\n\n# Data Sources\nThese are helpful if you want to create custom inline widgets inside your layout. Together with parsers (see [data binding](docs/DataBinding.md)), they allow to build complex data display for virtually any information source you could imagine.\n\n## Usage\nRequires Stack v2.1+\n\nAdd a reference to out of box data sources in your layout:\n```xml\nxmlns:sources=\"clr-namespace:LostTech.Stack.Widgets.DataSources;assembly=LostTech.Stack.Widgets\"\n```\n\nIf its not already there, add ```\u003c*.Resources\u003e``` section to your layout's root.\nAdd your data source to ```Resouces``` section.\n\nFor example:\n```xml\n\u003cGrid\n  ...\n  xmlns:...\n  xmlns:...\n  ...\n\u003e\n  \u003cGrid.Resources\u003e\n    \u003csources:__SOME_DATA_SOURCE__ x:Key=\"MySource\" \n              ...\n              /\u003e  \n  \u003c/Grid.Resources\u003e\n  ...\n\u003c/Grid\u003e\n```\n\n## WebDataSource\n```WebDataSource``` allows you to fetch data from the Internet. Can refresh data automatically, if the remote source provides expiration information (see ```Expiration``` below). This data source is *Refreshable* (see below).\n### Settable properties\n**Url** (bindable, **required**) - sets the URL to fetch data from.\n\nExample: ```Url=\"https://www.hanselman.com/blog/SyndicationService.asmx/GetAtom\"```\n\nNotes: ```WebDataSource``` does not currently provide any authentication mechanisms. So either the ```Url``` must be unauthenticated, or the authentication information must be passed in the ```Url``` itself.\n### Provided data\n**Content**: ```string``` (bindable, optional) - provides the text, retrieved from the data request. Usually, it will be JSON, XML or HTML. Returns ```null``` if the last request was not successful.\n\n**ContentTimestamp**: ```DateTime``` (bindable) - provides the time, when the ```Content``` property was last updated.\n\n**Error**: ```Exception``` (bindable, optional) - a network error, if any. Set to ```null``` if data source received valid, but possibly unsuccessful response from the server. Most useful is its ```Message``` property.\n\n**Expiration**: ```DateTime?``` (bindable, optional) - if a successful response was received, and server provided expiration time in it, it will be reflected in this property. By default, when this time will come, ```WebDataSource``` will refresh itself.\n\n**Response***: [HttpResponseMessage](https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage) (bindable, optional, *OneWay*) - if any response was received (see ```Error``` above otherwise), this will contain .NET standard response object. \n\nIts most common properties are [IsSuccessStatusCode](https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage.issuccessstatuscode), that indicates, if request was succesfully processed, and [StatusCode](https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage.statuscode), that returns corresponding HTTP status code.\n\n## RefreshableDataSource\n```RefreshableDataSource``` is actually just a wrapper for other data sources, or .NET properties. It enables periodic refresh of data from the source, even if the source does not update automatically. Hense, this data source is *Refreshable*.\n\n### Example\nIn this example we create a data source from a static .NET [DateTime.Now](https://docs.microsoft.com/en-us/dotnet/api/system.datetime.now) property. ```RefreshableDataSource``` wrapping is required, because ```DateTime.Now``` does not raise any change events, so UI does not know when to update it. We set the refresh interval to 1 second.\n```xml\n\u003csources:RefreshableDataSource x:Key=\"TimeSource\" \n         Source=\"{c:Binding sys:DateTime.Now}\"\n         sources:DataSource.RefreshInterval=\"0:0:1\"\n         /\u003e\n...\n\u003cTextBlock Text=\"{Binding Source, Source={StaticResource TimeSource}, Mode=OneWay}\"/\u003e\n```\n### Settable properties\n**Source** (bindable, **required**) - sets the source property to get the data from. The same property is used to retrieve the data.\n**DataSource.RefreshInterval** (bindable, **required**) - sets the refresh interval. This property can actually be set on any *Refreshable* data source, see below.\n### Provided data\n**Source** (bindable) - gets the data from the wrapped data source.\n\n## Refreshable data sources\nSome data sources (currently - all out of box ones) are *refreshable*. They implement ```IRefreshable``` interface, which provides a ```RefreshCommand```, that can be executed to refresh data. For example:\n```xml\n\u003cButton Command=\"{Binding RefreshCommand, Source={StaticResource SOME_REFRESHABLE_DATASOURCE}}\"\u003eRefresh!\u003c/Button\u003e\n```\nThe following property can be set to update them at regular intervals:\n\n**DataSource.RefreshInterval** (bindable) - sets the refresh interval.\n\n## Samples\nSample inline widgets are demostrated in the [blog post](http://stack.blogs.losttech.software/Inline-Widgets/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStackWM%2FStack.Widgets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStackWM%2FStack.Widgets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStackWM%2FStack.Widgets/lists"}