Пример #1
0
 public WebViewPage(WebViewViewModel viewModel)
 {
     InitializeComponent();
     DataContext = viewModel;
     _viewModel  = viewModel;
     _viewModel.Initialize(webView);
 }
Пример #2
0
 public WebViewPage(Place place)
 {
     InitializeComponent();
     BindingContext = new WebViewViewModel(place);
     Title          = place.Label + " email form";
     ((NavigationPage)Application.Current.MainPage).BarBackgroundColor = (Color)Application.Current.Resources["PrimaryColor"];
     ((NavigationPage)Application.Current.MainPage).BarTextColor       = Color.White;
 }
Пример #3
0
 public WebViewPage(AdviceArea area)
 {
     InitializeComponent();
     BindingContext = new WebViewViewModel(area);
     Title          = area.AreaName + " Web Info";
     ((NavigationPage)Application.Current.MainPage).BarBackgroundColor = (Color)Application.Current.Resources["PrimaryColor"];
     ((NavigationPage)Application.Current.MainPage).BarTextColor       = Color.White;
 }
Пример #4
0
        public WebView(string WebSite)
        {
            InitializeComponent();

            BindingContext = new WebViewViewModel(WebSite);

            var navigationPage = Application.Current.MainPage as NavigationPage;

            navigationPage.BarBackgroundColor = Color.Green;
        }
Пример #5
0
        private async Task PrintAsync()
        {
            try
            {
                if (_trainingDays == null)
                {
                    await _userDialog.AlertAsync(Translation.Get(TRS.IMPOSSIBLE_ACTION), Translation.Get(TRS.PRINT), Translation.Get(TRS.OK));
                }
                else
                {
                    bool withImages = await _userDialog.ConfirmAsync(Translation.Get(TRS.PRINT_WITH_IMAGES) + " ?", Translation.Get(TRS.PRINT), Translation.Get(TRS.YES), Translation.Get(TRS.NO));

                    var trainingDayReport = new TrainingDayReport()
                    {
                        UserId        = this.UserId,
                        Year          = this.Year,
                        WeekOfYear    = this.WeekOfYear,
                        DayOfWeek     = this.DayOfWeek,
                        DisplayImages = withImages,
                        TrainingDayId = null
                    };
                    var memoryStream = await ReportWebService.TrainingDayReportAsync(trainingDayReport);

                    if (memoryStream != null)
                    {
                        var    pdfName     = Guid.NewGuid().ToString() + ".pdf";
                        var    fileManager = Resolver.Resolve <IFileManager>();
                        string pdfPath     = Path.Combine(AppTools.TempDirectory, pdfName);

                        bool writeSuccess = await fileManager.WriteBinaryFileAsync(pdfPath, memoryStream);

                        if (writeSuccess)
                        {
                            if (Device.OS == TargetPlatform.Android)
                            {
                                Resolver.Resolve <IAndroidAPI> ().OpenPdf(pdfPath);
                            }
                            else if (Device.OS == TargetPlatform.iOS)
                            {
                                await WebViewViewModel.ShowAsync(pdfPath, this);
                            }
                        }
                    }
                }
            }
            catch (Exception except)
            {
                ILogger.Instance.Error("Unable to print trainingDay", except);
            }
        }
Пример #6
0
 public WebView()
 {
     InitializeComponent();
     App.PinResetFromSettingsPage = false;
     if (App.IsToombStoned)
     {
         this.Loaded += new RoutedEventHandler(CancelNavigationPage_Loaded);
     }
     else
     {
         WebViewViewModel objHPViewModel = new WebViewViewModel();
         this.DataContext       = objHPViewModel;
         App.IsPageHomePanorama = true;
         App.IsPageUpdateYourDetailsafterLogin = false;
         App.IsFromLoginScreen = false;
     }
 }
Пример #7
0
 public WebViewPage()
 {
     InitializeComponent();
     BindingContext = new WebViewViewModel(webView);
 }
Пример #8
0
 public WebViewPage()
 {
     ViewModel = Ioc.Default.GetService <WebViewViewModel>();
     InitializeComponent();
     ViewModel.Initialize(webView);
 }
Пример #9
0
 public MazeMapPage(WebViewViewModel viewModel)
 {
     InitializeComponent();
     BindingContext = viewModel;
     Browser.Source = viewModel.MazeUrl();
 }
 public WebViewPage(WebViewViewModel baseViewModel) : base(baseViewModel)
 {
     InitializeComponent();
 }