Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClearTextButtonBehavior to acheive a better handling #1809

Merged
merged 2 commits into from
Feb 20, 2015

Conversation

punker76
Copy link
Member

sometimes the TextBoxHelper loaded methods for TextBox, PasswordBox and ComboBox doesn't work correct.

so this PR should fix this and should not a braking change :-D

Closes #1268

@punker76
Copy link
Member Author

^^ @thoemmi @flagbug
/cc @JoeRobich @fuzzylee @arnoldpa @gilimak

@punker76 punker76 added this to the 1.1.0 milestone Feb 19, 2015
the IsClearTextButtonBehaviorEnabled sets the button click event if its
set to true
punker76 added a commit that referenced this pull request Feb 20, 2015
ClearTextButtonBehavior to acheive a better handling
@punker76 punker76 merged commit 8ff92e5 into master Feb 20, 2015
@arnoldpa
Copy link

Works fine for me.

On short question: is the behavior wanted that after TextBoxHelper.ButtonCommand executed Control.Clear() get executed too?

@punker76
Copy link
Member Author

@arnoldpa you have different scenarios (e.g. for a TextBox)

  1. a MetroTextBox with ClearTextButton="True": it clears the text
<TextBox Controls:TextBoxHelper.ClearTextButton="True" />
  1. a MetroTextBox with ClearTextButton="True" and button command: it fires the command and clears the text
<TextBox Controls:TextBoxHelper.ClearTextButton="True"
         Controls:TextBoxHelper.ButtonCommand="{Binding TextBoxButtonCmd, Mode=OneWay}" />
  1. a SearchMetroTextBox or MetroButtonTextBox with ClearTextButton="True" and button command: it fires the command and clears the text
<TextBox Controls:TextBoxHelper.ClearTextButton="True"
         Controls:TextBoxHelper.ButtonCommand="{Binding TextBoxButtonCmd, Mode=OneWay}" />
  1. a SearchMetroTextBox or MetroButtonTextBox with ClearTextButton="False" and button command: it fires only the command
<TextBox Controls:TextBoxHelper.ClearTextButton="False"
         Controls:TextBoxHelper.ButtonCommand="{Binding TextBoxButtonCmd, Mode=OneWay}" />

@arnoldpa
Copy link

thank you, now its clear for me :)

@punker76 punker76 deleted the 1268-ClearTextButton-Behavior branch February 25, 2015 19:01
@JobaDiniz
Copy link

Hi, how can I show the button in the textbox, but replace the clear command entirely?
I want only my command to be fired, that is, textbox text should not be cleared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants