コード例 #1
0
        private async void AddLoan_Clicked(object sender, EventArgs e)
        {
            var view = new AddLoanView(bottomModal);

            view.OnCancel += async(sender1, e1) => await ModalAddLoan.Hide();

            view.OnSaved += async(sender1, e1) =>
            {
                loadingPopup.IsVisible = true;
                await ModalAddLoan.Hide();

                await viewModel.LoadOnRefreshCommandAsync();

                loadingPopup.IsVisible = false;
            };
            ModalAddLoan.Body = view;
            await ModalAddLoan.Show();
        }
コード例 #2
0
        public async void Init()
        {
            await SetForm();

            if (_goiVay == null)
            {
                return;
            }



            var ButtonCommandList = new List <FloatButtonItem>();

            if (UserLogged.IsLogged && _goiVay.EmployeeId == Guid.Parse(UserLogged.Id))
            {
                ButtonCommandList.Add(new FloatButtonItem(Language.chinh_sua, FontAwesomeHelper.GetFont("FontAwesomeRegular"), "\uf044", null, async(sender, e) =>
                {
                    var view       = new AddLoanView(bottomModal, _id);
                    view.OnCancel += async(sender1, e1) => await ModalAddLoan.Hide();
                    view.OnSaved  += async(sender1, e1) =>
                    {
                        loadingPopup.IsVisible = true;
                        await ModalAddLoan.Hide();
                        await SetForm();
                        loadingPopup.IsVisible = false;
                    };
                    ModalAddLoan.Body = view;
                    await ModalAddLoan.Show();
                }));
                ButtonCommandList.Add(new FloatButtonItem(Language.xoa, FontAwesomeHelper.GetFont("FontAwesomeSolid"), "\uf2ed", null, Remove_Clicked));
            }
            else
            {
                ButtonCommandList.Add(new FloatButtonItem(Language.goi_dien, FontAwesomeHelper.GetFont("FontAwesomeSolid"), "\uf2a0", null, CallOptionSelected));        //2
                ButtonCommandList.Add(new FloatButtonItem(Language.chat, FontAwesomeHelper.GetFont("FontAwesomeSolid"), "\uf4ad", null, ChatOptionSelected));            //3
                ButtonCommandList.Add(new FloatButtonItem(Language.nhan_tin, FontAwesomeHelper.GetFont("FontAwesomeSolid"), "\uf4ad", null, SendMessageOptionSelected)); //4
            }
            floatingButtonGroup.ItemsSource = ButtonCommandList;
            loadingPopup.IsVisible          = false;
        }