Ejemplo n.º 1
0
        void DataGrid_CellTapped(object sender, GridCellTappedEventArgs e)
        {
            if (DataContext is SelectInspectionSummaryViewModel context)
            {
                if (!(e.Record is PublishedAction pAction))
                {
                    return;
                }

                /*if (pAction.IsGroup)
                 *  return;*/
                /*if (pAction.LinkedPublication != null)
                 * {
                 *  int rowIndex = DataGrid.ResolveToRowIndex(pAction);
                 *  int recordIndex = DataGrid.ResolveToRecordIndex(rowIndex);
                 *  if (recordIndex < 0)
                 *      return;
                 *  if (DataGrid.View.Records[recordIndex].IsExpanded)
                 *      DataGrid.CollapseDetailsViewAt(recordIndex);
                 *  else
                 *      DataGrid.ExpandDetailsViewAt(recordIndex);
                 *  return;
                 * }
                 * context.IndexParent = null;*/
                context.PublishedAction = pAction;
                context.ShowStepCommand.Execute(pAction);
            }
        }
Ejemplo n.º 2
0
        private void ServerDataGrid_OnCellTapped(object sender, GridCellTappedEventArgs e)
        {
            if (e.ChangedButton != MouseButton.Left)
            {
                return;
            }

            if (ServerDataGrid.CurrentColumn != null && ServerDataGrid.SelectedItem is Server server)
            {
                var index       = server.Index - 1;
                var mappingName = ServerDataGrid.CurrentColumn.MappingName;
                if (mappingName == Resources[@"ServerMappingName"].ToString())
                {
                    _controller.DisconnectAllConnections(true);
                    _controller.SelectServerIndex(index);
                }
                else if (mappingName == Resources[@"GroupMappingName"].ToString())
                {
                    var group = server.Group;
                    if (!string.IsNullOrEmpty(group))
                    {
                        var enable = !server.Enable;
                        foreach (var sameGroupServer in ServerLogViewModel.ServersCollection)
                        {
                            if (sameGroupServer.Group == group)
                            {
                                sameGroupServer.Enable = enable;
                            }
                        }
                        _controller.Save();
                    }
                }
            }
        }
Ejemplo n.º 3
0
        void DataGrid_CellTapped(object sender, GridCellTappedEventArgs e)
        {
            if (DataContext is FormationViewModel context)
            {
                PublishedAction pAction = e.Record as PublishedAction;
                if (pAction == null)
                {
                    return;
                }

                /*if (pAction.IsGroup)
                 *  return;*/

                /*if (pAction.LinkedPublication != null)
                 * {
                 *  int rowIndex = DataGrid.ResolveToRowIndex(pAction);
                 *  int recordIndex = DataGrid.ResolveToRecordIndex(rowIndex);
                 *  if (recordIndex < 0)
                 *      return;
                 *  if (DataGrid.View.Records[recordIndex].IsExpanded)
                 *      DataGrid.CollapseDetailsViewAt(recordIndex);
                 *  else
                 *      DataGrid.ExpandDetailsViewAt(recordIndex);
                 * }
                 * else
                 * {
                 *  Locator.Main.IsLoading = true;
                 *
                 *  try
                 *  {
                 *      PublishedAction action = context.Publication.PublishedActions.FirstOrDefault(p => p.PublishedActionId == pAction.PublishedActionId);
                 *
                 *      context.IndexParent = null;
                 *      context.Index = context.Publication.PublishedActions.IndexOf(action);
                 *
                 *      context.PublishedAction = action;
                 *
                 *      await Locator.Navigation.PushDialog<FormationActionDetailsDialog, FormationViewModel>(context);
                 *  }
                 *  catch (Exception ex)
                 *  {
                 *      Locator.TraceManager.TraceError(ex, "Erreur lors de la sélection d'une action dans la formation.");
                 *  }
                 *  finally
                 *  {
                 *      Locator.Main.IsLoading = false;
                 *  }
                 * }*/
                context.PublishedAction = pAction;
                context.ShowStepCommand.Execute(pAction);
            }
        }
Ejemplo n.º 4
0
        void DataGrid_OnCellTapped(object sender, GridCellTappedEventArgs e)
        {
            if (!(DataContext is InspectionScheduledViewModel context))
            {
                return;
            }

            if (!(e.Record is InspectionSchedule inspectionSchedule) || inspectionSchedule.IsClosed)
            {
                return;
            }

            context.SelectInspectionCommand.Execute(inspectionSchedule);
        }
Ejemplo n.º 5
0
        void DetailsViewDataGrid_CellTapped(object sender, GridCellTappedEventArgs e)
        {
            if (DataContext is SelectInspectionSummaryViewModel context)
            {
                if (!(e.Record is PublishedAction pAction))
                {
                    return;
                }

                /*if (pAction.IsGroup)
                 *  return;*/
                /*var parentPublishedAction = context.Publication.PublishedActions.First(_ => _.LinkedPublication != null && _.LinkedPublication.PublishedActions.Contains(pAction));
                 * context.IndexParent = context.Publication.PublishedActions.IndexOf(parentPublishedAction);*/
                context.PublishedAction = pAction;
                context.ShowStepCommand.Execute(pAction);
            }
        }
Ejemplo n.º 6
0
 void DetailsViewDataGrid_CellTapped(object sender, GridCellTappedEventArgs e)
 {
     if (DataContext is QualificationViewModel context)
     {
         PublishedAction pAction = e.Record as PublishedAction;
         if (pAction == null)
         {
             return;
         }
         if (pAction.IsGroup)
         {
             return;
         }
         context.PublishedAction = pAction;
         context.ShowStepCommand.Execute(pAction);
     }
 }
        private void dataGrid_CellTapped(object sender, GridCellTappedEventArgs e)
        {
            int columnIndex = e.RowColumnIndex.ColumnIndex;

            if (columnIndex == 0)
            {
                return;
            }

            var record = e.Record;

            TimeTableViewModel vm = DataContext as TimeTableViewModel;

            if ((record as table).tiet[columnIndex - 1] != null)
            {
                vm.selectedUsingClassID = (record as table).tiet[columnIndex - 1].Item1;
            }
            else
            {
                vm.selectedUsingClassID = "";
            }
        }