我有一个解决方案,其中有许多WPF应用程序和类库项目。我想在另一个WPF应用程序中Resources文件夹下的另一个项目中使用图标。我怎样才能做到这一点?我不想在所有不同的项目中一遍又一遍地复制相同的图像。
我已经列入财产清单:
public List<Pair> PairList {get;set;}
Run Code Online (Sandbox Code Playgroud)
并从一些函数设置它的值,然后我将此列表复制到另一个列表:
List<Pair> newPairList =new List<Pair>(PairList);
Run Code Online (Sandbox Code Playgroud)
我在一些函数中使用了newPairList,它在newPairList中设置了一些值
somefunc(newPairList)
{
newPairList.stringVal ="xxxxx";
}
public class Pair
{
public int intVal;
public string key;
public string stringVal;
public string ValType;
public Pair(string key, int val);
public Pair(string key, string val);
}
Run Code Online (Sandbox Code Playgroud)
实际问题:如果在newPairList中有任何更新,它将自动在PairList中更新.如何防止主要属性PairList没有更新?