David Jefferies
Topic Author
Posts: 27
Joined: 14 Jan 2021, 17:09

Error thrown when defining multiple Ignorable prefixes

27 Feb 2024, 17:04

We want to have two Ignorable prefixes - the usual prefix 'd' and also 'design_only'

In Blend the syntax appears to be
mc:Ignorable="d design_only">
<Viewbox x:Name="RootViewbox"  Opacity="0" design_only:Opacity="1">
However Noesis gives the error
 Prefix 'design_only' is not defined
Am I missing a step or is multiple ignorable prefixes not supported?
 
User avatar
jsantos
Site Admin
Posts: 3925
Joined: 20 Jan 2012, 17:18
Contact:

Re: Error thrown when defining multiple Ignorable prefixes

28 Feb 2024, 11:11

The prefixes in the Ignorable section must be declared too. Something like this works
<Grid
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:design_only="ignorableUri"
  mc:Ignorable="d design_only">

  <StackPanel>
    <d:TextBlock>ONE</d:TextBlock>
    <design_only:TextBlock>TWO</design_only:TextBlock>
    <TextBlock>THREE</TextBlock>
  </StackPanel>
</Grid>
 
David Jefferies
Topic Author
Posts: 27
Joined: 14 Jan 2021, 17:09

Re: Error thrown when defining multiple Ignorable prefixes

28 Feb 2024, 13:10

Thanks for the reply - I see now the problem was that I was declaring both the prefixes to be the same
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:design_only="http://schemas.microsoft.com/expression/blend/2008" 
By changing the design_only prefix to be some other Uri, as in your example, it now works
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:design_only="ignorableUri"
thanks!

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 10 guests