private void Image_Tap(object sender, System.Windows.Input.GestureEventArgs e) { PhotoMosaicViewModel m = DataContext as PhotoMosaicViewModel; Image i = sender as Image; if (m != null && i != null) { m.RaiseStreamItemTapped(Int32.Parse(i.Name.Replace("Image", ""))); } }
private void ListBox_ItemUnrealized(object sender, ItemRealizationEventArgs e) { PhotoMosaic v = GetVisualChild <PhotoMosaic>(e.Container); if (v != null && _realizedPhotoMosaics.Contains(v)) { _realizedPhotoMosaics.Remove(v); PhotoMosaicViewModel m = v.DataContext as PhotoMosaicViewModel; if (m != null) { m.Realized = false; } } }
private void DispatcherTimer_Tick(object sender, EventArgs e) { foreach (PhotoMosaic v in _realizedPhotoMosaics) { PhotoMosaicViewModel m = v.DataContext as PhotoMosaicViewModel; if (m != null) { try { GeneralTransform transform = v.TransformToVisual(Application.Current.RootVisual); Point offset = transform.Transform(new Point(0, 0)); if (offset.Y > -ActualHeight && offset.Y < ActualHeight) { m.RandomizeFilter(); } } catch (Exception) { } } } }