Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        private static void ShowWithLoader(Action <Action <BackendResult <MoneyTransferResponse, ResultCode> >, CancellationToken> loadAction)
        {
            CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
            FullscreenLoader        fullscreenLoader        = new FullscreenLoader();

            fullscreenLoader.HideOnBackKeyPress = true;
            Action <FullscreenLoaderHiddenEventArgs> action = (Action <FullscreenLoaderHiddenEventArgs>)(args => cancellationTokenSource.Cancel());

            fullscreenLoader.HiddenCallback = action;
            FullscreenLoader loader = fullscreenLoader;

            loader.Show(null, true);
            loadAction((Action <BackendResult <MoneyTransferResponse, ResultCode> >)(result =>
            {
                loader.Hide(false);
                ResultCode resultCode = result.ResultCode;
                if (resultCode == ResultCode.Succeeded)
                {
                    Execute.ExecuteOnUIThread((Action)(() =>
                    {
                        MoneyTransferResponse resultData = result.ResultData;
                        if (resultData == null)
                        {
                            return;
                        }
                        MoneyTransfer transfer = resultData.transfer;
                        User user = resultData.user;
                        if (transfer == null || user == null)
                        {
                            return;
                        }
                        TransferCardView.Show(new MoneyTransferViewModel(transfer, user));
                    }));
                }
                else
                {
                    GenericInfoUC.ShowBasedOnResult(resultCode, "", null);
                }
            }), cancellationTokenSource.Token);
        }
Esempio n. 4
0
 public static void Show(long id, long fromId, long toId)
 {
     TransferCardView.ShowWithLoader((Action <Action <BackendResult <MoneyTransferResponse, ResultCode> >, CancellationToken>)((callback, cancellationToken) => MoneyTransfersService.GetTransfer(id, fromId, toId, callback, new CancellationToken?(cancellationToken))));
 }