示例#1
0
        public BindViewModel CreateNewBind()
        {
            BindViewModel result = new BindViewModel();

            Binds.Add(result);
            OnPropertyChanged("Binds");
            return(result);
        }
示例#2
0
 public VMRecyclerAdapter(Context Context, ObservableCollection <T> Collection, int ItemLayoutId, BindEvents BindEvents, BindViewModel BindViewModel)
     : base()
 {
     this.context       = Context;
     this.Collection    = Collection;
     this.itemLayoutId  = ItemLayoutId;
     this.bindEvents    = BindEvents;
     this.bindViewModel = BindViewModel;
 }
示例#3
0
        public void OpenBindsInPath(string path)
        {
            LastPath = path;
            ClearBinds();
            Bind[] binds = JsonUtilities.Deserialize <Bind[]>(File.ReadAllText(LastPath));
            int    count = 0;
            var    temp  = new List <BindViewModel>();

            foreach (Bind b in binds)
            {
                var bindVM = new BindViewModel(b);
                temp.Add(bindVM);

                if (count++ % 5 == 0)
                {
                    temp.ForEach(bvm => Binds.Add(bvm)); OnPropertyChanged("Binds");
                    temp.Clear();
                }
            }
            temp.ForEach(bvm => Binds.Add(bvm)); OnPropertyChanged("Binds");
        }
示例#4
0
 public bool RemoveBind(BindViewModel toRemove)
 {
     toRemove.Bind.Dispose();
     OnPropertyChanged("Binds");
     return(Binds.Remove(toRemove));
 }
示例#5
0
 public BindControl(MainWindow mainWindow)
 {
     InitializeComponent();
     //  DataContext = null;
     DataContext = new BindViewModel(mainWindow);
 }