void Handle_ActionsPopoverWillShowPopover(object sender, EventArgs e) { UIAlertView view = null; if (!_ActionsPopoverShown) { view = new UIAlertView("Loading", "Accessing Database...", new UIAlertViewDelegate(), null, new string[] {}); view.Show(); NSRunLoop.Current.RunUntil(NSDate.Now.AddSeconds(.1)); //show waiting dialog } UIWebView v = new UIWebView(new CGRect(0, 0, 180, 120)); v.LoadHtmlString(MonsterHtmlCreator.CreateHtml(_Character.Monster, _Character, true), new NSUrl("http://localhost/")); _ActionsPopover.AccessoryView = v; List <CharacterActionItem> actions = CharacterActions.GetActions(_Character, _CharacterListView.SelectedCharacter); if (!_ActionsPopoverShown) { view.DismissWithClickedButtonIndex(0, false); //hide waiting dialog _ActionsPopoverShown = true; } AddActionItems(actions, _ActionsPopover.Items); }
public CharacterActionsAdapter(Context context, Character character, CombatState state) { _Context = context; _Character = character; _ActionItems = CharacterActions.GetActions(_Character, _Character, new List <Character>( from x in state.Characters where x.IsMonster == _Character.IsMonster select x)); }