Example #1
0
        private void ViewTechTree(NationUnikey key)
        {
            var uri = TechTreeDocumentServiceBase.CreateUri(key.RepositoryID);

            var document = DockingViewManager.Instance.DocumentManager.OpenDocument(uri)
                           .ContinueWith(t =>
            {
                App.BeginInvokeBackground(() =>
                {
                    if (t.Result == null)
                    {
                        this.LogError("failed to create tech tree document");
                        return;
                    }

                    var vm = t.Result.Content.DataContext as TechTreeDocumentVM;
                    if (vm == null)
                    {
                        this.LogError("failed to retrieve tech tree document view model");
                        return;
                    }

                    vm.SelectNation(key.NationKey);
                });
            });
        }
Example #2
0
 public NationNodeVM(ExplorerTreeNodeVM parent, LocalGameClient client, string nation)
     : base(parent, client.Localization.GetLocalizedNationName(nation), LoadChildenStrategy.LazyDynamicAsync)
 {
     _client     = client;
     this.Nation = nation;
     _unikey     = new NationUnikey(client, nation);
 }
Example #3
0
 private bool CanViewTechTree(NationUnikey key)
 {
     return(RepositoryManager.Instance[key.RepositoryID] is LocalGameClient);
 }