Exemple #1
0
        private void ShowFlyout(string header, string source)
        {
            AdditionalArticleViewModel viewModel = new AdditionalArticleViewModel();

            viewModel.Header = header;
            viewModel.Source = source;

            AdditionalArticleFlyout flyout = new AdditionalArticleFlyout();

            flyout.SetViewModel(viewModel);
            flyout.Show();
        }
Exemple #2
0
        protected override void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            ResourceLoader resources = ResourceLoader.GetForCurrentView();

            string          aboutCommandTitle = resources.GetString("AboutTitle");
            SettingsCommand aboutCommand      = new SettingsCommand(aboutCommandTitle, aboutCommandTitle,
                                                                    async(handler) =>
            {
                try
                {
                    Core.IDictionaryService dictionaryService = Mvx.Resolve <Core.IDictionaryService>();

                    string aboutText      = await Utils.ReadResourceFile("ms-appx:///Resources/ContainerAbout.html");
                    string packageVersion = Utils.GetPackageVersion();
                    string engineVersion  = dictionaryService.GetEngineViersion().ToString();

                    aboutText = aboutText.Replace("${version}", packageVersion);
                    aboutText = aboutText.Replace("${engine_version}", engineVersion);

                    AdditionalArticleViewModel viewModel = new AdditionalArticleViewModel();
                    viewModel.Header = aboutCommandTitle;
                    viewModel.Source = aboutText;

                    AdditionalArticleFlyout flyout = new AdditionalArticleFlyout();
                    flyout.SetViewModel(viewModel);
                    flyout.Show();
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                }
            });

            args.Request.ApplicationCommands.Add(aboutCommand);

            string          enterCodeCommandTitle = resources.GetString("EnterCodeTitle");
            SettingsCommand enterCodeCommand      = new SettingsCommand(enterCodeCommandTitle, enterCodeCommandTitle,
                                                                        (handler) =>
            {
                Utils.ShowEnterCodeFlyout();
            });

            args.Request.ApplicationCommands.Add(enterCodeCommand);
        }
 public void SetViewModel(AdditionalArticleViewModel viewModel)
 {
     DataContext = viewModel;
 }