INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Abstract functionality of a window in WPF

Abstract functionality of a window in WPF

(OP)
I seem unable to derive a window from my own abstract class that derives from window.

My code worked great when I was using Windows Forms, I was told I should start using WPF and now I can't get it to work?

ProgressForm - Abstract class

CODE

namespace HLP_Class_Library
{
    public abstract class ProgressForm : Window
    {
        public abstract void AddMessage(string msg);
        public abstract void ClearMessage();
    }
} 

Progress_Info - Concrete window class derived from ProgressForm

CODE

namespace HLP_Class_Library
{
    /// <summary>
    /// Interaction logic for Progress_Info.xaml
    /// </summary>
    public partial class Progress_Info : ProgressForm
    {
        public Progress_Info()
        {
            InitializeComponent();
        }

        // add messages to form
        public override void AddMessage(string msg)
        {
            if (msg != null && msg != "")
            {
                this.Progress.AppendText(msg);
            }
        }

        // clear form messages
        public override void ClearMessage()
        {
            this.Progress.Document.Blocks.Clear();
        }
    }
} 

Progress_Info XAML

CODE

<src:ProgressForm 
        x:Class="HLP_Class_Library.Progress_Info"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:src="clr-namespace:HLP_Class_Library"
        Title="Progress_Info" Height="300" Width="300">
    <Grid>
        <RichTextBox x:Name="Progress" HorizontalAlignment="Left" Height="270" VerticalAlignment="Top" Width="292">
            <FlowDocument>
                <Paragraph>
                    <Run Text="RichTextBox"/>
                </Paragraph>
            </FlowDocument>
        </RichTextBox>

    </Grid>
</src:ProgressForm> 

Error

Quote:


The name "ProgressForm" does not exist in the namespace "clr-namespace:HLP_Class_Library".

Yes it does, intelisense even provided me the option?

What am I doing wrong? This was easy in WinForm, I'm clearly missing something obvious in WPF.

Thanks,
1DMF

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

RE: Abstract functionality of a window in WPF

(OP)
It's OK, what I have seems to be correct, it was another error causing an assembly to not compile and therefore couldn't see the class!

This WPF/XAML is going to take a little getting used to!

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close