예제 #1
0
        public SectionBaseViewModel(
            Func <IDataSource> getGeDataSource,
            IConnectionListener connectionListener,
            IPlaylistsSevice playlistService,
            Action <bool> changeProgressIndicator = null)
            : base(getGeDataSource, connectionListener, changeProgressIndicator)
        {
            if (getGeDataSource == null)
            {
                throw new ArgumentNullException("getGeDataSource");
            }
            if (connectionListener == null)
            {
                throw new ArgumentNullException("connectionListener");
            }

            _getDataSource      = getGeDataSource;
            _connectionListener = connectionListener;
            _connectionListener.Subscribe(this);
            _playlistService = playlistService;

            _hasItems         = true;
            _isLargeItems     = SettingsHelper.GetIsLargeItems();
            _loadMoreCommand  = new Common.RelayCommand(LoadMore);
            _itemClickCommand = new RelayCommand <NavigationObject>(NavigateTo);
            _selectCommand    = new Common.RelayCommand(SelectItems);
            _deleteCommand    = new Common.RelayCommand(DeleteItems);
            _selectedItems    = new ObservableCollection <NodeViewModelBase>();
            //_isConnected = connectionListener.CheckNetworkAvailability();

            Items = new ObservableCollection <NodeViewModelBase>();
            IsItemClickEnabled = true;
        }
        // Konstruktør
        public EventViewModel()
        {
            DateTime dt = System.DateTime.Now;

            Date     = new DateTimeOffset(dt.Year, dt.Month, dt.Day, 0, 0, 0, 0, new TimeSpan());
            Time     = new TimeSpan(dt.Hour, dt.Minute, dt.Second);
            Instance = EventCatalogSingleton.Instance;

            CreateEventCommand = new Common.RelayCommand(AddNewEvent);
            LoadList           = new Common.RelayCommand();
            SaveList           = new Common.RelayCommand(Persistency.PersistencyService.SaveEventsAsJsonAsync);
        }
예제 #3
0
        public EventViewModel()
        {
            DateTime dt = System.DateTime.Now;

            Date = new DateTimeOffset(dt.Year, dt.Month, dt.Day, 0, 0, 0, 0, new TimeSpan());
            Time = new TimeSpan(dt.Hour, dt.Minute, dt.Second);
            eh   = new MyEventHandler(this);
            CreateEventCommand = new Common.RelayCommand(eh.CreateEvent);
            DeleteEventCommand = new Common.RelayCommand(eh.DeleteEvent, DeleteEventCanExecute);
            SelectedEvent      = new Event();
            EventObs           = new ObservableCollection <Event>();
            EventObs           = EventCatalogSingleton.Instance.Events;
        }
 public NavigationPanelViewModel(Func <IDataSource> getDataSource, IConnectionListener connectionListener, IPurchase purchase)
 {
     _getDataSource      = getDataSource;
     _connectionListener = connectionListener;
     _purchase           = purchase;
     _loginCommand       = new Common.RelayCommand(Login);
     _logoutCommand      = new Common.RelayCommand(Logout);
     _homeCommand        = new Common.RelayCommand(Home);
     _settingsCommand    = new Common.RelayCommand(Settings, CanSettings);
     _searchCommand      = new Common.RelayCommand(Search);
     _channelCommand     = new RelayCommand <string>(LoadChannel);
     _donateCommand      = new Common.RelayCommand(ViewDonate);
     Title = AppResources.ApplicationTitle;
 }
예제 #5
0
        //ctor
        public GuestViewModel()
        {
            //laver instancer af vores handler samt obs af gæst

            GuestHandler   = new Handler.GuestHandler(this);
            GuestColletion = new ObservableCollection <Guest>();
            GuestColletion = Singleton.Instance.GuestCollection;

            //vi sætter null fordi den gerne vil ha en bool men da der ikke er nogle i vores relaycommand sætter vi "intet"
            PostGuestCommand = new Common.RelayCommand(GuestHandler.AddGuest, null);
            PutGuestCommand  = new Common.RelayCommand(GuestHandler.PutGuest, null);
            DeleteCommand    = new Common.RelayCommand(GuestHandler.DeleteGuest, null);


            VisMinGuest = new ObservableCollection <Guest>();
            VisMinGuest = GuestColletion;
        }
예제 #6
0
 public ProfileSectionViewModel(Func <IDataSource> getDatasource, IConnectionListener connectionListener)
 {
     _getDataSource        = getDatasource;
     _connectionListener   = connectionListener;
     _subscriptionsCommand = new RelayCommand <FrameworkElement>(Subscriptions);
     _historyCommand       = new RelayCommand <FrameworkElement>(GetHistory);
     _recommendedCommand   = new RelayCommand <FrameworkElement>(Recommended);
     _videoCategoryCommand = new RelayCommand <FrameworkElement>(VideoCategories);
     _likedCommand         = new RelayCommand <FrameworkElement>(Liked);
     _uploadedCommand      = new RelayCommand <FrameworkElement>(Uploaded);
     _myPlaylistsCommand   = new RelayCommand <FrameworkElement>(MyPlaylists);
     _loginCommand         = new Common.RelayCommand(Login);
     _logoutCommand        = new Common.RelayCommand(Logout);
     _getDataSource().Subscribe(this);
     _connectionListener.Subscribe(this);
     _loginStatus = LoginStatus.NotLogged;
 }