Итак, сегодня я снова начал свой каркасный проект WPF. net. Но это начинается с проблемы
Ошибка CS0234 Тип или имя пространства имен 'Страницы' не существует в пространстве имен.
Но это странно, потому что вчера у меня не было проблем, и если я попробуйте запустить его в любом случае, игнорируя ошибку, она запустится нормально и все работает.
Так как я могу прекратить получать это сообщение об ошибке? потому что программа работает. И папка Pages существует
ZendersPage.xaml
<Page x:Class="Kraeken_en_Krønen_HKS_FO.ZendersPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Kraeken_en_Krønen_HKS_FO"
mc:Ignorable="d"
d:DesignHeight="720" d:DesignWidth="1080"
Title="ZendersPage"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="#FF3F3F46"
FontFamily="{DynamicResource MaterialDesignFont}">
<Grid Background="#FF3F3F46">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<StackPanel Margin="10,10,10,0">
<materialDesign:Card Background="#FF3F3F46">
<StackPanel Orientation="Vertical">
<Label Content="Zender toevoegen" FontSize="20px" Foreground="White" Margin="10,0,0,0"/>
<Label Content="Zender" Foreground="White" FontSize="20px" Margin="10,20,0,0"/>
<TextBox Foreground="White" FontSize="20px" Background="#FF62626A" Height="30px" Margin="10,0,0,0" x:Name="NewZenderNaam"/>
<Label Content="Omschrijving" Foreground="White" FontSize="20px" Margin="10,20,0,0"/>
<TextBox Foreground="White" FontSize="20px" Background="#FF62626A" Height="30px" Margin="10,0,0,0" x:Name="NewZenderOmschrijving"/>
<Button HorizontalAlignment="Left" Margin="10,20,0,10" Click="CreateNewZender" >
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="SendOutline" Width="20px" Height="25px"/>
<Label VerticalAlignment="Center" FontSize="15px" Foreground="#DDFFFFFF">Toevoegen</Label>
</StackPanel>
</Button>
</StackPanel>
</materialDesign:Card>
</StackPanel>
</Grid>
<Grid Grid.Row="0" Grid.RowSpan="4">
<WrapPanel x:Name="WijzigZenderPanel" Panel.ZIndex="205"/>
</Grid>
<Grid Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Center">
<WrapPanel x:Name="ExtraZender" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Row="2" VerticalAlignment="Top" HorizontalAlignment="Center">
<WrapPanel x:Name="ExtraZender1" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Row="3" VerticalAlignment="Top" HorizontalAlignment="Center">
<WrapPanel x:Name="ExtraZender2" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Row="4" VerticalAlignment="Top" HorizontalAlignment="Center">
<WrapPanel x:Name="ExtraZender3" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Row="4" VerticalAlignment="Top" HorizontalAlignment="Center">
<WrapPanel x:Name="ExtraZender4" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Row="4" VerticalAlignment="Top" HorizontalAlignment="Center">
<WrapPanel x:Name="ExtraZender5" HorizontalAlignment="Center"/>
</Grid>
</Grid>
using Kraeken_en_Krønen_HKS_FO.Pages;
using Kraeken_en_Krønen_HKS_FO.UserControls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Kraeken_en_Krønen_HKS_FO
{
/// <summary>
/// Interaction logic for ZendersPage.xaml
/// </summary>
///
class ZenderInformation
{
private static string ZenderTitel = "";
public static string ZenderTitelText
{
get { return ZenderTitel; }
set { ZenderTitel = value; }
}
private static string ZenderOmschrijving = "";
public static string ZenderOmschrijvingText
{
get { return ZenderOmschrijving; }
set { ZenderOmschrijving = value; }
}
private static int i = 0;
public static int y
{
get { return i; }
set { i = value; }
}
private static int ZenderCount = 0;
public static int ZenderCounter
{
get { return ZenderCount; }
set { ZenderCount = value; }
}
}
public partial class ZendersPage : Page
{
Zenders zendersClass = new Zenders();
int gridCount = 0;
int totalCount;
public ZendersPage()
{
InitializeComponent();
try
{
zendersClass.GetAllChannels();
PlaceZendersInGrid();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
private void CreateNewZender(object sender, RoutedEventArgs e)
{
try
{
if (NewZenderNaam.Text != string.Empty && NewZenderOmschrijving.Text != string.Empty)
{
ZenderInformation.ZenderTitelText = NewZenderNaam.Text;
ZenderInformation.ZenderOmschrijvingText = NewZenderOmschrijving.Text;
zendersClass.UpdateDbWithNewZenders();
ExtraZender.Children.Clear();
ExtraZender1.Children.Clear();
ExtraZender2.Children.Clear();
ExtraZender3.Children.Clear();
ExtraZender4.Children.Clear();
ExtraZender5.Children.Clear();
PlaceZendersInGrid();
NewZenderNaam.Text = String.Empty;
NewZenderOmschrijving.Text = String.Empty;
}
else
{
MessageBox.Show("Geen zender informatie ingevoerd");
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
public void PlaceZendersInGrid()
{
try
{
zendersClass.GetAllChannels();
foreach (var zender in ZenderNames.MusicZenders)
{
ZenderInformation.ZenderCounter++;
}
while (gridCount < ZenderInformation.ZenderCounter)
{
if (gridCount <= ZenderInformation.ZenderCounter)
{
for (ZenderInformation.y = 0; ZenderInformation.y < 3; ZenderInformation.y++)
{
NewZenderLayout newZenderLayout = new NewZenderLayout();
newZenderLayout.NewZender.Text = ZenderNames.MusicZenders[ZenderInformation.y].ToString();
newZenderLayout.NewOmschrijving.Text = ZenderNames.Musicdescription[ZenderInformation.y].ToString();
newZenderLayout.Name = "zender" + ZenderNames.ZendersId[ZenderInformation.y];
ExtraZender.Children.Add(newZenderLayout);
totalCount = gridCount + 1;
gridCount = totalCount;
}
if (gridCount <= ZenderInformation.ZenderCounter)
{
for (ZenderInformation.y = 3; ZenderInformation.y < 6; ZenderInformation.y++)
{
NewZenderLayout newZenderLayout = new NewZenderLayout();
newZenderLayout.NewZender.Text = ZenderNames.MusicZenders[ZenderInformation.y].ToString();
newZenderLayout.NewOmschrijving.Text = ZenderNames.Musicdescription[ZenderInformation.y].ToString();
newZenderLayout.Name = "zender" + ZenderNames.ZendersId[ZenderInformation.y];
ExtraZender1.Children.Add(newZenderLayout);
totalCount = gridCount + 1;
gridCount = totalCount;
}
if (gridCount <= ZenderInformation.ZenderCounter)
{
for (ZenderInformation.y = 6; ZenderInformation.y < 9; ZenderInformation.y++)
{
NewZenderLayout newZenderLayout = new NewZenderLayout();
newZenderLayout.NewZender.Text = ZenderNames.MusicZenders[ZenderInformation.y].ToString();
newZenderLayout.NewOmschrijving.Text = ZenderNames.Musicdescription[ZenderInformation.y].ToString();
newZenderLayout.Name = "zender" + ZenderNames.ZendersId[ZenderInformation.y];
ExtraZender2.Children.Add(newZenderLayout);
totalCount = gridCount + 1;
gridCount = totalCount;
}
if (gridCount <= ZenderInformation.ZenderCounter)
{
for (ZenderInformation.y = 9; ZenderInformation.y < 12; ZenderInformation.y++)
{
NewZenderLayout newZenderLayout = new NewZenderLayout();
newZenderLayout.NewZender.Text = ZenderNames.MusicZenders[ZenderInformation.y].ToString();
newZenderLayout.NewOmschrijving.Text = ZenderNames.Musicdescription[ZenderInformation.y].ToString();
newZenderLayout.Name = "zender" + ZenderNames.ZendersId[ZenderInformation.y];
ExtraZender3.Children.Add(newZenderLayout);
totalCount = gridCount + 1;
gridCount = totalCount;
}
if (gridCount <= ZenderInformation.ZenderCounter)
{
for (ZenderInformation.y = 12; ZenderInformation.y < 15; ZenderInformation.y++)
{
NewZenderLayout newZenderLayout = new NewZenderLayout();
newZenderLayout.NewZender.Text = ZenderNames.MusicZenders[ZenderInformation.y].ToString();
newZenderLayout.NewOmschrijving.Text = ZenderNames.Musicdescription[ZenderInformation.y].ToString();
newZenderLayout.Name = "zender" + ZenderNames.ZendersId[ZenderInformation.y];
ExtraZender4.Children.Add(newZenderLayout);
totalCount = gridCount + 1;
gridCount = totalCount;
}
if (gridCount <= ZenderInformation.ZenderCounter)
{
for (ZenderInformation.y = 15; ZenderInformation.y < 18; ZenderInformation.y++)
{
NewZenderLayout newZenderLayout = new NewZenderLayout();
newZenderLayout.NewZender.Text = ZenderNames.MusicZenders[ZenderInformation.y].ToString();
newZenderLayout.NewOmschrijving.Text = ZenderNames.Musicdescription[ZenderInformation.y].ToString();
newZenderLayout.Name = "zender" + ZenderNames.ZendersId[ZenderInformation.y];
ExtraZender5.Children.Add(newZenderLayout);
totalCount = gridCount + 1;
gridCount = totalCount;
}
}
}
}
}
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}