Esempio n. 1
0
        public EditorViewModel(CompletePhrase phrase)
        {
            this.PhraseResult = new PhraseReference.Phrase();
            this.PhraseResult.phraseId = phrase.Phrase.phraseId;
            this.PhraseResult.AutorId = phrase.Phrase.AutorId;
            this.PhraseResult.OriginId = phrase.Phrase.OriginId;
            this.PhraseResult.TranslationId = phrase.Phrase.TranslationId;

            this.TranslationResult = new TranslationReference.Translation();
            this.TranslationResult.TranslationId = phrase.Translation.TranslationId;
            this.TranslationResult.LanguageId = phrase.Translation.LanguageId;
            this.TranslationResult.Lexicon = phrase.Translation.Lexicon;
            this.TranslationResult.TranslationContent = phrase.Translation.TranslationContent;
            this.TranslationResult.TranslationDescription = phrase.Translation.TranslationDescription;
            this.TranslationResult.TranslationFirstLetter = phrase.Translation.TranslationFirstLetter;
            this.TranslationResult.PhraseId = phrase.Translation.PhraseId;
            this.TranslationResult.PhraseByDefault = phrase.Translation.PhraseByDefault;

            this.Languages = new ObservableCollection<LanguageReference.Language>();
            this.Autors = new ObservableCollection<AutorReference.Autor>();
            this.Origins = new ObservableCollection<OriginReference.Origin>();
            this.ValidationMessage = string.Empty;

            _languageClient = new LanguageReference.LanguageServiceClient();
            _languageClient.DisplayLanguagesCompleted += DisplayListLanguageComplete;
            _languageClient.DisplayLanguagesAsync();

            _autorClient = new AutorReference.AutorServiceClient();
            _autorClient.DisplayAutorsCompleted += DisplayListAutorComplete;
            _autorClient.DisplayAutorsAsync();

            _originClient = new OriginReference.OriginServiceClient();
            _originClient.DisplayOriginsCompleted += DisplayListOriginComplete;
            _originClient.DisplayOriginsAsync();
        }
Esempio n. 2
0
        public HomeViewModel()
        {
            this.Origins = new ObservableCollection<OriginReference.Origin>() { };
            this.CurrentLanguageId = -1;

            this.CreateOriginCommand = new DelegateCommand(AddContact_Execute, AddContact_CanExecute);
            this.EditOriginCommand = new DelegateCommand(EditContact_Execute, EditContact_CanExecute);
            this.DeleteOriginCommand = new DelegateCommand(DeleteContact_Execute, DeleteContact_CanExecute);

            _originClient = new OriginReference.OriginServiceClient();
            _originClient.CreateOriginCompleted += CreateLanguageComplete;
            _originClient.DisplayOriginsCompleted += DisplayListLanguageComplete;
            _originClient.EditOriginCompleted += EditLanguageComplete;
            _originClient.DeleteOriginCompleted += DeleteLanguageComplete;

            _originClient.DisplayOriginsAsync();

            _messageBoxService = new MessageBoxService();
            _modalDialogService = new ModalDialogService();
            _informationDialogService = new ModalDialogService();
        }