Exemplo n.º 1
0
        public SettingsViewModel(CognitiveClient cognitiveClient, ILauncherService launcherService)
        {
            this.cognitiveClient = cognitiveClient;
            this.launcherService = launcherService;

            this.CreateCommands();
        }
Exemplo n.º 2
0
        public MainViewModel(CognitiveClient cognitiveClient, IStreamingService streamingService, ISpeechService speechService)
        {
            this.cognitiveClient  = cognitiveClient;
            this.streamingService = streamingService;
            this.speechService    = speechService;

            this.CreateCommands();
        }
Exemplo n.º 3
0
        public RecognizeTextViewModel(CognitiveClient cognitiveClient, IMediaPicker mediaPicker, ISpeechService speechService)
        {
            this.cognitiveClient = cognitiveClient;
            this.mediaPicker     = mediaPicker;
            this.speechService   = speechService;

            this.CreateCommands();
        }
Exemplo n.º 4
0
        static ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            SimpleIoc.Default.Register <CognitiveClient>(() =>
            {
                VisionSettings visionSettings = null;
                using (var stream = typeof(ViewModelLocator).GetTypeInfo().Assembly.GetManifestResourceStream(Constants.VisionSettingsFile))
                {
                    using (var reader = new StreamReader(stream))
                        visionSettings = JsonConvert.DeserializeObject <VisionSettings>(reader.ReadToEnd());
                }

                var visionSettingsProvider = new SimpleVisionSettingsProvider(visionSettings);
                var cognitiveClient        = new CognitiveClient(visionSettingsProvider);

                var cognitiveSettings = cognitiveClient.Settings;
                cognitiveSettings.EmotionSubscriptionKey    = ServiceKeys.EmotionSubscriptionKey;
                cognitiveSettings.VisionSubscriptionKey     = ServiceKeys.VisionSubscriptionKey;
                cognitiveSettings.FaceSubscriptionKey       = ServiceKeys.FaceSubscriptionKey;
                cognitiveSettings.TranslatorSubscriptionKey = ServiceKeys.TranslatorSubscriptionKey;

                return(cognitiveClient);
            });

            SimpleIoc.Default.Register <ISpeechService>(() =>
            {
                var language = GetLanguage();
                var service  = new SpeechService {
                    Language = language
                };
                return(service);
            });

            SimpleIoc.Default.Register <Services.IDialogService, Services.DialogService>();
            SimpleIoc.Default.Register <IStreamingService, StreamingService>();
            SimpleIoc.Default.Register <ISettingsService, SettingsService>();
            SimpleIoc.Default.Register <INetworkService, NetworkService>();
            SimpleIoc.Default.Register <ILauncherService, LauncherService>();
            SimpleIoc.Default.Register <IAppService, AppService>();
            SimpleIoc.Default.Register <IMediaPicker, MediaPicker>();

            SimpleIoc.Default.Register <MainViewModel>();
            SimpleIoc.Default.Register <SettingsViewModel>();
            SimpleIoc.Default.Register <AboutViewModel>();
            SimpleIoc.Default.Register <RecognizeTextViewModel>();
            SimpleIoc.Default.Register <PrivacyViewModel>();

            OnInitialize();
        }
Exemplo n.º 5
0
        static ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            SimpleIoc.Default.Register <CognitiveClient>(() =>
            {
                var visionSettingsProvider = new LocalVisionSettingsProvider();
                var cognitiveClient        = new CognitiveClient(visionSettingsProvider);

                var cognitiveSettings = cognitiveClient.Settings;
                cognitiveSettings.EmotionSubscriptionKey    = ServiceKeys.EmotionSubscriptionKey;
                cognitiveSettings.VisionSubscriptionKey     = ServiceKeys.VisionSubscriptionKey;
                cognitiveSettings.TranslatorSubscriptionKey = ServiceKeys.TranslatorSubscriptionKey;

                return(cognitiveClient);
            });

            SimpleIoc.Default.Register <ISpeechService>(() =>
            {
                var language = GetLanguage();
                var service  = new SpeechService {
                    Language = language
                };
                return(service);
            });

            SimpleIoc.Default.Register <Services.IDialogService, Services.DialogService>();
            SimpleIoc.Default.Register <IStreamingService, StreamingService>();
            SimpleIoc.Default.Register <ISettingsService, SettingsService>();
            SimpleIoc.Default.Register <INetworkService, NetworkService>();
            SimpleIoc.Default.Register <ILauncherService, LauncherService>();
            SimpleIoc.Default.Register <IAppService, AppService>();
            SimpleIoc.Default.Register <IMediaPicker, MediaPicker>();

            SimpleIoc.Default.Register <MainViewModel>();
            SimpleIoc.Default.Register <SettingsViewModel>();
            SimpleIoc.Default.Register <AboutViewModel>();
            SimpleIoc.Default.Register <RecognizeTextViewModel>();
            SimpleIoc.Default.Register <PrivacyViewModel>();

            OnInitialize();
        }
Exemplo n.º 6
0
 public AssistantBotDialog()
 {
     _cognitiveClient = new CognitiveClient();
 }