protected MultiFolderLibrary() : base(AppLocalFolderLibrary.Instance) { RootEmptyMessage = "The local MusicPimp library on this device is empty. To obtain music, add a local MP3 folder or a MusicPimp server."; AddLocalFolder = new AsyncUnitCommand(AddFolder); RemoveLocalFolder = new DelegateCommand <StoreLocalLibraryBase>(Remove); }
public EndpointEditorViewModel() { Tester = new EndpointTester(); Add = new AsyncUnitCommand(AddEndpoint); Cancel = new UnitCommand(Close); DisplayHelp = new UnitCommand(() => Send(MusicItemsBase.AppHelpHeader, MusicItemsBase.AppHelpMessage)); }
protected LockScreen() { GoToLockScreenSettings = new AsyncUnitCommand(async() => await Launcher.LaunchUriAsync(new Uri("ms-settings-lock:"))); RequestLockScreenAccess = new AsyncUnitCommand(async() => { await LockScreenRequest.RequestThenSetLockScreen(); CheckIsAppProvider(); }); }
public MusicActions() { AppBar = new AppBarController(); Selected = new ObservableCollection <MusicItem>(); Selected.CollectionChanged += (s, e) => SelectionChanged(); //DeleteSelected = new UnitCommand(() => DeleteAll(Selected)); PlaySelected = new AsyncUnitCommand(() => PlayAll(SelectedList)); AddSelected = new AsyncUnitCommand(() => AddToPlaylistRecursively(SelectedList)); DownloadSelected = new AsyncUnitCommand(() => PimpStoreDownloader.Instance.SubmitAll(SelectedList)); HandleMusicItemTap = new AsyncDelegateCommand <MusicItem>(item => { return(OnSingleMusicItemSelected(item)); }); }
public LimitsViewModel(LocalLibraryBase localLibrary, ISettingsManager settings) { LocalLibrary = localLibrary; Settings = settings; DeleteLocalCache = new AsyncUnitCommand(async() => { try { await LocalLibrary.DeleteAll(); await Utils.SuppressAsync <Exception>(ProviderService.Instance.MusicItemsBase.ResetAndRefreshRoot); } catch (Exception e) { Send("Unable to delete everything. Some track may be in use. Try again later. " + e.Message); } var t1 = CalculateConsumedGb(); }); }
public BasePlayer() { IsEventBased = false; IsSkipAndSeekSupported = true; PlayOrPause = new AsyncUnitCommand(OnPlayOrPause); SkipPrevious = new AsyncUnitCommand(OnPrev); SkipNext = new AsyncUnitCommand(OnNext); PlayPlaylistItem = new AsyncDelegateCommand <PlaylistMusicItem>(async item => { await WithExceptionEvents2(PlaybackStarted); await PlayIndex(item.Index); }); ToggleMute = new AsyncUnitCommand(async() => await HandleToggleMute(!IsMute)); PlayTrack = new AsyncDelegateCommand <MusicItem>(PlaySong); }
protected MusicItemsModel() : base(MultiFolderLibrary.Instance) { AppBar = new AppBarController(); Selected = new ObservableCollection <MusicItem>(); Selected.CollectionChanged += (s, e) => SelectionChanged(); StoreLibraryManager.Instance.ActiveEndpointChanged += async e => await ResetAndRefreshRoot(); MultiFolderLibrary.Instance.Libraries.CollectionChanged += async(s, e) => await ResetAndRefreshRoot(); DeleteSelected = new UnitCommand(() => DeleteAll(SelectedList)); PlaySelected = new AsyncUnitCommand(() => PlayAll(SelectedList)); AddSelected = new AsyncUnitCommand(() => AddToPlaylistRecursively(SelectedList)); AddEndpoint = new UnitCommand(() => PopupManager.Show(new AddEndpointPopup())); DownloadSelected = new AsyncUnitCommand(() => PimpStoreDownloader.Instance.SubmitAll(SelectedList)); Help = new HelpModel(); }
public MusicItemsBase(LocalMusicLibrary localLibrary) { musicFolder.IsLoading = true; LocalLibrary = localLibrary; DisplayHelp = new UnitCommand(() => Send(AppHelpHeader, AppHelpMessage)); Refresh = new AsyncUnitCommand(RefreshCurrentFolder); PlayAllItems = new AsyncDelegateCommand <IList>(items => { return(PlayAll(TypeHelpers.CollectionOf <MusicItem>(items))); }); ToPlaylistAllItems = new AsyncDelegateCommand <IList>(items => { return(AddToPlaylistRecursively(TypeHelpers.CollectionOf <MusicItem>(items))); }); HandleMusicItemTap = new AsyncDelegateCommand <MusicItem>(item => { return(OnSingleMusicItemSelected(item)); }); DeleteCommand = new DelegateCommand <MusicItem>(Delete); MusicItemToPlaylistCommand = new AsyncDelegateCommand <MusicItem>(AddToPlaylistRecursively); DeleteLocally = new AsyncDelegateCommand <MusicItem>(DeleteLocalItem); LibraryScrollPositions = new Dictionary <string, MusicItem>(); }
public TestModel() { RunTest = new AsyncUnitCommand(TestOutput); }
//Uri uri = new Uri("ws://desktop:9000/ws/open"); //SimpleWebSocket ws = new SimpleWebSocket(new Uri("ws://desktop:9000/ws/open"), "admin", "test", "application/json"); public TestViewModel() { RunTest = new AsyncUnitCommand(Test); CloseCommand = new UnitCommand(CloseTest); }