public BindViewModel CreateNewBind() { BindViewModel result = new BindViewModel(); Binds.Add(result); OnPropertyChanged("Binds"); return(result); }
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; }
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"); }
public bool RemoveBind(BindViewModel toRemove) { toRemove.Bind.Dispose(); OnPropertyChanged("Binds"); return(Binds.Remove(toRemove)); }
public BindControl(MainWindow mainWindow) { InitializeComponent(); // DataContext = null; DataContext = new BindViewModel(mainWindow); }