private void MoveElement_Click(object sender, RoutedEventArgs e) { SkinMixerViewModel vm = DataContext as SkinMixerViewModel; vm.SelectedElementLeft.ReplaceBackup(new System.IO.FileInfo(vm.SelectedElementRight.Path)); StopAudio(true); vm.RefreshImage(); }
private async void RevertSelected_Click(object sender, RoutedEventArgs e) { var msgBox = MaterialMessageBox.Show(Helper.FindString("edit_revertTitle"), Helper.FindString("edit_revertDescription"), MessageBoxButton.YesNo); await DialogHost.Show(msgBox); if (msgBox.Result == MessageBoxResult.Yes) { StopAudio(true); SkinMixerViewModel vm = (SkinMixerViewModel)DataContext; vm.SelectedElementLeft.Reset(); /*string path = AppConfiguration.GetInstance().BackupDirectory + "\\" + * vm.LoadedSkin.Name + "\\"; * File.Copy(path + vm.SelectedElement.Name, vm.SelectedElement.Path, true);*/ vm.RefreshImage(); } }
private async void ChangeList_Revert_Click(object sender, RoutedEventArgs e) { var msgBox = MaterialMessageBox.Show(Helper.FindString("edit_revertTitle"), Helper.FindString("edit_revertDescription"), MessageBoxButton.YesNo); await DialogHost.Show(msgBox); if (msgBox.Result == MessageBoxResult.Yes) { StopAudio(true); SkinMixerViewModel vm = (SkinMixerViewModel)DataContext; SkinElement element = vm.SkinLeft.Elements.FirstOrDefault(x => x.Name.Equals( (sender as Button).Tag)) ?? null; if (element != null) { element.Reset(); if (element.Equals(vm.SelectedElementLeft)) { vm.RefreshImage(); } } } }