akohan
asked on
xaml error message
hello group,
I am working on a xaml file (WPF) and keep running into this error message.
{"'Provide value on 'System.Windows.StaticReso urceExtens ion' threw an exception.' Line number '6' and line position '9'."}
What is causing this? I'm using default xml name spaces. I will appreciate it if you let me know.
Thanks,
amit
I am working on a xaml file (WPF) and keep running into this error message.
{"'Provide value on 'System.Windows.StaticReso
<Window x:Class="myproject.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowStartupLocation="CenterScreen"
Title="MainWindow"
Height="850" Width="1000">
What is causing this? I'm using default xml name spaces. I will appreciate it if you let me know.
Thanks,
amit
please provide complete xaml.
ASKER
Sure. here is the xaml file I'm getting error as:
'Provide value on 'System.Windows.StaticReso urceExtens ion' threw an exception.' Line number '22' and line position '10'.
'Provide value on 'System.Windows.StaticReso
<Window x:Class="akohan.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:akohan"
xmlns:c="clr-namespace:akohan.Controls"
WindowStartupLocation="CenterScreen"
Title="MainWindow"
Height="850" Width="1000">
<Window.Resources>
<ContextMenu x:Key="DesignerCanvasContextMenu">
<MenuItem Header="Paste" Command="{x:Static ApplicationCommands.Paste}">
<MenuItem.Icon>
<Image Source="/akohan;component/Resources/image/Paste.png" Width="16"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Select All" Command="{x:Static s:DesignerCanvas.SelectAll}"/>
</ContextMenu>
</Window.Resources>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentControl Content="{StaticResource MyToolbar}"/>
<Grid Grid.Row="1" Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="265"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!-- Toolbox -->
<StackPanel Grid.Column="0" Margin="0,0,5,0">
<Expander Header="set 1" IsExpanded="True"/>
<Expander Header="set 2" Content="{StaticResource ShapeStencils}" IsExpanded="True"/>
</StackPanel>
<!-- GridSplitter-->
<GridSplitter Focusable="False" Width="2" Background="LightGray" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
<!-- Designer -->
<GroupBox Header="Canvas" Grid.Column="1" Margin="3,0,0,0">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<s:DesignerCanvas Focusable="True" x:Name="MyDesigner" Background="{StaticResource windowBackgroundBrush}" Margin="10" FocusVisualStyle="{x:Null}" ContextMenu="{StaticResource DesignerCanvasContextMenu}" />
</ScrollViewer>
</GroupBox>
</Grid>
</Grid>
</Window>
For static resource, you should define it before reference to it (dynamic resource doesn't have this limitation). you could place the resources "MyToolbar" in the Resources section of the Window (Window.xaml) or the application (App.xaml).
ASKER
Thanks Apeter,
Can you tell me how I can do that? any link that discusses it? something that will walk me step by step.
Thanks.
Can you tell me how I can do that? any link that discusses it? something that will walk me step by step.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!