예제 #1
0
        private void MediaHorizontalListItem_OnTap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            ProfileMediaViewModelFacade         viewModel = this.ViewModel;
            Action <MediaListItemViewModelBase> action1;

            if (viewModel == null)
            {
                action1 = null;
            }
            else
            {
                IMediaHorizontalItemsViewModel horizontalItemsViewModel = viewModel.MediaHorizontalItemsViewModel;
                action1 = horizontalItemsViewModel != null ? horizontalItemsViewModel.ItemTapAction :  null;
            }
            Action <MediaListItemViewModelBase> action2 = action1;

            if (action2 == null)
            {
                return;
            }
            MediaListItemViewModelBase dataContext = ((FrameworkElement)sender).DataContext as MediaListItemViewModelBase;

            if (dataContext == null)
            {
                return;
            }
            action2(dataContext);
        }
예제 #2
0
        private void MediaVerticalListItem_OnTap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            if (this.ViewModel == null)
            {
                return;
            }
            Action <MediaListItemViewModelBase> itemTapAction = this.ViewModel.MediaVerticalItemsViewModel.ItemTapAction;

            if (itemTapAction == null)
            {
                return;
            }
            MediaListItemViewModelBase itemViewModelBase = ((FrameworkElement)sender).DataContext as MediaListItemViewModelBase;

            if (itemViewModelBase == null)
            {
                return;
            }
            itemTapAction(itemViewModelBase);
        }