private void InitializeDataBindings() { TextBoxFilePath.DataBindings.Clear(); TextBoxFileName.DataBindings.Clear(); TextBoxMimeType.DataBindings.Clear(); AttachmentTypeComboBox.DataBindings.Clear(); if (_attachment == null) { return; } TextBoxFilePath.SetTextDataBinding(_attachment, nameof(_attachment.FilePath)); TextBoxFileName.SetTextDataBinding(_attachment, nameof(_attachment.Name)); TextBoxMimeType.SetTextDataBinding(_attachment, nameof(_attachment.Mimetype)); AttachmentTypeComboBox.SetSelectedItemDataBinding(_attachment, nameof(_attachment.AttachmentType)); }
private void TextBlockFilePath_PreviewMouseDown(object sender, MouseButtonEventArgs e) { TextBlockFilePath.Visibility = Visibility.Collapsed; TextBoxFilePath.Focus(); }