private void Generate_Click(object sender, RoutedEventArgs e) { (DataContext as SBCreatorViewModel).GenerateAnimation(); SBCreatorViewModel vm = DataContext as SBCreatorViewModel; for (int i = 0; i < vm.DummyNames.Count; i++) { var value = (BitmapSource)vm.Animation[i]; } }
private void StartStopAnimation_Click(object sender, RoutedEventArgs e) { SBCreatorViewModel vm = DataContext as SBCreatorViewModel; if (!vm.IsAnimationPlaying) { vm.StartAnimation(); //Logger.Instance.WriteLog("Animation started!"); } else { vm.StopAnimation(); //Logger.Instance.WriteLog("Animation stopped!"); } }
private void FolderPicker_DialogClosed(object sender, RoutedEventArgs e) { FilePickerClosedEventArgs args = e as FilePickerClosedEventArgs; if (args.Path != null) { SBCreatorViewModel vm = DataContext as SBCreatorViewModel; for (int i = 0; i < vm.DummyNames.Count; i++) { Helper.SaveImage((BitmapSource)vm.Animation[i], args.Path + "\\" + vm.DummyNames[i]); } string message = Helper.FindString("sb_sliderballSaved"); snackbar.MessageQueue.Enqueue(message, Helper.FindString("sb_sliderballSavedButton"), param => { Process.Start(new ProcessStartInfo { FileName = "explorer", Arguments = string.Format("/e, /select, \"{0}\"", args.Path + "\\" + vm.DummyNames[0]) }); }, message, false, true); } }