Shared project with resource dictionary (xaml)

前端 未结 3 1601
长发绾君心
长发绾君心 2021-01-13 12:59

I am looking for a way to share ResourceDictionary between projects.

Adding new item to shared project doesn\'t offer resource dictionary. It can be crea

3条回答
  •  孤独总比滥情好
    2021-01-13 13:33

    This issue is that you are putting the application name. You need the project name. Below is how to do it in both XAML and code

    
        
            
                
            
        
    
    

    Or

    var dictionary = new ResourceDictionary();
    dictionary.Source = new Uri("/SharedProject1;component/Dictionary2.xaml", UriKind.Relative);
    

提交回复
热议问题