void ShowLastTreasure()
        {
            WebView wv = _v.FindViewById <WebView>(Resource.Id.itemView);

            if (_LastTreasure != null)
            {
                wv.LoadDataWithBaseURL(null, TreasureHtmlCreator.CreateHtml(_LastTreasure), "text/html", "utf-8", null);
            }
            else
            {
                wv.LoadUrl("about:blank");
            }
        }
        void GenerateButtonClicked(object sender, EventArgs e)
        {
            Treasure t;

            if (_ShowingItems)
            {
                TreasureGenerator gen = new TreasureGenerator();

                t = new Treasure();
                int       count = (int)_CountButton.Tag;
                ItemLevel level = (ItemLevel)(int)_ChartLevelButton.Tag;

                TreasureGenerator.RandomItemType types = (TreasureGenerator.RandomItemType) 0;

                foreach (var b in _ItemCheckButtons)
                {
                    if ((bool)b.Data)
                    {
                        var v = (TreasureGenerator.RandomItemType)(int) b.Tag;

                        switch (v)
                        {
                        case TreasureGenerator.RandomItemType.MinorWondrous:

                            switch (level)
                            {
                            case ItemLevel.Medium:
                                v = TreasureGenerator.RandomItemType.MediumWondrous;
                                break;

                            case ItemLevel.Major:
                                v = TreasureGenerator.RandomItemType.MinorWondrous;
                                break;
                            }
                            break;

                        case TreasureGenerator.RandomItemType.Rod:
                        case TreasureGenerator.RandomItemType.Staff:
                            if (level == ItemLevel.Minor)
                            {
                                v = (TreasureGenerator.RandomItemType) 0;
                            }
                            break;
                        }
                        types |= v;
                    }
                }


                if (types != 0)
                {
                    for (int i = 0; i < count; i++)
                    {
                        TreasureItem item = gen.GenerateRandomItem(level, types);
                        t.Items.Add(item);
                    }
                }
            }
            else
            {
                TreasureGenerator gen = new TreasureGenerator();
                gen.Coin  = (int)_CoinButton.Tag;
                gen.Level = (int)_LevelButton.Tag;
                gen.Items = (int)_ItemsButton.Tag;
                gen.Goods = (int)_GoodsButton.Tag;

                t = gen.Generate();
            }

            _GeneratedHtml = TreasureHtmlCreator.CreateHtml(t);

            _WebView.LoadHtmlString(_GeneratedHtml, new NSUrl("http://localhost"));
        }