private void Initialize(MoneyTransferViewModel transfer) { base.DataContext = transfer; this._currentPage = (PhoneApplicationPage)FramePageUtils.CurrentPage; Content content = Application.Current.Host.Content; this._pageHeightPortrait = content.ActualHeight; this._pageHeightLandscape = content.ActualWidth; this._height = 274.0; if (transfer.CommentVisibility == Visibility.Visible) { this._height = this._height + 8.0; this._height = this._height + this.MeasureCommentHeight(); } if (transfer.CardButtonsVisibility == Visibility.Visible) { this._height = this._height + 56.0; } if (transfer.ActionButtonVisibility == Visibility.Visible) { this._height = this._height + 56.0; } this._height = Math.Round(this._height); this._contentMarginTopPortrait = Math.Round((this._pageHeightPortrait - this._height) / 2.0); this._contentMarginTopLandscape = Math.Round((this._pageHeightLandscape - this._height) / 2.0); this.UpdateValuesForOrientation(); this.PrepareAnimations(); }
private static void Show(MoneyTransferViewModel viewModel) { DialogService flyout = TransferCardView._flyout; if ((flyout != null ? (flyout.IsOpen ? 1 : 0) : 0) != 0) { return; } TransferCardView view = new TransferCardView(); view.Initialize(viewModel); DialogService dialogService = new DialogService(); dialogService.AnimationType = DialogService.AnimationTypes.None; dialogService.AnimationTypeChild = DialogService.AnimationTypes.None; SolidColorBrush solidColorBrush = new SolidColorBrush(Colors.Transparent); dialogService.BackgroundBrush = (Brush)solidColorBrush; int num1 = 0; dialogService.HideOnNavigation = num1 != 0; int num2 = 0; dialogService.IsOverlayApplied = num2 != 0; Action <Action> action = (Action <Action>)(callback => view.AnimateHide(false, callback)); dialogService.OnClosingAction = action; TransferCardView._flyout = dialogService; TransferCardView._flyout.Opened += (EventHandler)((sender, args) => view.AnimateShow()); TransferCardView._flyout.Child = (FrameworkElement)view; TransferCardView._flyout.Show(null); }
private void Transfer_OnClicked(object sender, System.Windows.Input.GestureEventArgs e) { MoneyTransferViewModel dataContext = ((FrameworkElement)((RoutedEventArgs)e).OriginalSource).DataContext as MoneyTransferViewModel; MoneyTransfer moneyTransfer = dataContext != null ? dataContext.Transfer : null; if (moneyTransfer == null) { return; } TransferCardView.Show(moneyTransfer.id, moneyTransfer.from_id, moneyTransfer.to_id); }
public ActionResult MoneyTransfer(MoneyTransferViewModel moneyTransferData) { if (!ModelState.IsValid) { return(this.View()); } string userEmail = User.Identity.Name; _bankManageService.MoneyTransfer( userEmail, moneyTransferData.FromAccountNumber, moneyTransferData.ToEmail, moneyTransferData.ToAccountNumber, moneyTransferData.TransferSum); return(this.RedirectToAction("ShowAccounts")); }
private void Photo_OnClicked(object sender, System.Windows.Input.GestureEventArgs e) { e.Handled = true; MoneyTransferViewModel dataContext = ((FrameworkElement)((RoutedEventArgs)e).OriginalSource).DataContext as MoneyTransferViewModel; if (dataContext == null) { return; } if (dataContext.UserId > 0L) { Navigator.Current.NavigateToUserProfile(dataContext.UserId, "", "", false); } else { Navigator.Current.NavigateToGroup(-dataContext.UserId, "", false); } }
private void Button_OnClicked(object sender, RoutedEventArgs e) { Button button = (Button)sender; int num = int.Parse(((FrameworkElement)button).Tag.ToString()); MoneyTransferViewModel dataContext = ((FrameworkElement)button).DataContext as MoneyTransferViewModel; if (dataContext == null) { return; } if (num == 1) { dataContext.AcceptTransfer(); } else if (!dataContext.IsOutbox) { dataContext.DeclineTransfer(null); } else { dataContext.CancelTransfer(null); } }