question about reading from xaml files.

Feb 26 2014 8:06 AM

Hello Guys.

I have this situation.

 

I have such a window, where the names of Topics are beiing generated from .xaml files, like this

the names of topics are being generated by this code

var fileNames = Directory.GetFiles(Environment.CurrentDirectory, "Topic?.xaml");             this.Topics = new List<Topic>();             foreach (var fileName in fileNames)             {                 var topic = new Topic();                 using (FileStream fs = new FileStream(fileName, FileMode.Open))                 {                     var page = (Page)XamlReader.Load(fs);                     topic.Page = page;                 }                  this.Topics.Add(topic);             }

Now , for example the topic1.xaml file is this.


Now, I want when the appropriate Topic is clicked, for example Topic 2, the topic2.xaml is opening in new window, and if 3-rd is clicked the topic3.xaml is showing on new window. 

Thanks guys for any help.

Romo


Answers (1)