Ejemplo n.º 1
0
        public Task <bool> LoadModel()
        {
            return(Task.Run <bool>(() =>
            {
                IsLoaded = false;
                IsLoading = true;
                try
                {
                    if (_ModelStage1.IsFullyInitialized == false)
                    {
                        _ModelStage1.LoadProperties();

                        NotifyPropertyChanged(() => ItemName);
                        NotifyPropertyChanged(() => ItemPath);
                        NotifyPropertyChanged(() => IconResourceId);

                        LastRefreshTimeUtc = DateTime.Now;
                        System.Console.WriteLine("Model {0} loaded.", _ID);
                    }
                }
                catch
                {
                    return false;
                }
                finally
                {
                    IsLoading = false;
                    IsLoaded = true;
                }

                return IsLoaded;
            }));
        }