private void OnMenuSelected(Button btn) { if (btn == null) { return; } switch (btn.Name) { case UIConstant.BtnSoftwareAddPackage: DisplayAddOrEditDialog(0); break; case UIConstant.BtnSoftwareEditPackage: var selectedId = ViewList.First(r => r.IsSelected).Id; DisplayAddOrEditDialog(selectedId); break; case UIConstant.BtnSoftwareDeletePackage: var confirmDlg = new ConfirmDialog("Are you sure you want to delete?", "Delete Software"); if (confirmDlg.ShowDialog() == true) { DeleteContent(); } break; } }
public NavigationService() { var type = typeof(IDisplayable); ViewList = AppDomain.CurrentDomain.GetAssemblies() .SelectMany(s => s.GetTypes()) .Where(p => type.IsAssignableFrom(p) && !p.IsInterface) .Select(x => Activator.CreateInstance(x) as IDisplayable).ToDictionary(x => x.GetType().Name, x => x); currentViewValue = ViewList.First().Value; }
public void FirstLoad() { if (_gameContainer.PlayerList.Count() != 2) { throw new BasicBlankException("Must have 2 players only."); } ViewList = GetCoordinateList(); if (ViewList.First().IsSelf == false) { throw new BasicBlankException("First must be self"); } int x; MaxPlayers = 4; //i think CardList.Clear(); for (x = 1; x <= 4; x++) { SnagCardGameCardInformation newCard = new SnagCardGameCardInformation(); newCard.Populate(x); newCard.IsUnknown = true; newCard.Deck = x + 1000; //try this way. to at least make it work. CardList.Add(newCard); //i think } }