Exemplo n.º 1
0
        private void EditAlias(object obj)
        {
            var viewModelInfo = new AliasViewModelInfo <AliasCollectionItem>()
            {
                Model = obj as AliasCollectionItem,
                Close = PopupModel.ClosePopup,
                Add   = AddAlias,
                Save  = SaveChanges
            };

            var viewModel = new AliasAddEditViewModel(viewModelInfo);

            PopupModel.OpenPopup(viewModel);
        }
Exemplo n.º 2
0
        internal void InitializeData(AliasViewModelInfo <AliasCollectionItem> info)
        {
            infoViewModel = info;
            newAlias      = info?.Model;

            if (newAlias == null)
            {
                isAdd    = true;
                newAlias = new AliasCollectionItem();
            }

            this.AliasName      = newAlias?.Name ?? string.Empty;
            this.PlayersInAlias = new ObservableCollection <PlayerCollectionItem>(newAlias?.PlayersInAlias);

            AllPlayers = new ObservableCollection <PlayerCollectionItem>(StorageModel.PlayerCollection.Except(this.PlayersInAlias).OfType <PlayerCollectionItem>());

            AllPlayersSorted.Source = AllPlayers;
            AllPlayersSorted.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
            SelectedPlayersSorted.Source = PlayersInAlias;
            SelectedPlayersSorted.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
        }
Exemplo n.º 3
0
 internal AliasAddEditViewModel(AliasViewModelInfo <AliasCollectionItem> info)
 {
     InitializeBindings();
     InitializeData(info);
 }