Пример #1
0
 private void ServerDeleting(object sender, ItemDeletingEventArgs e)
 {
     var model = e.Item as ServerInfoModel;
     var dbm = model.GetDbModel();
     if (dbm.Id != Guid.Empty)
     {
         if (dbm.ChatLog.Any()) e.Cancel = true;
     }
 }
Пример #2
0
        private void Delete(object sender, ExecutedRoutedEventArgs e)
        {
            var eventArgs = new ItemDeletingEventArgs(ItemDeletingEvent, e.Parameter);

            this.RaiseEvent(eventArgs);
            if (eventArgs.Cancel)
            {
                return;
            }

            Items.Remove(e.Parameter);

            this.RaiseEvent(new ItemEventArgs(ItemDeletedEvent, e.Parameter));
        }
Пример #3
0
    private void Delete( object sender, ExecutedRoutedEventArgs e )
    {
      var eventArgs = new ItemDeletingEventArgs( ItemDeletingEvent, e.Parameter );
      this.RaiseEvent( eventArgs );
      if( eventArgs.Cancel )
        return;

      Items.Remove( e.Parameter );

      this.RaiseEvent( new ItemEventArgs( ItemDeletedEvent, e.Parameter ) );
    }