c# compile conflict inconsistent modifiers

WPFTools is a small window with very few action but I'm making a mistake somewhere !
In the WPFTools class the compiler detects a conflict in defining the class.

This class appears in two files copied hereunder

XAML File:
<Window x:Class="VSR.CoachLab.Capture.WPF.App.WPFTools"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="WPF Tools" Height="700" Width="500">
    <Grid>
        <Button Content="Reboot all sensors" Name="button1" HorizontalAlignment="Left" Height="40" Margin="40,73,0,0" VerticalAlignment="Top" Width="122"/>
        <Button Content="Stop all sensors" Name="button2" HorizontalAlignment="Left" Height="40" Margin="40,139,0,0" VerticalAlignment="Top" Width="122"/>
        
    </Grid>
</Window>

Open in new window


Corresponding code behind C# file
using System;
using System.Collections.Generic;
using System.Data;
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.Shapes;

namespace VSR.CoachLab.Capture.WPF.App
{
    /// <summary>
    /// Logique d'interaction pour WPFTools.xaml
    /// </summary>
     internal partial class WPFTools : Window
    {
        IEngine Engine;
        
        internal WPFTools()
        {
            InitializeComponent();
        }

        internal  WPFTools(WPFCaptureManager capture_manager)
            : this()
        {
            Engine = capture_manager.CaptureEngine;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Engine.RebootAllSensors();
            }
            catch (Exception ex)
            {
                //MessageBoxResult.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnStopAll_Click(object sender, EventArgs e)
        {
            try
            {
                Engine.SwitchOffAllSensors();
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

    }
}

Open in new window


Thanks for the help
PaulagierResearch DirectorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
What is the exact error message?
PaulagierResearch DirectorAuthor Commented:
Translated from french : Partial declarations of  'VSR.CoachLab.Capture.WPF.App.WPFTools' generates a conflict because of access modifiers
käµfm³d 👽Commented:
You either need to change the class within the code-behind from internal to public:

public partial class WPFTools : Window

Open in new window


...OR you need to modify the XAML by adding in a "x:ClassModifier" attribute with value of internal:

<Window x:Class="VSR.CoachLab.Capture.WPF.App.WPFTools"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="WPF Tools" Height="700" Width="500"
        x:ClassModifier="internal">

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.