ButtonEdit
De Banane Atomic
Aller à la navigationAller à la recherche
Click
<dxe:ButtonEdit ToolTip="Mon ToolTip" DefaultButtonClick="ButtonEdit_DefaultButtonClick"> <dxe:ButtonEdit.EditValue> <Binding Path="MaPropriété" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged"> <Binding.ValidationRules> <ExceptionValidationRule /> </Binding.ValidationRules> </Binding> </dxe:ButtonEdit.EditValue> </dxe:ButtonEdit> |
Command
<dxe:ButtonEdit ToolTip="Mon ToolTip" AllowDefaultButton="False"> <dxe:ButtonEdit.EditValue> <Binding Path="MaPropriété" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged"> <Binding.ValidationRules> <ExceptionValidationRule /> </Binding.ValidationRules> </Binding> </dxe:ButtonEdit.EditValue> <dxe:ButtonInfo ClickMode="Release" GlyphKind="Regular" Command="{Binding Path=MaCommande}"/> </dxe:ButtonEdit> |
Modifier le texte seulement via le bouton
<dxe:ButtonEdit IsTextEditable="False"> </dxe:ButtonEdit> |
Avec OpenFileDialog
<dxe:ButtonEdit DefaultButtonClick="ButtonEdit_DefaultButtonClick" IsTextEditable="False" Text="{Binding Path=FilePath}" /> |
private void ButtonEdit_DefaultButtonClick(object sender, RoutedEventArgs e) { var buttonEdit = sender as ButtonEdit; var ofd = new OpenFileDialog() { RestoreDirectory = true, Filter = "Fichiers XML|*.xml;*.xaml|All Files|*.*" }; if (ofd.ShowDialog(this) == true && File.Exists(ofd.FileName)) { buttonEdit.EditValue = ofd.FileName; } } |