Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9008975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:04:36+00:00 2026-06-16T02:04:36+00:00

‘m making an application for Windows 8 in C# and XAML. I’ve defined two

  • 0

‘m making an application for Windows 8 in C# and XAML.

I’ve defined two classes within a namespace called AppNamespace, and one of these classes takes a three dimensional boolean array within it’s constructor:

    public class Solver
    {
        // Board is a class also in this namespace but I don't think the issue is 
        //there, so I've omitted it's definition
        private Board current;

        // You can see that the class clearly DOES take a parameter of the same type
        // as the array "content" (which is defined later)
        public Solver (bool[, ,] initial)
        {
            // The parameter is then used to construct a "Board" class within the
            // "Solver" class.
            current = new Board(initial);
        }

        // Several methods within the class
     }

So the definition can be seen above.

I’ve then created a new page on a gridapp called ‘NewPage.xaml’ and in that page there is are some textboxes which manipulate the values within the array. (There doesn’t seem to be an issue here)

Then in ‘NewPage.xaml.cs’ when the button is clicked, it should create an instance on the class, and then run a method within the class, at the top of the “NewPage.xaml.cs” I define a three dimensional array as seen below,

    // Declare the namespace where the class "Solver" is situated
    using App.Classes;

    namespace App
    {
        // So below is the C# part of the page "PuzzleSolver"
        public sealed partial class PuzzleSolver : App.Common.LayoutAwarePage
        { 
            // Create an array called content
            bool[, ,] content = new bool[9, 9, 9];

            public PuzzleSolver()
            {
                this.InitializeComponent();

                //Set every cell of the created content array to true
                for (int i = 0; i <= 8; i++)
                {
                    for (int j = 0; j <= 8; j++)
                    {
                        for (int k = 0; k <= 8; k++)
                        {
                            content[i, j, k] = true;
                        }
                    }
                }
            }

      /* There are some methods which change information in the array "Content" based on the
         stuff input into the XAML textboxes on the page. */


      // The below method is invoked when a XAML Button is clicked on the page
      // and I intend it to create a "Solver" object, using the "content" array
      // from this page as a parameter
      private void Button_Click_1(object sender, RoutedEventArgs e)
      {
        // So now I create the and pass in the "content" array
        Solver newSolve = new Solver(content);

        newSolve.Solve();
      }
}

The issue is, that the compiler recognises that “className” is a class, but says that it does not have a constructor which takes 1 parameter, and it also says:

“ProjectName.className does not contain a definition for “method and
no extension method “method” accepting a first argument of type
ProjectName.className could be found (are you missing a using
directive or assembly reference”

Can anyone identify where my issue is from this information?

I’ve edited this to show other namespace declarations, first the declarations on “Solver.xaml.cs”:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using App.Classes;

Now the declarations on “Solver.xaml”:

<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="App.Solver"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App"
    xmlns:common="using:App.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>
        <x:String x:Key="PageName">Solver</x:String>
    </Page.Resources>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:04:38+00:00Added an answer on June 16, 2026 at 2:04 am

    When you declare your instance, you’re using object as the variable name.

    className object = new className(content);
    object.method();
    

    This causes the compiler to get confused, since object is a reserved keyword (it always refers to System.Object).

    You should use a better name. However, you could use @ to use the reserved word, if you desire this:

    className anyNonReservedWord = new className(content);
    anyNonReservedWord.method();
    
    // Alternatively
    className @object = new className(content);
    @object.method();
    

    You do not show the declaration of method within your code, so that is difficult to decipher, though it’s likely due to the same issue.


    Edit after your edit:

    I’ve defined two classes within a namespace called AppNamespace

    Your PuzzleSolver class is in namespace App, not AppNamespace. While you don’t show your actual namespace for Solver, I suspect it’s a namespace mismatch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following tasks in my deploy.rb namespace :unicorn do desc stop unicorn
I'm taking a photo with my app, the delegate method is called, the Image
This is how I get the tags of a body of text. var tags
I have just tried to save a simple *.rtf file with some websites and
I'm running a Octopress blog which is based on Jekyll . Now I wanted
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.