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 8491099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:18:59+00:00 2026-06-10T22:18:59+00:00

Im a complete Noob to this so im having a really hard time wrapping

  • 0

Im a complete Noob to this so im having a really hard time wrapping my head around how this works.

Basically I have a Main Page that im using, and within the XAML i have created a menu

What I have is a Document (DummyDoc) that contains a TextBox within it that i am trying to send the find command to.

Ive tried this every which way and googled it but i just cant seem to get it to work for me and could use some help with a push in the right direction

Main form

 <Window>

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="clr-namespace:DMC_Robot_Editor"
        xmlns:local="clr-namespace:DMC_Robot_Editor.GUI" 

    <Menu>
    <MenuItem Header="_Edit">
     <MenuItem Header="_Cut"/>
    </MenuItem>
    <MenuItem/>
    <Grid>
     <local:DummyDoc x:Name="_Editor"/>
    </Grid>
    </Window>

That is the main form that i am using. then i have my second document “DummyDoc”

<ad:DocumentContent x:Name="document" x:Class="DMC_Robot_Editor.Controls.DummyDoc"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
        xmlns:local="clr-namespace:DMC_Robot_Editor.Controls" 
        xmlns:ed="schemas.microsoft.com/expression/2010/drawing"
        Title="Window1" Height="300" Width="300"
        IsVisibleChanged="Is_VisibleChanged"  PropertyChanged="document_PropertyChanged">
    <Grid>

        <Menu >
            <MenuItem Header="_File">
                <MenuItem Header="was here"/>
            </MenuItem>

        </Menu>
        <local:Editor x:Name="source" IsVisibleChanged="Is_VisibleChanged" TextChanged="TextChanged" UpdateFunctions="raiseupdated" />
        <local:Editor x:Name="data" Visibility="Hidden"  IsVisibleChanged="Is_VisibleChanged" TextChanged="TextChanged"      UpdateFunctions="raiseupdated"/>
    </Grid>
    </ad:DocumentContent>

DummyDoc is a window that has an Inherited Editor in it.

<avalonedit:TextEditor
             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:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit" 
             x:Class="DMC_Robot_Editor.Controls.Editor" 
             x:Name="editor"
             mc:Ignorable="d" 
             d:DesignHeight="300"
    d:DesignWidth="300" 

    TextChanged="Text_Changed"
    IsVisibleChanged="raiseUpdate"
    MouseMove="Mouse_Move"
    MouseHover="Mouse_Hover"

    MouseHoverStopped="Mouse_Hover_Stopped" KeyUp="editor_KeyUp">


    </avalonedit:TextEditor> 

My Ultimate Question is how do i use WPF Binding to make the “Cut” Action from the main form initiate the cut() method of the textbox?

I wrote textbox in it because in code behind, im doing the following

  partial class DummyDoc:DocumentContent
    {
    public Editor TextBox{get;set;}
     private void Is_VisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (sender is Editor)
                this.TextBox = sender as Editor;

            if ((VisibilityChanged != null) && (TextBox != null))
                raiseupdated(TextBox, new FunctionEventArgs(this.TextBox.Text));
        }
    }
  • 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-10T22:19:00+00:00Added an answer on June 10, 2026 at 10:19 pm

    ElementName looks up elements by looking for an element which is using the string identifier you specify.

    Did you put x:Name="local:TextBox" on your TextBox tag?

    I think you’ve got your wires crossed by using “local:TextBox”.

    For starters…that is the syntax used to refer to an element type within a namespace …. it means “the type TextBox in the local namespace”…..it’s not valid (or rather doesn’t mean the same) in the context you are using….you should just assign an “identifier” string.

    So….

    CommandTarget="{Binding ElementName=textboxFind}"
    

    …

    <TextBox x:Name="textboxFind"  ..... />
    

    would be more appropriate.


    UPDATE (in light of question being clarified):

    You should specify a “Command” in your menu item which will get raised when you choose that menu item.

    Then if the TextEditor has the focus (…and thus is the command target…)….then it should see the Cut command.

    I would expect the Avalon Editor to be able to handle the well know “ApplicationCommands” i.e. Cut, Copy, Paste, etc.

    <MenuItem Header="_Cut" Command="ApplicationCommands.Cut">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Playing around with jQuery a bit (sorry, complete noob) I was wondering why this
I'm using PHP, also a complete noob at it. So I have this URL
I'm a complete noob with dynamically allocated memory. Will this have a memory leak
This is a question from a complete noob. I have the following code: nb='([-
I am a complete Noob when it comes to GIT. I have been just
I'm a complete noob in java. I still really don't know how to code.
I'm a complete Codeigniter noob. I think I have everything setup properly, and the
I have been looking into CruiseControl configuration recently (I'm a complete CC noob) and
I'm a complete noob to jquery and jquery ui but have successfully implemented a
This is a complete noob question, but I gotta ask it anyway I started

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.