private void CalculScore(Bitmap s) { BitmapToXamlPath g = new BitmapToXamlPath(); string r = g.ConvertBitmap(s); try { Application.Current.Dispatcher.Invoke(() => { textScore.Text = _scoreManager.ScoreFromGeometries(shadePath.Data, Geometry.Parse(r)).ToString(); }); } catch (Exception) { } _isTreatingPath = false; }