Reputation: 609
I am trying to initialize array of Uri.
Can anyone tell me how to initialize array of type Uri in c#?
I have tried initializing like string but it shows some error.
Upvotes: 0
Views: 3601
Reputation: 3331
If you are looking for an array then
Uri UriArray=new Uri[]{new Uri("/MainPage.xaml",UriKind.RelativeOrAbsolute)};
else, You Can use List
List<Uri> uriList=new List<Uri>();
uriList.Add(new Uri("/MainPage.xaml",UriKind.RelativeOrAbsolute));
Upvotes: 0
Reputation: 2778
List is another option to use URI. Here is the example to create a list of type Uri, May this will help you.
List<Uri> listUri = new List<Uri>();
listUri.Add(new Uri(""));
Upvotes: 2