Free Code Snippets in C#, Net Framework, Office 365, ASP.Net,WPF, Visual Studio, SQL Server, Antivirus free
#

 

 

Description: when adding a new UserControl the following error is displayed in the Mainpage:

 

Error message:

The name "UcSelection" does not exist in the namespace "using:Rename_Images_Videos_Folder.UserControls".

 

xmlns:uc="using:Rename_Images_Videos_Folder.UserControls"

..

<uc:UcSelection x:Name="ctlSelection" > </uc:UcSelection>

 

In a main form, the namespace was properly integrated and the UserControl itself. But nevertheless the error is indicated

<Page

    x:Class="Rename_Images_Videos_Folder.MainPage"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:local="using:Rename_Images_Videos_Folder"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    xmlns:uc="using:Rename_Images_Videos_Folder.UserControls"

    mc:Ignorable="d" >

 

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

..

 

        <Grid x:Name="gridHead" Grid.Row="0"  Margin="16,0,0,0">

..

            ..

            <TextBox  x:Name="tbxFolder" Grid.Column="1"   VerticalAlignment="Center"  VerticalContentAlignment="Center" Margin="40,0,0,0" 

                     KeyDown="tbxFolder_KeyDown" HorizontalAlignment="Stretch" 

                     >

            </TextBox>

            <uc:UcSelection x:Name="ctlSelection" ></uc:UcSelection>

            <Button x:Name="btnSelect" Grid.Column="2"     VerticalAlignment="Stretch" Background="Transparent" Click="btnSelect_Click"   >

..

        </Grid>

 

 

Reason:

There is an error in the control events in the integrated user control.

Here: KeyDown and SelectionChanged are not defined in the code.

 

Only the error-free definition of the Usercontrol events leads to the deletion of the error

 

Bug fix: in this case you have to click on Go To Definition at the events KeyDown and SelectionChanged.

This creates the event in the code-behind page

After recompiling, the error message has disappeared.

 

 

Events in the Codebehind Seiote

        private void tbxFolder_KeyDown(object sender, KeyRoutedEventArgs e)

        {

 

        }

 

        private void cbxSelection_SelectionChanged(object sender, SelectionChangedEventArgs e)

        {

 

        }

 

 

Severity

Code

Description

Project

File

Line

Suppression State

Error

 

The name "UcSelection" does not exist in the namespace "using:Rename_Images_Videos_Folder.UserControls".

Rename_Images_Videos_Folder

C:\_Daten\Desktop\VS_Projects\UWP\Rename_Images_Videos_Folder\Rename_Images_Videos_Folder\MainPage.xaml

28

 

 

Mobile
»
XAML: The name UserControl does not exist in the namespace
»
C #: FontIcon Glyph with Unicode characters
»
UWP: Insert IconIcon by Selection Image
»
UWP, XAML: Multiple values in a property set
»
UWP: Gridsplitter Code
»
UWP: Anzeige verschieben mit Projection
»
UWP: Clip Rectangle
»
UWP,XAML: Eigenständiges Scrollbar Element
»
UWP: IValueConverter Fehlermeldung bei UWP-WPF Code
»
UWP: Example Scrollbar vs Slider

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de