Exemplo n.º 1
0
 public MainWindow()
 {
     InitializeComponent();
     SelectionBehavior.Attach(innerCanvas);
     //ThemeManager.Theme = ColorThemes.DarkBlue;
     tb.Text = ThemeManager.Theme.ToString();
 }
Exemplo n.º 2
0
        public void Create()
        {
            var view = new ListView();
            var src  = new SelectionBehavior();

            src.Attach(view);
            src.Detach();
        }
Exemplo n.º 3
0
        public void Properties() => Create(vm =>
        {
            var view = new ListView {
                DataContext = vm
            };
            var src = new SelectionBehavior();

            src.Attach(view);
            Assert.That(src.Popup, Is.False);
            src.Detach();
        });
Exemplo n.º 4
0
        public void Create()
        {
            var view = new ListView();
            var src  = new SelectionBehavior();

            src.Attach(view);
            Assert.That(src.Popup, Is.False);
            src.Popup = true;
            Assert.That(src.Popup, Is.True);
            src.Detach();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ExtendedListView"/> class.
        /// </summary>
        public ExtendedListView()
        {
            // Creating the rows collection.
            this.Rows = new RowsCollection(this);

            // Creating the models.
            this.SelectionModel = new SelectionModel(this);
            this.CheckModel     = new CheckModel();
            this.ExpandModel    = new ExpandModel(this);

            // Creating the behaviors.
            this.mSelectionBehavior    = new SelectionBehavior(this);
            this.mExpandBehavior       = new ExpandBehavior(this);
            this.mColumnResizeBehavior = new ColumnResizeBehavior(this);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_example, container, false);
            this.listView = (RadListView) rootView.FindViewById(Resource.Id.listView).JavaCast<RadListView>();

            SelectionBehavior sb = new SelectionBehavior();

            for (int i = 0; i < 50; i++) {
                source.Add("Item " + i);
            }

            this.listView.AddBehavior(sb);

            this.listView.SetAdapter(new MyListViewAdapter(source));
            return rootView;
        }
Exemplo n.º 7
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_example, container, false);

            this.listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast <RadListView>();

            SelectionBehavior sb = new SelectionBehavior();

            for (int i = 0; i < 50; i++)
            {
                source.Add("Item " + i);
            }

            this.listView.AddBehavior(sb);

            this.listView.SetAdapter(new MyListViewAdapter(source));
            return(rootView);
        }
Exemplo n.º 8
0
 public void SetSelectionBehavior(SelectionBehavior behavior)
 {
     this.behavior = behavior;
 }
Exemplo n.º 9
0
        public void SelectProject(FileChangeProject proj, SelectionBehavior bhav)
        {
            switch (bhav)
            {
            case SelectionBehavior.AppendToggle:
                // append project selection, keep all just toggle this one
                if (proj != null)
                {
                    proj.Selected = !proj.Selected;
                }
                break;

            case SelectionBehavior.Append:
                // append project selection, keep all just toggle this one
                if (proj != null)
                {
                    proj.Selected = true;
                }
                break;

            case SelectionBehavior.Unselect:
                _unselectAllProjects();
                break;

            case SelectionBehavior.SelectOnly:
                _unselectAllProjects();
                if (proj != null)
                {
                    proj.Selected = true;
                }
                break;

            case SelectionBehavior.UnselectOnToggle:
                if (proj != null)
                {
                    // count visible, selected projects
                    int  nVisSel = this.ProjectCollection.Sum(p => p.Visible && p.Selected ? 1 : 0);
                    bool pState  = proj.Selected;
                    // unselect all others
                    _unselectAllProjects();
                    // > 1 project selected ? project selected  : toggle project
                    proj.Selected = nVisSel > 1 ? true : !pState;
                }
                else
                {
                    _unselectAllProjects();
                }

                break;

            case SelectionBehavior.UnselectToggle:
                if (proj != null)
                {
                    // unselect others
                    bool pState = proj.Selected;
                    _unselectAllProjects();
                    // toggle proj
                    proj.Selected = !pState;
                }
                else
                {
                    _unselectAllProjects();
                }

                break;
            }
        }
Exemplo n.º 10
0
 public PathFilterBase(UInt64 indiceOrd, SelectionBehavior selectionBehavior, string regex) //: base(tipoRegex: tipoRegex, regex: regex)
 {                                                                                          //Costruttore principale
     this.IndiceOrd         = indiceOrd;
     this.SelectionBehavior = selectionBehavior;
     //this.TipoAnalisi = tipoAnalisi;
 }
Exemplo n.º 11
0
    void Start()
    {
        selectionBehavior = transform.GetComponent<SelectionBehavior>();

        ActiveScrolling = ControllerToggleType.Equals(ControllerType.RealTimeStratToggle) && EnableMouseScroll;
    }
Exemplo n.º 12
0
 public void SetSelectionBehavior(SelectionBehavior behavior) => selection?.SetSelectionBehavior(behavior);