diff --git a/README.md b/README.md index b20c98c..a7e5284 100644 --- a/README.md +++ b/README.md @@ -1 +1,72 @@ -**[View document in Syncfusion Xamarin Knowledge base](https://www.syncfusion.com/kb/12246/how-to-customize-the-item-template-in-an-unbound-xamarin-forms-treeview-sftreeview)** +# customize-the-itemtemplate-unbound-treeview-xamarin + +This repository demonstrates how to customize the item template in an unbound Xamarin.Forms TreeView (SfTreeView) control. It provides a sample implementation that shows how to define and style TreeView nodes directly in XAML without data binding, enabling flexible and visually distinct hierarchical layouts. + +## Sample + +### XAML +```xaml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + +### TextColorConverter +```csharp +public class TextColorConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + var level = (int)value; + if (level == 0) return Color.Red; + else if (level == 1) return Color.Blue; + else return Color.Green; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } +} +``` + +## Requirements to run the demo + +To run the demo, refer to [System Requirements for Xamarin](https://help.syncfusion.com/xamarin/system-requirements) + +## Troubleshooting +### Path too long exception +If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project.