private void CardHovered(object sender, CardEventArgs e)
{
_currentCard = e.Card;
_currentCardUpStatus = false;
if (e.Card == null && e.CardModel == null)
{
_fadeOut.Begin(outerCardViewer, HandoffBehavior.SnapshotAndReplace);
_fadeOut.Begin(outerCardViewer2, HandoffBehavior.SnapshotAndReplace);
}
else
{
Point mousePt = Mouse.GetPosition(table);
if (mousePt.X < 0.4 * clientArea.ActualWidth)
outerCardViewer.HorizontalAlignment = cardViewer.HorizontalAlignment = outerCardViewer2.HorizontalAlignment = cardViewer2.HorizontalAlignment = HorizontalAlignment.Right;
else if (mousePt.X > 0.6 * clientArea.ActualWidth)
outerCardViewer.HorizontalAlignment = cardViewer.HorizontalAlignment = outerCardViewer2.HorizontalAlignment = cardViewer2.HorizontalAlignment = HorizontalAlignment.Left;
var ctrl = e.OriginalSource as CardControl;
if (e.Card != null)
{
bool up = ctrl != null && ctrl.IsAlwaysUp
|| (e.Card.FaceUp || e.Card.PeekingPlayers.Contains(Player.LocalPlayer));
_currentCardUpStatus = up;
var img = e.Card.GetBitmapImage(up);
double width = ShowCardPicture(e.Card, img);
_newCard = true;
if (up && Prefs.ZoomOption == Prefs.ZoomType.OriginalAndProxy && !e.Card.IsProxy())
{
var proxyImg = e.Card.GetBitmapImage(true, true);
ShowSecondCardPicture(e.Card, proxyImg, width);
}
}
else
{
var img = ImageUtils.CreateFrozenBitmap(new Uri(e.CardModel.GetPicture()));
this.ShowCardPicture(e.Card, img);
}
}
}