public PartViewModel( IScreen hostScreen, Part part) : base(hostScreen) { _part = part ?? new Part(); Id = _part.Id; _libaryBuilder = Locator.Current.GetRequiredService <ILibraryBuilder>(); _libaryReader = Locator.Current.GetRequiredService <ILibraryReader>(); _partRepository = Locator.Current.GetRequiredService <IPartRepository>(); _settingsService = Locator.Current.GetRequiredService <ISettingsProvider>(); GoBack = ReactiveCommand.CreateFromTask(ExecuteGoBackAsync); var canCloneOrDelete = this.WhenAnyValue(vm => vm.Id) .Select(id => !string.IsNullOrEmpty(id)); Clone = ReactiveCommand.Create(ExecuteClone, canCloneOrDelete); Delete = ReactiveCommand.CreateFromTask(ExecuteDeleteAsync, canCloneOrDelete); Save = ReactiveCommand.CreateFromTask(ExecuteSaveAsync); DiscardChangesConfirmation = new Interaction <Unit, bool>(); DeletePartConfirmation = new Interaction <Unit, bool>(); }
public void Setup() { _libraryBuilderStub = MockRepository.GenerateStub<ILibraryBuilder<Song>>(); }
public static void Construct(ILibraryBuilder libraryBuilder) { libraryBuilder.BuildTrackList(); libraryBuilder.BuildPlaylists(); }
public SongSelector(ILibraryBuilder<Song> libraryBuilder) { _libraryBuilder = libraryBuilder; _library = _libraryBuilder.BuildLibrary(ConfigSettings.PathToXml); // TODO - fix this shit! }