private void ApplyResize_Click(object sender, RoutedEventArgs e) { ImageEditorViewModel vm = DataContext as ImageEditorViewModel; vm.ResultImage = vm.ResizeVm.ApplyTransform(); vm.RefreshBindings(); }
/*public ImageEditor(FrameworkElement parentControl, BitmapImage image) * { * InitializeComponent(); * (DataContext as ImageEditorViewModel).ResultImage = image; * this.parentControl = parentControl; * }*/ public void EditImage(BitmapImage image) { ImageEditorViewModel vm = DataContext as ImageEditorViewModel; vm.ResultImage = image; vm.RefreshBindings(); Visibility = Visibility.Visible; }