J'ai un UserControl comme ceci:WPF include ressources XamlParserException
<UserControl x:Class="LoginModule.LoginView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:UserControls;assembly=UserControls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<UserControl.Resources>
<ResourceDictionary Source="pack://application:,,,/UserControls;component/Styles.xaml" />
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<Label Grid.Row="1" Grid.Column="0" Name="labelLogin" VerticalAlignment="Center">Login:</Label>
<Label Grid.Row="2" Grid.Column="0" Name="labelPassword" VerticalAlignment="Center">Password:</Label>
<TextBox Grid.Row="1" Grid.Column="1" Name="textboxLogin" VerticalAlignment="Center"></TextBox>
<TextBox Grid.Row="2" Grid.Column="1" Name="textboxPassword" VerticalAlignment="Center"></TextBox>
<Button Grid.Row="3" Grid.ColumnSpan="2" Template="{StaticResource SilverButton}" Height="25" Width="200" Name="buttonLogin" Content="Log In" Click="buttonLogin_Click" />
</Grid>
</UserControl>
En tout mode concepteur est ok (œuvres de style), tous les bâtiments de solution avec succès. Mais quand je lance le programme avec debug je reçois dans XamlParserException:
<ResourceDictionary Source="pack://application:,,,/UserControls;component/Styles.xaml" />
avec un message comme: Impossible de charger UserControl oir l'un de ses éléments. Impossible de charger le fichier. J'ai référence à UserControl.dll Je ne sais pas ce qui se passe.
Merci pour toute aide rapide. Kamilos
est votre UserControl en utilisant un fichier XML pour l'analyse syntaxique .... Collez votre code de contrôle utilisateur si possible –