public Loader() { InitializeComponent(); vm = new LoaderViewModel(this); this.DataContext = vm; }
private void ConstructTCSSafeLoaderAndDisplay(Task action, Color loaderColour, Color loaderPopupColour, List <string> reasonsForLoader, Color textColour, int millisecondsBetweenReasons) { LoaderViewModel loaderWaiting = ConstructLoaderModal(loaderColour, loaderPopupColour, reasonsForLoader, textColour, millisecondsBetweenReasons); action.GetAwaiter().OnCompleted(() => Device.BeginInvokeOnMainThread(() => loaderWaiting.SafeCloseModal <LoaderPopupPage>())); if (!action.IsCompleted) { LoaderAttachAndPush(loaderWaiting).SafeFireAndForget(); } }
private void ConstructLoaderAndDisplay(Task action, Color loaderColour, Color loaderPopupColour, List <string> reasonsForLoader, Color textColour) { LoaderViewModel loaderWaiting = ConstructLoaderModal(loaderColour, loaderPopupColour, reasonsForLoader, textColour); action.GetAwaiter().OnCompleted(() => Device.BeginInvokeOnMainThread(() => loaderWaiting.SafeCloseModal())); if (!action.IsCompleted && action.Status != TaskStatus.WaitingForActivation) { LoaderAttachAndPush(loaderWaiting).SafeFireAndForget(); } }
public InitializePage(IDialerService dialerService) { InitializeComponent(); var model = new LoaderViewModel(dialerService); model.Navigation = Navigation; BindingContext = model; }
public async Task <IActionResult> UploadFile(LoaderViewModel vm) { if (vm.File == null || vm.File.Length == 0) { //await Response.WriteAsync("<script>alert('Nie wybrano pliku!')</script>"); return(RedirectToAction("Loader", "Home", new { message = "Nie wybrano pliku!" })); } var user = await _userManager.GetUserAsync(HttpContext.User); if (CheckProjectNameAvailability(vm.ProjectName, user)) { //await Response.WriteAsync("<script>alert('Już stworzyłeś projekt o takiej samej nazwie!')</script>"); return(RedirectToAction("Loader", "Home", new { message = "Już stworzyłeś projekt o takiej samej nazwie!" })); } if (vm.ProjectName == null || vm.ProjectName == "") { vm.ProjectName = vm.File.GetFilename().Substring(0, vm.File.GetFilename().Length - 4); } var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/DoZatwierdzenia/", user.Id + vm.ProjectName + ".stl"); using (var stream = new FileStream(path, FileMode.Create)) { await vm.File.CopyToAsync(stream); } if (vm.IsPrivate == null) { vm.IsPrivate = "false"; } _context.Order.Add(new Order { Status = "Przyjęto", User = user, UserId = user.Id, UploadDate = DateTime.Now, Private = vm.IsPrivate.Equals("false"), Name = vm.ProjectName, Path = user.Id + vm.ProjectName + ".stl", UserScreenPath = "/images/" + user.Id + vm.ProjectName + "thumb.png" }); _context.SaveChanges(); var pathForStl = Path.Combine( Directory.GetCurrentDirectory(), "wwwroot\\DoZatwierdzenia\\", vm.ProjectName); DirectoryInfo d = new DirectoryInfo(pathForStl); //ForwardFiles(pathForStl, userOrder.Path); return(RedirectToAction("Loader", "Home", new { message = "Pomyślnie dodano projekt." })); }//Dominik
public MainWindow() { InitializeComponent(); string mutex_id = @"Global\" + appGuid; mutex = new Mutex(false, mutex_id); lm = new LoaderViewModel(new Loader()); DataContext = lm; Loaded += ToolWindow_Loaded; Loaded += CheckMutex; this.Closing += this.MainWindow_Closing; }
public MainWindow() { InitializeComponent(); NavigationManager.Initialize(this); Managers.Screens direction = AccountManager.CurrentUser != null ? Managers.Screens.Main : Managers.Screens.SignIn; NavigationManager.Navigate(direction); LoaderViewModel vmodel = new LoaderViewModel(); LoaderManager.Initialize(vmodel); DataContext = vmodel; Logger.Log("Application started."); }
private async Task LoaderAttachAndPush(LoaderViewModel loaderWaiting) { var popupModal = AttachViewModel(CreatePopupPage <LoaderPopupPage>(), loaderWaiting); await Device.InvokeOnMainThreadAsync(() => s_popupNavigation.PushAsync(popupModal)); }
public Loader() { InitializeComponent(); viewModel = new LoaderViewModel(); BindingContext = viewModel; }
private async Task LoaderAttachAndPush <TPopupPage>(LoaderViewModel loaderWaiting) where TPopupPage : PopupPage, IGenericViewModel <LoaderViewModel>, new() { var popupModal = AttachViewModel(CreatePopupPage <TPopupPage>(), loaderWaiting); await Device.InvokeOnMainThreadAsync(() => s_popupNavigation.PushAsync(popupModal)); }
public LoaderView(Guild guildData) { InitializeComponent(); DataContext = new LoaderViewModel(guildData); }
public LoadingFileCommand(LoaderViewModel viewModel, MainWindowViewModel mwvm) { this.loaderViewModel = viewModel; this.mwvm = mwvm; }
public MainWindow() { DataContext = new LoaderViewModel(); InitializeComponent(); }
public ViewModelBase() { _loader = new LoaderViewModel(); }