Hello i am using text file which contains some paragraphs
the text file is like below text's contain
example:-
1. "People often say that motivation doesn't last. Well, neither does bathing -- that's why we recommend it daily." -Zig Ziglar
2. "Someday is not a day of the week." -Denise Brennan-Nelson
3. "Hire character. Train skill." -Peter Schutz
4. "Your time is limited, so don't waste it living someone else's life." -Steve Jobs
5. "Sales are contingent upon the attitude of the salesman -- not the attitude of the prospect." -W. Clement Stone
6. "Everyone lives by selling something." -Robert Louis Stevenson
7. "If you are not taking care of your customer, your competitor will." -Bob Hooey
8. "The golden rule for every businessman is this: Put yourself in your customer's place." -Orison Swett Marden
9. "If you cannot do great things, do small things in a great way." -Napoleon Hill
like these what i need is when i read the entirefile i need to display in text block if read a whole file and store in a list while display in text block i dont know how to break the line in between and to start from next line and what i need to do if i want to stop at 4th quotes or 5th.
What I have tried:
<TextBlock x:Name="ReviewBlock" Grid.Row="1" Margin="0,40,0,0" Width="500" Text="{Binding Review}" FontSize="14" FontWeight="Medium" Foreground="White" ></TextBlock>
.cs code is
public void ReviewReadng()
{
var MyList = new List<string>();
string filePath = System.IO.Path.GetFullPath(System.IO.Path.Combine(System.Reflection.Assembly.GetExecutingAssembly().Location, @"../"));
filePath += "Reviewfile.txt";
if (File.Exists(filePath))
{
StreamReader Textfile = new StreamReader(filePath);
string line;
while ((line = Textfile.ReadLine()) != null)
{
Console.WriteLine(line);
MyList.Add(line);
}
}
String Review = MyList[0];
ReviewBlock.Text = Review;
}