private void MergeButton_Click(object sender, RoutedEventArgs e) { EditorSubsystemManaged.getInstance().QueueActionAndBlock(new Action(() => { StateSerializer ss = new StateSerializer(); BaseState cur_state = GSM.getInstance().getStateUnderActive(); BaseState new_state = GSM.getInstance().getActiveState(); BoolVector mergeMask = new BoolVector(); foreach (var obj in objects) { mergeMask.Add(obj.ShouldMerge); } ss.MergeStates(new_state, cur_state, mergeMask); })); this.Close(); }