public MainWindow(ApplicationInitializer applicationInitializer) { this.RecentFilesList = new RecentFilesList(); InitializeComponent(); this.applicationInitializer = applicationInitializer; this.CommandBindings.Add(new CommandBinding(ApplicationCommands.New, New_Executed, New_Enabled)); this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Open, Open_Executed, Open_Enabled)); this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Save, Save_Executed, Save_Enabled)); this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, Close_Executed)); RecentFilesChanged(); this.RecentFilesList.RecentFiles.CollectionChanged += RecentFiles_CollectionChanged; }
public void Test_RecentFilesList_LifeCycle() { string recentFilesPath = ApplicationLocalStorageHelper.GetApplicationDataFilePath(RecentFilesList.RECENTFILESSTORENAME); if (File.Exists(recentFilesPath)) { File.Delete(recentFilesPath); } var recentFilesList1 = new RecentFilesList(); recentFilesList1.Add(@"c:\temp\test1"); var recentFilesList2 = new RecentFilesList(); Assert.AreEqual(1, recentFilesList2.RecentFiles.Count); }