public static FinanceElement getElement(double amount, string caption)
 {
     var e = new FinanceElement (caption, amount);
     return e;
 }
        public void BuildInterface()
        {
            if (Root == null) {
                Root = new RootElement ("");
            }
            Root.Clear ();
            String name = "";
            if (searchResult != null) {
                name = searchResult.matterName;
            }
            headerLabel = new UILabel (new RectangleF (40, 10, 620, 40)) {
                Font = UIFont.BoldSystemFontOfSize (20),
                BackgroundColor = ColorHelper.GetGPPurple (),
                TextAlignment = UITextAlignment.Center,
                TextColor = UIColor.White,
                Text = name
            };
            var view = new UIViewBordered ();
            view.Frame = new RectangleF (40, 10, 620, 40);
            view.Add (headerLabel);
            var topSection = new Section (view);

            Root.Add (topSection);
            //
            var sec = new Section ("");
            matterName = new TitleElement ("Matter Details");
            if (searchResult != null) {
                ownerName = new StringsElement ("Owner", searchResult.currentOwner);
                matterID = new NumberElement (
                    Convert.ToInt16 (searchResult.matterID), "Matter ID");
                if (searchResult.matterLegacyAccount == null || searchResult.matterLegacyAccount.Trim () == "") {
                    //ignore
                } else {
                    legacy = new StringsElement (
                        "Legacy Account",
                        searchResult.matterLegacyAccount
                    );
                }
                clientName = new StringsElement ("Client", "" + searchResult.clientName);
            }
            //
            var sec2 = new Section ("");
            if (matter == null) {
                busBal = new FinanceElement (S.GetText (S.BUSINESS_BALANCE) + ":", 0.00);
                currBal = new FinanceElement (S.GetText (S.CURRENT_BALANCE) + ":", 0.00);
                trustBal = new FinanceElement (S.GetText (S.TRUST_BALANCE) + ":", 0.00);
                reserveTrust = new FinanceElement (S.GetText (S.RESERVE_TRUST) + ":", 0.00);
                unbilled = new FinanceElement (S.GetText (S.UNBILLED_BALANCE) + ":", 0.00);
                pending = new FinanceElement (S.GetText (S.PENDING_DISBURSEMENTS) + ":", 0.00);
                investTrust = new FinanceElement (S.GetText (S.INVESTMENT_TRUST) + ":", 0.00);
            } else {
                busBal = new FinanceElement (S.GetText (S.BUSINESS_BALANCE) + ":", matter.businessBalance, deviceType);
                currBal = new FinanceElement (S.GetText (S.CURRENT_BALANCE) + ":", matter.currentBalance, deviceType);
                unbilled = new FinanceElement (S.GetText (S.UNBILLED_BALANCE) + ":", matter.unbilledBalance, deviceType);
                trustBal = new FinanceElement (S.GetText (S.TRUST_BALANCE) + ":", matter.trustBalance, deviceType);
                reserveTrust = new FinanceElement (S.GetText (S.RESERVE_TRUST) + ":", matter.reserveTrust, deviceType);
                pending = new FinanceElement (S.GetText (S.PENDING_DISBURSEMENTS) + ":", matter.pendingDisbursementBalance, deviceType);
                investTrust = new FinanceElement (S.GetText (S.INVESTMENT_TRUST) + ":", matter.investmentTrustBalance, deviceType
                );

            }
            //
            sec.Add (matterName);
            sec.Add (clientName);
            sec.Add (ownerName);
            sec.Add (matterID);
            Root.Add (sec);
            //
            sec2.Add (busBal);
            sec2.Add (trustBal);
            sec2.Add (investTrust);
            sec2.Add (currBal);
            sec2.Add (reserveTrust);
            sec2.Add (unbilled);
            sec2.Add (pending);
            if (legacy != null) {
                sec2.Add (legacy);
            }

            Root.Add (sec2);
        }