Invalid URI: The format of the URI could not be determined - C#

前端 未结 3 2042
醉酒成梦
醉酒成梦 2020-12-19 12:17

Im trying to set the source of a resource dictionary in c# to a location of a folder within the project, but get the above error.

Could someone advise what the issue

3条回答
  •  -上瘾入骨i
    2020-12-19 13:22

    You have to use UriKind.Relative

    myResourceDictionary.Source = new Uri("../Resources/Styles/Shared.xaml",  UriKind.Relative);
    

提交回复
热议问题