Пример #1
0
        public MainWindow(ITrackFactory trackFactory, IAppDataPersister <Library.Model.Library> libraryPersister)
        {
            _trackFactory     = trackFactory;
            _libraryPersister = libraryPersister;

            InitializeComponent();

            // Defaults
            Left   = Settings.Default.MainWindowLeft;
            Top    = Settings.Default.MainWindowTop;
            Width  = Settings.Default.MainWindowWidth;
            Height = Settings.Default.MainWindowHeight;
            MainGrid.ColumnDefinitions.First(c => c.Name == "NavigationColumn").Width = new GridLength(20, GridUnitType.Star);
            MainGrid.ColumnDefinitions.First(c => c.Name == "ContentColumn").Width    = new GridLength(80, GridUnitType.Star);

            Closing += MainWindow_Closing;

            _filesPath = @"M:\VA";
            _library   = _libraryPersister.Load(LibraryFileName) ?? new Library.Model.Library();
            BindLibrary();

            _mediaPlayer        = new WindowsMediaPlayer();
            _mediaPlayer.Volume = .5d;
        }
Пример #2
0
        public MainWindow(ITrackFactory trackFactory, IAppDataPersister<Library.Model.Library> libraryPersister)
        {
            _trackFactory = trackFactory;
            _libraryPersister = libraryPersister;

            InitializeComponent();

            // Defaults
            Left = Settings.Default.MainWindowLeft;
            Top = Settings.Default.MainWindowTop;
            Width = Settings.Default.MainWindowWidth;
            Height = Settings.Default.MainWindowHeight;
            MainGrid.ColumnDefinitions.First(c => c.Name == "NavigationColumn").Width = new GridLength(20, GridUnitType.Star);
            MainGrid.ColumnDefinitions.First(c => c.Name == "ContentColumn").Width = new GridLength(80, GridUnitType.Star);

            Closing += MainWindow_Closing;

            _filesPath = @"M:\VA";
            _library = _libraryPersister.Load(LibraryFileName) ?? new Library.Model.Library();
            BindLibrary();

            _mediaPlayer = new WindowsMediaPlayer();
            _mediaPlayer.Volume = .5d;
        }