r/dotnet • • 15h ago

Promotion We've ported an open-source WPF TreeGrid control to OpenSilver so it can run cross-platform (live web demo)

13 Upvotes

Hi .NET friends,

We've ported the awesome WPF TreeGrid control by gulshan-verma to OpenSilver, so it can run cross-platform (web, win, mac, linux, android & ios).

It's a XAML hierarchical data grid that supports MVVM and comes with a ton of features. The attached video shows a few of them.

It's MIT-licensed, it runs fast, and you can test it in the dedicated online playground at:

https://xaml.io/TreeGrid

On that site, you can drag and drop the TreeGrid control, then select it to see all of its options. There are still a few glitches that we're working on resolving, but it should be production-ready by the end of the year.

The full source code, along with a demo app, is available in the "OpenSilverPort" branch of https://github.com/OpenSilver/tree-grid-wpf

Please do share your feedback, so we can improve the TreeGrid!

Thanks a lot!

EDIT: Someone asked how much of the original code was preserved when porting from WPF to OpenSilver: the vast majority of the original C#/XAML code was preserved. We think more than 99%. The code is shared and we used compiler directives (#if OPENSILVER). You can see the full list of changes in the following commit (note that most of the files listed here are either Markdown or CSPROJ files, while only very little C#/XAML code was modified): https://github.com/OpenSilver/tree-grid-wpf/commit/cce756b5ea6c3087da6c81373ccb85fa00ab0fcb


r/dotnet • • 2h ago

Promotion TantivyDotNet: embedded full-text search eninge for .NET on top of Tantivy (Rust), 1.0 RC

Post image
9 Upvotes
For a while I've wanted something between "LIKE '%foo%'" and running Elasticsearch next to my app, and the main in-process option in .NET is still Lucene.NET 4.8, which has been in beta for years. Tantivy is a Rust search library in the same spirit as Lucene, so I wrote a .NET binding for it.


It ships as one NuGet package with the native library for Windows x64, Linux x64/arm64 and macOS x64/arm64, so there's no Rust toolchain on your side. It targets .NET 10+ and works with trimming and NativeAOT.


    using var index = SearchIndex.Create("./index", new SchemaBuilder()
        .AddTextField("title", stored: true)
        .AddTextField("body", stored: true)
        .AddI64Field("year", fast: true)
        .Build());


    using (var writer = index.CreateWriter())
    {
        writer.AddDocument(new { title = "Of Mice and Men", body = "...", year = 1937 });
        writer.Commit();
    }


    using var searcher = index.CreateSearcher();
    var results = searcher.Search("mice AND men", new SearchOptions
    {
        OrderBy = [SortBy.Field("year", descending: true)],
        Snippets = new SnippetOptions("body"),
    });


You can use query strings or build queries in code, and there are facets, snippets, sorting with search-after paging, and Elasticsearch-style aggregations. For servers, a SearcherManager hands out one shared searcher and refreshes it after commits.


I benchmarked it against Lucene.NET on 215k Wikipedia articles (setup and caveats in the repo):

Indexing is 2-3x faster and most queries are 4-7x faster. Phrase queries are about 4% slower, and that's Tantivy itself: called directly from Rust it takes about the same time.


The API is frozen as of the release candidate, and 1.0 ships once it's gone a few weeks without changes. The first feedback already turned up a real bug (paging cursors misbehaved after the index merged), fixed in rc.2. If something in the API looks off to you, now is when I can still change it.


    dotnet add package TantivyDotNet --prerelease


Repo: https://github.com/aminparsa18/TantivyDotNet
Docs: https://aminparsa18.github.io/TantivyDotNet/

r/dotnet • • 11h ago

Promotion I've been building my own modular Discord bot framework in C# -- OpenBot

Thumbnail github.com
1 Upvotes

I've been working on a framework to make Discord bots fully modular, with a full framework. It works with "modules" which are part of the core bot itself and are required, and "extensions" which can be drag and dropped in to the bot's directory to add functionality.

I made (it's still in early development) this to solve a problem which I think everyone has experienced - they need a butt load of bots in their Discord server for all their different requirements.

It's open source, and I'm at the point where I'm starting to try to get it out there and would genuinely appreciate other .NET developers checking it out. Thanks.


r/dotnet • • 23m ago

Promotion Sharp cli

Post image
0 Upvotes

Want to learn how a C# compiler works? sharp CLI is 19k C# lines vs 722k in the MSBuild repo. The whole sharp SDK is just one Native AOT executable: no installed SDK or MSBuild needed. Compiling our own code results in these timings: dotnet build 4.2s, sharp build 2.0s.


r/dotnet • • 6h ago

Promotion Unknot Code - a local-first codebase visualiser for code reviewers and editors

0 Upvotes

Hi all, Have you guys ever felt lost when reviewing/reading huge code bases? You reach somewhere skimming through code, jumped between files and methods, but it seems nowhere?
 You are diving deep into function definitions but lost track where you came from?
Hard to understand the downstream impacts due to a change?

Keeping all this in mind I built Unknot Code, a local-first codebase visualiser. Myself and my colleagues at work have been using it for past 2 month and feels incredible. Current version supports only #csharp and #python projects. TypeScript and Java planned next.

  • Works offline, so code stays within your machine.
  • Optional local AI code explanation, so small doubts doesn’t are sorted here itself [only if you have extra compute to burn].
  • Dedicated code review mode to help understand impacts and touch points.
  • Git diff mode to track changes.
  • Easy navigation and visualisation
  • Auto updates provided
  • No cost

And more.

https://www.unknotcode.com - check this out ! You can play around with it here.

Would genuinely love your feedbacks.


r/dotnet • • 1h ago

Introducing XLIDE: VBIDE - Official Full Release (Version 1.0)

Thumbnail youtube.com
0 Upvotes

r/dotnet • • 4h ago

Promotion I've created a Visual Studio add-in that uses GnuCOBOL as its back end

Thumbnail github.com
0 Upvotes