private void ShowSecondCardPicture(Card card, BitmapSource img, double requiredMargin)
{
var maxWidth = this.ActualWidth * 0.20;
cardViewer2.Height = img.PixelHeight;
cardViewer2.Width = img.PixelWidth > maxWidth ? maxWidth : img.PixelWidth;
cardViewer2.Source = img;
if (cardViewer2.HorizontalAlignment == HorizontalAlignment.Left)
{
outerCardViewer2.Margin = new Thickness(requiredMargin + 15, 10, 10, 10);
}
else
{
outerCardViewer2.Margin = new Thickness(10, 10, requiredMargin + 15, 10);
}
_fadeIn.Begin(outerCardViewer2, HandoffBehavior.SnapshotAndReplace);
if (cardViewer2.Clip == null) return;
var clipRect = ((RectangleGeometry)cardViewer2.Clip);
double height = Math.Min(cardViewer2.MaxHeight, cardViewer2.Height);
double width = cardViewer2.Width * height / cardViewer2.Height;
clipRect.Rect = new Rect(new Size(width, height));
//clipRect.RadiusX = clipRect.RadiusY = Program.GameEngine.Definition.CardCornerRadius * height / card.Size.Height;
clipRect.RadiusX = clipRect.RadiusY = card.RealCornerRadius * height / card.RealHeight;
}