From b1e270d8bd41b9f107e101121476989586645f1b Mon Sep 17 00:00:00 2001 From: Santhosh-SF4792 Date: Sat, 6 Sep 2025 02:42:38 +0530 Subject: [PATCH 1/2] Update the README.md file --- README.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b20c98c..d575ea3 100644 --- a/README.md +++ b/README.md @@ -1 +1,76 @@ -**[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 +Visual Studio 2017 or Visual Studio for Mac. +Xamarin add-ons for Visual Studio (available via the Visual Studio installer). + +## 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. + +## License + +Syncfusion® has no liability for any damage or consequence that may arise from using or viewing the samples. The samples are for demonstrative purposes. If you choose to use or access the samples, you agree to not hold Syncfusion® liable, in any form, for any damage related to use, for accessing, or viewing the samples. By accessing, viewing, or seeing the samples, you acknowledge and agree Syncfusion®'s samples will not allow you seek injunctive relief in any form for any claim related to the sample. If you do not agree to this, do not view, access, utilize, or otherwise do anything with Syncfusion®'s samples. From 6ac00d78fbc7ec4bfb780d0b0ffb19ddc1e6eb39 Mon Sep 17 00:00:00 2001 From: Santhosh-SF4792 Date: Sun, 7 Sep 2025 23:00:20 +0530 Subject: [PATCH 2/2] license correction commit --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d575ea3..a7e5284 100644 --- a/README.md +++ b/README.md @@ -64,13 +64,9 @@ public class TextColorConverter : IValueConverter ``` ## Requirements to run the demo -Visual Studio 2017 or Visual Studio for Mac. -Xamarin add-ons for Visual Studio (available via the Visual Studio installer). + +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. - -## License - -Syncfusion® has no liability for any damage or consequence that may arise from using or viewing the samples. The samples are for demonstrative purposes. If you choose to use or access the samples, you agree to not hold Syncfusion® liable, in any form, for any damage related to use, for accessing, or viewing the samples. By accessing, viewing, or seeing the samples, you acknowledge and agree Syncfusion®'s samples will not allow you seek injunctive relief in any form for any claim related to the sample. If you do not agree to this, do not view, access, utilize, or otherwise do anything with Syncfusion®'s samples.