This library contains WinUI3 elements for textual diffs.
using DiffPlex.UI;
And insert following code into the root node of your xaml file.
xmlns:diffplex="using:DiffPlex.UI"
Class DiffTextView
is used to render textual diffs by setting new text and old text.
<diffplex:DiffTextView x:Name="DiffView" />
DiffView.SetText(oldText, newText);
And you can switch to split view or unified view by setting IsSplitView
member property with a boolean value.
You can create a window with the above element to show.
var window = new DiffTextWindow
{
Title = windowTitle
};
window.Activate();
window.SetText(oldText, newText);