示例#1
0
 private void InitializeCommands()
 {
     SaveCommand = new RelayCommand(() =>
     {
         Line.Client   = Client;
         Line.ClientId = Client.ClientId;
         Line.Status   = CRMServiceReference.LineStatus.available;
         if (SelectedLine.LineId == 0)
         {
             _lineService.AddLine(Line, SelectedNumbers);
         }
         else
         {
             _lineService.UpdateLine(SelectedLine.LineId, Line, SelectedNumbers);
         }
     });
     ClearCommand = new RelayCommand(() =>
     {
         Line            = null;
         SelectedNumbers = null;
         SelectedLine    = null;
         RaisePropertyChanged(nameof(Line));
         RaisePropertyChanged(nameof(SelectedNumbers));
         RaisePropertyChanged(nameof(SelectedLine));
     });
     DeleteCommand = new RelayCommand(() =>
     {
         _lineService.DeleteLine(SelectedLine);
     });
     GoBackCommand = new RelayCommand(() =>
     {
         _navigationService.GoBack();
     });
 }