初始启动项目A有资源文件在app.xml加载为字典资源ResourceDictionary,其中有<Style x:key="buttonStyle".../>
在其它项目中想调用A中的字典资料,在xaml文件中写
<Button Style="{StaticResource buttonStyle}",设计器总提示找不到资源buttonStyle
怎么做才能正确引用呢
2楼:
我不太明白你的意思,我本来是做winform的,但有个项目要修改(WPF做的),其中整个程序集里有25个项目,在vs2008里,我们肯定有一个初始启动项,而在初始启动项里定义了一个资源(ResourceDictionary)这个资源文件会在app.xaml里加载成资源ResourceDictionary,其中资源文件里有一个button的样式设置,
在其它24个项目中的button都是用这个样式,但在Vs2008里查看设计器的时候直接用<Button Style="{StaticResource buttonStyle}",会提示找不到资源buttonStyle,
但运行起来是正确的,因为资源应该是静态的,运行起来后内存有了,这是找得到的,
但在转到设计器查看的时候就不行,我想问的是这个怎么在设计器中查看
注:那个样式不单是图片,还包括很多其它的颜色,大小,鼠标事件等