Hello Zhonghai,
Building a complete custom application falls outside the
scope of support, we have partners that can do this, contacts the folks at
Custom App Development. I can, however, provide you with some tips and resources to build this out and accomplish your goals.
I recommend starting with the Xamarin.Forms
Master-Detail project template (File > New > Xamarin.Forms > MasterDetail), that way you already have a NavigationPage as the root. You can then put the RadTreeView in the MasterPage.
Then in the MenuPage.xaml, you can replace the ListView with the TreeView
01. TreeVIew as navigation menu
You are in complete control over the items that are presented in the TreeView. See SourceCollection property in this documentation:
Getting Started. As you can see, you can define your data model as you see fit.
Using the plain XamarinForms MasterDetail template as an example, you can replace the ListView in MenuPage.xaml with the RadTreeView
02. Click leaf node to open a content page for text edit (save and cancel)
The TreeView has an
ItemTapped event,
In the tapped event you can get a reference to
the tapped item.
The code above is continuing on with the plain Xamarin Master-Detail example.
03. Be able to mark a leaf node as done, if all leaf nodes are marked as done, their parent should be marked as done as well.
I'm not sure how this relates to Page navigation. But to get this functionality, you have two options,
1 - Use the built-in checkbox elements as an identifier for the "Done" value, with which you can also use the
CheckBoxMode Propagate. See this documentation:
Checkbox Element.
2 - Build a custom approach by adding an IsDone property to your model and defining a completely custom ItemTemplate (as seen in the TreeView Flags examples)
To toggle the IsDone value, you can do this from anywhere in the application that has access to that item. For example, the TreeView has
ItemHold event,
In which you could
toggle that IsDone value:
04. be able to search the nodes
This is not a feature of the TreeView. If you want to search the items, just search the bound collection itself using regular C# techniques.
For example, if the bound items were names "MenuItems, then you can us LINQ to find a match:
To give you a head start, I've attached a plain Xamarin.Forms MasterDetail project with the ListView swapped out for a TreeView. See MenuPage.xaml and MenuPage.xaml.cs for the relevant logic.
Further Assistance
If you have any problems with specific TreeView features, please
open a Support Ticket here and
attach the code you're using so that the TreeView support team can assist further. Keep in mind that custom development requests for unrelated features are out of scope, but they'll be able to help with any TreeView specific property or feature (things like selection, templates, etc).
I hope I was able your questions.
Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items