private void OnPointSelected(object sender, MouseButtonEventArgs e) { if (PointsList.SelectedIndex == -1) { return; } e.Handled = true; int pointID = DatabaseHandler.GetPointsList()[PointsList.SelectedIndex].id; string pointName = DatabaseHandler.GetPointsList()[PointsList.SelectedIndex].name; Frame frame = new Frame(); PointView view = new PointView(pointID); view.updater += UpdatePoint; frame.Content = view; if (isUsingTabs) { CreatePointTab(pointID, pointName, view, frame); } else { CreatePointWindow(pointID, pointName, view, frame); } PointsList.SelectedIndex = -1; //TODO Tell main window to select add and select tab }
public void UpdatePoint(int id, string name, int newType) { var point = DatabaseHandler.GetPointsList().Find(a => a.id == id); point.name = name; point.type = DatabaseHandler.GetPointType(newType); PointsList.Items.Refresh(); }
public ConnectPointWindow(int docID) { InitializeComponent(); this.docID = docID; changedIDs = new HashSet <int>(); AddCheckBoxColumn(); points = DatabaseHandler.GetPointsList(docID); ConnectedDataGrid.ItemsSource = points; }
public void UpdatePointTypes() { int selectedIndex = NewPointTypeCombo.SelectedIndex; NewPointTypeCombo.Items.Refresh(); NewPointTypeCombo.SelectedIndex = -1; NewPointTypeCombo.SelectedIndex = selectedIndex; DatabaseHandler.GetPointsList(true); PointsList.Items.Refresh(); }
public PointsPage(MainWindow mainWindow) { InitializeComponent(); //points.AddIndexes(); PointsList.ItemsSource = DatabaseHandler.GetPointsList(); this.mainWindow = mainWindow; //addhandler = AddPoint; NewPointTypeCombo.ItemsSource = DatabaseHandler.GetPointTypes(); NewPointTypeCombo.SelectedIndex = 0; if (!DatabaseHandler.userRole.Points.HasFlag(Permissions.INSERT)) { AddNewPointGrid.Visibility = Visibility.Collapsed; } }
public void UpdatePoints() { DatabaseHandler.GetPointsList(true); //points.Add(DatabaseHandler.GetNewPoint()); PointsList.Items.Refresh(); }