From 1ab3b0dca8aea5baaec517eb1e78b31bedf3b431 Mon Sep 17 00:00:00 2001 From: Sreemon Premkumar M Date: Fri, 22 Aug 2025 17:17:38 +0530 Subject: [PATCH] ES-975464 - Resolve the ReadMe issue in this sample repository --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c74cdc2..d517d69 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,44 @@ -# How to customize the style of tree nodes based on its level using converter in wpf treeview? -This repository describes how to customize the style of tree nodes based on its level using converter in wpf treeview +# How to customize the style of tree nodes based on its level using converter in WPF TreeView + +This repository describes how to customize the style of tree nodes based on its level using converter in [WPF TreeView](https://www.syncfusion.com/wpf-controls/treeview) (SfTreeView). + +The TreeView allows you to customize the style of [TreeViewItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeView.TreeViewItem.html) based on different levels by using [IValueConverter](https://docs.microsoft.com/en-us/dotnet/api/system.windows.data.ivalueconverter?view=netcore-3.1). + +#### XAML + +``` xml + + + + + + + + + + + + + + + +``` +#### C# + +``` csharp +public class FontAttributeConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + var level = (int)value; + return level == 0 ? FontWeights.Bold : FontWeights.Regular; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } +} +``` \ No newline at end of file