/// <summary> /// Sensor-Tile position changed /// </summary> /// <param name="args"></param> private void SensorTileDeletedEventHandler(SensorTileDeletedEventArgs args) { if (args.DeletedSensorTile != null) { int gridRow = Convert.ToInt32(args.DeletedSensorTile.GetValue(Grid.RowProperty)); int gridColumn = Convert.ToInt32(args.DeletedSensorTile.GetValue(Grid.ColumnProperty)); this.MainGrid.Children.Remove(args.DeletedSensorTile); // Create new drop target TileViewDropTarget dropTarget = new TileViewDropTarget(); dropTarget.SetValue(Grid.RowProperty, gridRow); dropTarget.SetValue(Grid.ColumnProperty, gridColumn); this.MainGrid.Children.Add(dropTarget); this.configurationFile.DeleteSensorTile(args.DeletedSensorTile.HardwareSensor.Name, gridRow, gridColumn); } }
/// <summary> /// Delete sensor tile event handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mnuDeleteSensorTile_Click(object sender, RoutedEventArgs e) { SensorTileDeletedEventArgs args = new SensorTileDeletedEventArgs(this); DependencyFactory.Resolve <IEventAggregator>(GeneralConstants.EventAggregator).GetEvent <SensorTileDeletedEvent>().Publish(args); }