wpf - Using UserControl.Resources -
wpf - Using UserControl.Resources -
i've got problem while using usercontrol.resources. maintain encounter error message "the file 'resources\resource.xaml' not part of project or 'build action' property not set 'resource'.
i've search through forums looks i've done has been stated in sample. somehow error still there , style embedded in resource failed applied controls. below codes :
<usercontrol x:class="client.navigationcontrol" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:client" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" horizontalalignment="left" verticalalignment="top" d:designheight="59" d:designwidth="349" mc:ignorable="d"> <usercontrol.resources> <resourcedictionary> <resourcedictionary.mergeddictionaries> <resourcedictionary source="resources\resource.xaml" /> </resourcedictionary.mergeddictionaries> </resourcedictionary> </usercontrol.resources> <grid name="grid1" width="341" height="54" horizontalalignment="stretch" verticalalignment="stretch"> <button name="button2" width="97" height="35" margin="106,10,0,0" horizontalalignment="left" verticalalignment="top" command="{binding buttonresponsesection}" commandparameter="responsesection" content="responsesection" style="{dynamicresource glassbutton}" /> </grid> </usercontrol> please help :-(..
make sure build action of resource.xaml set page.
furthermore see, if relative uri "resources\resource.xaml" correct.
as illustration uri syntax suppose usercontrol navigationcontrol living in namespace called client , namespace client contained in namespace called app. if app contain namespace resources , resource.xaml reside in namespace right uri ../resources/resource.xaml.
wpf xaml user-controls
Comments
Post a Comment