Esempio n. 1
0
        public ControlBarUC()
        {
            InitializeComponent();
            var vm = new ControlBarViewModel();

            this.DataContext = vm;
        }
Esempio n. 2
0
        public MainWindow(int id)
        {
            InitializeComponent();
            NetVideoEntities db = new NetVideoEntities();

            CustomerInfo cus = db.CustomerInfoes.FirstOrDefault(c => c.AccountId == id);

            controlBarVM               = new ControlBarViewModel();
            controlBarVM.CusName       = cus.FirstName + " " + cus.LastName;
            controlBarVM.IdAccount     = id;
            controlBarMain.DataContext = controlBarVM;

            List <VideoInfo> l = db.VideoInfoes.ToList();

            ListVideoViewModel lvMyList = new ListVideoViewModel();

            lvMyList.TitleList     = "My list";
            lvMyList.List          = new ObservableCollection <VideoInfo>(l);
            listMyList.DataContext = lvMyList;

            ListVideoViewModel lvTrending = new ListVideoViewModel();

            lvTrending.TitleList     = "Trending now";
            lvTrending.List          = new ObservableCollection <VideoInfo>(l.Where(p => p.HotLevel == 2).ToList());
            listTrending.DataContext = lvTrending;

            var                  minValue = db.VideoInfoes.Min(x => x.HotLevel);
            VideoInfo            v        = db.VideoInfoes.Where(x => x.HotLevel == minValue).FirstOrDefault();
            DetailVideoViewModel d        = new DetailVideoViewModel();

            d.BindingDetail(v.Id, videoHot);
        }
Esempio n. 3
0
        /// <summary>
        /// Initialize Visual Browser
        /// Load all necessary data
        /// </summary>
        protected override async Task Initialize()
        {
            try
            {
                _currentMobileConfiguration = await _mobileConfigurationDataService.GetCurrentMobileConfiguration();

                Buttons             = VisualBrowserViewModelBuilder.CreateButtonsViewModel(_currentMobileConfiguration, ShowCategory).ToList();
                TopCategories       = VisualBrowserViewModelBuilder.CreateCategoriesViewModel(_currentMobileConfiguration.TopCategories, _navigateToMediaCommand, IsInternalModeEnable, SubCategorySelectionAction);
                ControlBarViewModel = new ControlBarViewModel(_dialogService, SettingsDataService, _mobileAppConfigDataService, _currentMobileConfiguration, _userSessionService, _contactsService, _presentationDataService, _syncLogService);
                ExpandedCategories  = new ObservableCollection <CategoryViewModel>();
                SearchViewModel     = new SearchControlViewModel(_documentInfoDataService, _searchContentDataService, _navigationService, _navigateToMediaCommand);

                if (_orientation.HasValue)
                {
                    RefreshButtons(_orientation.Value);
                    GetAllCategoryContent().ForEach(c => c.HandleOrientation(_orientation.Value));
                }

                await LoadBackgroundImage();

                if (_orientation.HasValue)
                {
                    BackgroundImage = ResolveBackgroundImage(_orientation.Value);
                }
            }
            catch (Exception e)
            {
                PlatformAdapter.SendToCustomLogger(e, LoggingLevel.Error);
                // Report error here
            }
        }
 public ControlBarUC()
 {
     InitializeComponent();
     this.DataContext = Viewmodel = new ControlBarViewModel();
 }
Esempio n. 5
0
 public MainUserControl()
 {
     InitializeComponent();
     this.DataContext = Vm = new ControlBarViewModel();
 }
Esempio n. 6
0
 public ControlBarUC()
 {
     InitializeComponent();
     this.DataContext = ViewModel = new ControlBarViewModel();// gán từ chính giữa ra bên phải rồi tới bên trái
 }
Esempio n. 7
0
 public ControlBarUC()
 {
     InitializeComponent();
     this.DataContext = ViewModel = new ControlBarViewModel();  /// Mỗi thằng 1 view model riêng
 }
 public ControlBarUC()
 {
     InitializeComponent();
     // Cần tạo da các datacontex Viewmodel khác nhau, vì tránh trường hợp mỗi form sử dụng chung một model.
     this.DataContext = ViewModel = new ControlBarViewModel();
 }
Esempio n. 9
0
 public ControlBarUC()
 {
     InitializeComponent();
     this.DataContext = Viewmodel = new ControlBarViewModel(); //để mỗi thằng xài controlbar dùng viewmodel riêng
 }
Esempio n. 10
0
 public ControlBar()
 {
     InitializeComponent();
     viewModel        = new ControlBarViewModel();
     this.DataContext = viewModel;
 }
Esempio n. 11
0
 public UserControl_ControlBar()
 {
     InitializeComponent();
     ViewModel        = new ControlBarViewModel();
     this.DataContext = ViewModel;
 }