Exemplo n.º 1
0
 public CWValidateScanViewModel(ApplicationContext context, Window view)
 {
     this.ValidateCommand = new DelegateCommand(ValidateAction, canValidate);
     this.CancelCommand = new DelegateCommand(CancelAction, canCancel);
     this.Context = context;
     this.View = view;
 }
Exemplo n.º 2
0
        public FridgeScannerViewModel(ApplicationContext context)
        {
            this.StartCommand = new DelegateCommand(StartAction, canStart);
            this.StopCommand = new DelegateCommand(StopAction, canStop);
            this.Context = context;
            this.RecognizedProducts = new List<Product>();
            this.LoadVisible = false;

            this.Context.HostWindow.PageTitle.Text = "Analyser le contenu de votre réfrigérateur";
        }
Exemplo n.º 3
0
        public RecipesViewModel(ApplicationContext context)
        {
            this.ClickCommand = new DelegateCommand(ClickAction, canClick);
            this.Context = context;
            this.UserProducts = UserProductsRepo.GetByUserId(this.Context.ApplicationUser.ID);
            this.ListProducts = new List<Product>();
            foreach (var product in this.UserProducts)
                this.ListProducts.Add(ProductRepo.GetById(product.IdProduct));

            this.ListRecettes = RecetteRepo.GetRecetteFromProducts(this.ListProducts);
        }
Exemplo n.º 4
0
        public BrowserViewModel(ApplicationContext context)
        {
            this.Context = context;
            this.ListCategory = CategRepo.GetAll().Select(o => new Pair<bool, Category>(false, o)).ToList().ToObservableCollection();
            this.AllUserProducts = UserProductsRepo.GetByUserId(context.ApplicationUser.ID).ToObservableCollection();
            this.MapProducts();
            this.Copy = new ObservableCollection<Pair<bool, Category>>();

            this.Context.HostWindow.PageTitle.Text = "Explorer le contenu de votre réfrigérateur";
            this.SelectedItem = this.ListCategory.First();
        }
Exemplo n.º 5
0
        public MenuViewModel(ApplicationContext context)
        {
            this.Context = context;

            Tiles = new ObservableCollection<TileModel>()
            {
                new TileModel(TileIdentity.ExploreContent) { Text = "Explorer le contenu", TileType = TileType.Website, Context = this.Context },
                new TileModel(TileIdentity.ScanContent) { Text = "Scanner le contenu", TileType = TileType.Application, Context = this.Context },
                new TileModel(TileIdentity.Recipes) { Text = "Recettes", TileType = TileType.Tile, Context = this.Context  },
                new TileModel(TileIdentity.Settings) { Text = "Réglages", TileType = TileType.Browser, Context = this.Context  }
            };
        }
        public CWUnrecognizedProductViewModel(ApplicationContext context, string fileName, Window view, string ean13)
        {
            ImageSource = new BitmapImage();
            ImageSource.BeginInit();
            ImageSource.UriSource = new Uri(fileName);
            ImageSource.EndInit();

            this.FilterCommand = new DelegateCommand(FilterAction, canFilter);
            this.CloseCommand = new DelegateCommand(CloseAction);
            this.ValidateCommand = new DelegateCommand(ValidateAction, canValidate);

            this.View = view;
            this.AllProducts = ProductRepo.GetAll().OrderBy(o => o.Libelle).ToList();
            this.EanCode = ean13;
        }
Exemplo n.º 7
0
        public MainWindow()
        {
            InitializeComponent();
            DataContext = this;

            Context = new ApplicationContext();
            Context.HostWindow = this;

            this.CloseCommand = new DelegateCommand(CloseApp, canClose);
            this.PreviousCommand = new DelegateCommand(LoadPrevious, canLoadPrevious);
            this.PreviousView = null;
            this.IsLogged = false;

            LoginView lv = new LoginView(Context);
            this.StackContent.Children.Add(lv);
        }
 public AccountManagementViewModel(ApplicationContext context)
 {
     this.UpdateFirstNameCommand = new DelegateCommand(UpdateFirstNameAction, canUpdateFirstName);
     this.UpdateNameCommand = new DelegateCommand(UpdateNameAction, canUpdateName);
     this.UpdateMailCommand = new DelegateCommand(UpdateMailAction, canUpdateMail);
     this.SaveCommand = new DelegateCommand(SaveAction, canSave);
     this.Context = context;
     this.UserName = this.Context.ApplicationUser.Nom;
     this.UserFirstName = this.Context.ApplicationUser.Prenom;
     this.UserMail = this.Context.ApplicationUser.Mail;
     this.ListDevices = this.DeviceRepo.GetByUserId(this.Context.ApplicationUser.ID).ToObservableCollection();
     this.FNameEnabled = false;
     this.MailEnabled = false;
     this.NameEnabled = false;
     this.Context.HostWindow.PageTitle.Text = "Gérer votre compte";
 }
Exemplo n.º 9
0
 public FridgeScannerView(ApplicationContext context)
 {
     InitializeComponent();
     _viewModel = new FridgeScannerViewModel(context);
     this.DataContext = _viewModel;
 }
Exemplo n.º 10
0
 public MenuView(ApplicationContext context)
 {
     InitializeComponent();
     viewModel = new MenuViewModel(context);
     this.DataContext = viewModel;
 }
Exemplo n.º 11
0
 public AccountManagementView(ApplicationContext context)
 {
     InitializeComponent();
     _viewModel = new AccountManagementViewModel(context);
     this.DataContext = _viewModel;
 }
Exemplo n.º 12
0
 public CWUnrecognizedProduct(ApplicationContext context, string fileName, string ean13)
 {
     InitializeComponent();
     _viewModel = new CWUnrecognizedProductViewModel(context, fileName, this, ean13);
     this.DataContext = _viewModel;
 }
Exemplo n.º 13
0
 public RecipesView(ApplicationContext context)
 {
     InitializeComponent();
     _viewModel = new RecipesViewModel(context);
     this.DataContext = _viewModel;
 }
Exemplo n.º 14
0
 public BrowserView(ApplicationContext context)
 {
     InitializeComponent();
     _viewModel = new BrowserViewModel(context);
     this.DataContext = _viewModel;
 }
Exemplo n.º 15
0
 public CWValidateScanView(ApplicationContext context)
 {
     InitializeComponent();
     _viewModel = new CWValidateScanViewModel(context, this);
     this.DataContext = _viewModel;
 }