Hi,
We have copied PartEditBox ControlTemplate:
<Style x:Key="{x:Type editors:PartEditBox}" TargetType="{x:Type editors:PartEditBox}">
Added reference to below style in our application
<Style x:Key="smallContentControlSizeInt32EditBox" TargetType="{x:Type editors:Int32EditBox}" BasedOn="{StaticResource {x:Type editors:PartEditBox}}">
We are getting below error in application
“System.Windows.Markup.XamlParseException occurred
Message='Provide value on 'System.Windows.StaticResourceExtension' threw an exception.' Line number '220' and line position '40'.
Source=PresentationFramework
LineNumber=220
LinePosition=40
StackTrace:
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at StreamEditor.PropertyPage.Controls.Audio_Input_ACP.InitializeComponent() in d:\SVN_Views\NMX7.4a\NMX\Projects\GUI.NET\StreamEditor\ctlProperties\Controls\Promedia\Audio_Input_ACP.xaml:line 1
at StreamEditor.PropertyPage.Controls.Audio_Input_ACP..ctor() in d:\SVN_Views\NMX7.4a\NMX\Projects\GUI.NET\StreamEditor\ctlProperties\Controls\Promedia\Audio_Input_ACP.xaml.cs:line 24
InnerException:
Message=Cannot find resource named 'smallContentControlSizeInt32EditBox'. Resource names are case sensitive.
Source=PresentationFramework
StackTrace:
at System.Windows.StaticResourceExtension.ProvideValue(IServiceProvider serviceProvider)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)
InnerException:”
InnerException is::
Message=Cannot find resource named 'smallContentControlSizeInt32EditBox'. Resource names are case sensitive.
We have checked the style key name and it is mentioned correctly.
Also want to know if we change control template in PartEditBox will it work for
• • int32EditBox
• • timespaneditBox
• • doubleEditBox
Will below code in PartEditBox style will override default background properties if control is disabled.
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding IsUpdated}" Value="True">
<Setter Property="Background" Value="Yellow" />
</DataTrigger>
</ControlTemplate.Triggers>
Thanks,
Piyush