Inexplicit "Unknown member UserControl.DesignWidth" on certain UserControls.
I'm at a loss on where this is coming from. It says "Unknown member UserControl.DesignWidth/DesignHeight" when certain UserControls are shown. Here is an example UserControl that has this appear:
This UserControl usually has around 400 lines of XAML, but removed and reimproted does not fix the errors. Removing the design width/height will fix these errors. Are there any apparent reasons why this would happen?
Code: Select all
<UserControl
x:Class="Empis.Unity.Views.Matchmaking"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Empis.Unity.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
x:Name="xRoot"
d:DesignHeight="1000"
d:DesignWidth="2000"
mc:Ignorable="d">
<Grid>
</Grid>
</UserControl>
Code: Select all
#if UNITY_5_3_OR_NEWER
#define NOESIS
using Noesis;
using Empis.Unity.ViewModels;
#else
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
#endif
namespace Empis.Unity.Views
{
public partial class Matchmaking : UserControl
{
public Matchmaking()
{
this.InitializeComponent();
}
#if NOESIS
void InitializeComponent()
{
Noesis.GUI.LoadComponent(this, "Assets/Project/Views/Resources/Matchmaking.xaml");
}
#endif
}
}
-
sfernandez
Site Admin
- Posts: 2997
- Joined:
Re: Inexplicit "Unknown member UserControl.DesignWidth" on certain UserControls.
The problem is that our xaml parser is unable to ignore d:DesignWidth/Height properties until it parses attribute mc:Ignorable="d", that is defined later.
You can change the order of attributes as the following code to workaround that right now, we will try to fixt it for our next release.
You can change the order of attributes as the following code to workaround that right now, we will try to fixt it for our next release.
Code: Select all
<UserControl
x:Class="Empis.Unity.Views.Matchmaking"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Empis.Unity.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
x:Name="xRoot"
mc:Ignorable="d"
d:DesignHeight="1000"
d:DesignWidth="2000">
<Grid>
</Grid>
</UserControl>
Re: Inexplicit "Unknown member UserControl.DesignWidth" on certain UserControls.
Oh, I see! It seems XAML Styler decided to start forcing the design width/height before ignornable which is why this problem came out of nowhere for me. I set the order in which they appear and now it's fixed. Thanks for the help!
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 43 guests