xaml - WPF Why does design view fail if I move my window and app into a subfolder of visual studio -


<lineargradientbrush x:key="maroongradientbrush" endpoint="0,1" startpoint="0,0">   <gradientstop color="#ff0c0b0b" offset="1"/>   <gradientstop color="#ffbf5656"/> </lineargradientbrush> 

<window    x:class="graphviewerwindow"   renderoptions.edgemode="unspecified"   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   xmlns:daedalusgraphviewer="clr-namespace:daedalusgraphviewer"   title="window1" height="900" width="900">   <textbox background="{staticresource maroongradientbrush}" /> </window> 

the program opens window correct gradient brush. however, design view still doesn't load window because can't find maroongradientbrush.

edit:

found problem. exactly:

how move app.xaml , not break designer?

but there isn't posted solution it

your xaml wrong. that's why it's not working

put these app.xaml in following manner:

<application ...>    <application.resources>         <resourcedictionary>             <resourcedictionary.mergeddictionaries>                <resourcedictionary source="resourcedictionaries/graphviewerbrushes.xaml" />                <resourcedictionary source="resourcedictionaries/graphviewertreeviewresources.xaml" />                <resourcedictionary source="resourcedictionaries/signalscrollviewerresources.xaml" />                <resourcedictionary source="resourcedictionaries/validationerrorresources.xaml" />                <resourcedictionary source="resourcedictionaries/graphviewertoolbarresources.xaml" />                <resourcedictionary source="resourcedictionaries/savedresourcesimightuse.xaml" />             </resourcedictionary.mergeddictionaries>        </resourcedictionary>    </application.resources> </application>   

if put these resources each usercontrol of app, create horrendous memory hog.

staticresources should work fine. way in projects , never had problems. if resources stored in external assemblies (pack://applicaton, etc)


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -