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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:25:13+00:00 2026-06-12T08:25:13+00:00

I trying to create new class object that derivative from TextBox – If there

  • 0

I trying to create new class object that derivative from TextBox –
If there is chars in the TextBox – the new object will show some button and pressing on this button will be able to remove the chars in this TextBox

how can i make the derivative from control in WPF ?

  • 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-12T08:25:14+00:00Added an answer on June 12, 2026 at 8:25 am

    You could create a new UserControl with a textbox and a button. You bind a string property to the textbox and to the visibility-property of your button. Then you create a converter which converts this string to a visibility. Now you bind the Command-property of your button to a command which sets the string property = string.Empty.

    A few hints:

    How to use Converters:

    <UserControl.Resources>
        <local:StringToVisibilityConverter x:Key="STV"></local:StringToVisibilityConverter>
    </UserControl.Resources>
    <Button Visibility="{Binding Path=MyText, Converter={StaticResource ResourceKey=STV}}" />
    

    How your VM could look like:

    public class MainViewModel:ViewModelBase
    {
        private string _mytext;
        public string MyText
        {
            get
            {
                return _mytext;
            }
            set
            {
                _mytext = value;
                OnPropertyChanged("MyText");
            }
        }
    
        private RelayCommand<object> _clearTextCommand;
        public ICommand ClearTextCommand
        {
            get
            {
                if (_clearTextCommand == null)
                {
                    _clearTextCommand = new RelayCommand<object>(o => ClearText(), o => CanClearText());
                }
                return _clearTextCommand;
            }
        }
    
        private void ClearText()
        {
            MyText = string.Empty;
        }
    
        private bool CanClearText()
        {
            return true;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a Object class that will take data and create a
I'm trying create new object from a module class in VBA, and I have
I am trying to create a new class Dog that inherits via prototypical inheritance
I'm trying to create a Messages object that inherits Array. The messages will gather
I'm trying to create a new object that is related to two other models
I'm trying to create a twitter class and create an object that calls the
I have been trying to create a new raster object that contains only a
I am trying to create new variables inside a class after creating its object
I am trying to create a class that doesn't re-create an object with the
I'm trying to create a query object that contains information from 3 different entities.

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.