private bool ExpandToSelection(SfTreeView tree, TreeViewNodeCollection nodes, object model)
 {
     foreach (var node in nodes)
     {
         if ((node.Content as FileManager).ItemName == (model as FileManager).ItemName)
         {
             var parent = node.ParentNode;
             while (parent != null)
             {
                 tree.ExpandNode(parent);
                 parent = parent.ParentNode;
             }
             return(true);
         }
     }
     foreach (var node in nodes)
     {
         if (node.HasChildNodes)
         {
             var found = ExpandToSelection(tree, node.ChildNodes, model);
             if (found)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Beispiel #2
0
 protected override void OnAttachedTo(ContentPage bindable)
 {
     TreeView        = bindable.FindByName <SfTreeView>("treeView");
     Button          = bindable.FindByName <Button>("button");
     Button.Clicked += Button_Clicked;
     base.OnAttachedTo(bindable);
 }
Beispiel #3
0
 protected override void OnDetachingFrom(ContentPage bindable)
 {
     Button.Clicked -= BringIntoView_Clicked;
     Button          = null;
     TreeView        = null;
     base.OnDetachingFrom(bindable);
 }
Beispiel #4
0
 public void Dispose()
 {
     if (treeView != null)
     {
         treeView.Dispose();
         treeView = null;
     }
 }
Beispiel #5
0
 public TreeGettingStarted()
 {
     treeView  = new SfTreeView();
     viewModel = new FoodSpeciesViewModel();
     treeView.AutoExpandMode     = AutoExpandMode.AllNodesExpanded;
     treeView.ExpandActionTarget = ExpandActionTarget.Node;
     treeView.ChildPropertyName  = "Species";
     treeView.ItemsSource        = viewModel.SpeciesType;
     treeView.Adapter            = new GettingStartedAdapter();
     this.AddSubview(treeView);
 }
Beispiel #6
0
 public override Android.Views.View GetSampleContent(Android.Content.Context context)
 {
     treeView  = new SfTreeView(context, null);
     viewModel = new FoodSpeciesViewModel();
     treeView.FullRowSelect      = true;
     treeView.AutoExpandMode     = AutoExpandMode.AllNodesExpanded;
     treeView.ExpandActionTarget = ExpandActionTarget.Node;
     treeView.ChildPropertyName  = "Species";
     treeView.ItemsSource        = viewModel.SpeciesType;
     treeView.Adapter            = new GettingStartedAdapter();
     return(treeView);
 }
Beispiel #7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);
            SfTreeView          treeView  = FindViewById <SfTreeView>(Resource.Id.sfTreeView1);
            MusicInfoRepository viewModel = new MusicInfoRepository();

            treeView.LoadOnDemand += TreeView_LoadOnDemandEvent;
            treeView.ItemsSource   = viewModel.Menu;
            treeView.Adapter       = new NodeImageAdapter();
        }
 public override Android.Views.View GetSampleContent(Android.Content.Context context)
 {
     treeView                   = new SfTreeView(context, null);
     viewModel                  = new FileManagerViewModel();
     treeView.Indentation       = 20;
     treeView.ExpanderWidth     = 40;
     treeView.ItemHeight        = 45;
     treeView.AutoExpandMode    = AutoExpandMode.AllNodesExpanded;
     treeView.ChildPropertyName = "SubFolder";
     treeView.ItemsSource       = viewModel.Folders;
     treeView.Adapter           = new NodeImageAdapter();
     return(treeView);
 }
Beispiel #9
0
 public NodeWithImage()
 {
     treeView                   = new SfTreeView();
     viewModel                  = new FileManagerViewModel();
     treeView.Indentation       = 20;
     treeView.ExpanderWidth     = 40;
     treeView.ItemHeight        = 40;
     treeView.AutoExpandMode    = AutoExpandMode.AllNodesExpanded;
     treeView.ChildPropertyName = "SubFolder";
     treeView.ItemsSource       = viewModel.Folders;
     treeView.Adapter           = new NodeImageAdapter();
     this.AddSubview(treeView);
 }
Beispiel #10
0
 public NodeImageView(Context context, SfTreeView treeView) : base(context)
 {
     view             = treeView;
     this.Orientation = Orientation.Horizontal;
     label1           = new ContentLabel(context);
     label1.Gravity   = GravityFlags.CenterVertical;
     if (view.LayoutDirection == Android.Views.LayoutDirection.Rtl)
     {
         label1.TextDirection = TextDirection.Rtl;
     }
     imageIcon = new ImageViewExt(context);
     this.AddView(imageIcon);
     this.AddView(label1);
 }
Beispiel #11
0
 public TreeTemplate()
 {
     treeView  = new SfTreeView();
     viewModel = new MailFolderViewModel();
     treeView.FullRowSelect     = true;
     treeView.Indentation       = 20;
     treeView.ExpanderWidth     = 0;
     treeView.ItemHeight        = 40;
     treeView.AutoExpandMode    = AutoExpandMode.AllNodesExpanded;
     treeView.ChildPropertyName = "SubFolder";
     treeView.ItemsSource       = viewModel.Folders;
     treeView.Adapter           = new TemplateAdapter();
     this.AddSubview(treeView);
 }
Beispiel #12
0
 public override Android.Views.View GetSampleContent(Android.Content.Context context)
 {
     treeView                   = new SfTreeView(context, null);
     viewModel                  = new CountriesViewModel();
     treeView.Indentation       = 20;
     treeView.ExpanderWidth     = 40;
     treeView.ItemHeight        = 40;
     treeView.SelectionMode     = SelectionMode.Multiple;
     treeView.AutoExpandMode    = AutoExpandMode.RootNodesExpanded;
     treeView.ChildPropertyName = "States";
     treeView.ItemsSource       = viewModel.CountriesInfo;
     treeView.Adapter           = new SelectionAdapter();
     treeView.SelectedItems     = viewModel.SelectedCountries;
     return(treeView);
 }
Beispiel #13
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);
            SfTreeView           treeView  = FindViewById <SfTreeView>(Resource.Id.sfTreeView1);
            FileManagerViewModel viewModel = new FileManagerViewModel();

            // You can also change layout direction of treeview by changing device layout direction
            treeView.LayoutDirection   = Android.Views.LayoutDirection.Rtl;
            treeView.AutoExpandMode    = AutoExpandMode.RootNodesExpanded;
            treeView.ChildPropertyName = "SubFiles";
            treeView.ItemsSource       = viewModel.Folders;
            treeView.Adapter           = new CustomAdapter();
        }
Beispiel #14
0
        private void ExecuteClickAction(object obj)
        {
            var loadingBtn = obj as Button;

            loadingBtn.Visibility = Visibility.Collapsed;

            BackgroundWorker backgroundWorker = new BackgroundWorker();

            backgroundWorker.DoWork             += BackgroundWorker_DoWork;
            backgroundWorker.RunWorkerCompleted += BackgroundWorker_RunWorkerCompleted;
            backgroundWorker.RunWorkerAsync();
            treeView             = Application.Current.MainWindow.FindName("treeView") as SfTreeView;
            busyIndicator        = Application.Current.MainWindow.FindName("loadingIndicator") as SfBusyIndicator;
            busyIndicator.IsBusy = true;
        }
 public NodeImageView(SfTreeView treeView)
 {
     view   = treeView;
     label1 = new UILabel();
     if (GetUserInterfaceLayoutDirection(view.SemanticContentAttribute) == UIUserInterfaceLayoutDirection.RightToLeft)
     {
         label1.TextAlignment = UITextAlignment.Right;
     }
     imageIcon = new UIImageView();
     imageIcon.ClipsToBounds = true;
     imageIcon.AdjustsImageSizeForAccessibilityContentSizeCategory = true;
     imageIcon.InsetsLayoutMarginsFromSafeArea = true;
     this.AddSubview(imageIcon);
     this.AddSubview(label1);
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.BackgroundColor = UIColor.White;
            SfTreeView treeView = new SfTreeView(View.Bounds);

            treeView.SemanticContentAttribute = UISemanticContentAttribute.ForceRightToLeft;
            FileManagerViewModel viewModel = new FileManagerViewModel();

            treeView.AutoExpandMode    = Syncfusion.TreeView.Engine.AutoExpandMode.RootNodesExpanded;
            treeView.ChildPropertyName = "SubFiles";
            treeView.ItemsSource       = viewModel.Folders;
            treeView.Adapter           = new NodeImageAdapter();
            // Perform any additional setup after loading the view
            Add(treeView);
        }
Beispiel #17
0
 public TreeSelection()
 {
     treeView                   = new SfTreeView();
     viewModel                  = new CountriesViewModel();
     treeView.Indentation       = 20;
     treeView.ExpanderWidth     = 40;
     treeView.ItemHeight        = 40;
     treeView.SelectionMode     = SelectionMode.Multiple;
     treeView.AutoExpandMode    = AutoExpandMode.AllNodesExpanded;
     treeView.ChildPropertyName = "States";
     treeView.ItemsSource       = viewModel.CountriesInfo;
     treeView.Adapter           = new SelectionAdapter();
     treeView.SelectedItems     = viewModel.SelectedCountries;
     this.AddSubview(treeView);
     this.OptionView = option;
 }
 protected override void OnAttachedTo(ContentPage bindable)
 {
     TreeView         = bindable.FindByName <SfTreeView>("treeView");
     TreeView.Loaded += TreeView_Loaded;
     base.OnAttachedTo(bindable);
 }
 protected override void OnAttachedTo(ContentPage bindable)
 {
     base.OnAttachedTo(bindable);
     treeView              = bindable.FindByName <SfTreeView>("treeView");
     treeView.ItemHolding += TreeView_ItemHolding;
 }
 protected override void OnDetachingFrom(ContentPage bindable)
 {
     TreeView.Loaded -= TreeView_Loaded;
     TreeView         = null;
     base.OnDetachingFrom(bindable);
 }
Beispiel #21
0
 public GettingStatred()
 {
     InitializeComponent();
     TreeView = treeView;
 }