diff --git a/src/MainDemo.Wpf/FieldsLineUp.xaml b/src/MainDemo.Wpf/FieldsLineUp.xaml index cc16ac9768..31ac840478 100644 --- a/src/MainDemo.Wpf/FieldsLineUp.xaml +++ b/src/MainDemo.Wpf/FieldsLineUp.xaml @@ -108,6 +108,7 @@ + diff --git a/src/MainDemo.Wpf/FieldsLineUp.xaml.cs b/src/MainDemo.Wpf/FieldsLineUp.xaml.cs index 5ad4bcacac..510c9e0414 100644 --- a/src/MainDemo.Wpf/FieldsLineUp.xaml.cs +++ b/src/MainDemo.Wpf/FieldsLineUp.xaml.cs @@ -52,6 +52,8 @@ public FieldsLineUp() control.Margin = new Thickness(2, 10, 2, 10); if (control is ComboBox comboBox) comboBox.SetBinding(ComboBox.IsEditableProperty, new Binding(nameof(CheckBox.IsChecked)) { ElementName = nameof(IsEditableCheckBox) }); + if (control is TextBoxBase tb) + tb.SetBinding(TextBoxBase.IsReadOnlyProperty, new Binding(nameof(CheckBox.IsChecked)) { ElementName = nameof(IsReadOnlyCheckBox) }); SetValue(control); } } diff --git a/src/MaterialDesign3.Demo.Wpf/FieldsLineUp.xaml b/src/MaterialDesign3.Demo.Wpf/FieldsLineUp.xaml index ed90c7fa03..3f9e2f15a0 100644 --- a/src/MaterialDesign3.Demo.Wpf/FieldsLineUp.xaml +++ b/src/MaterialDesign3.Demo.Wpf/FieldsLineUp.xaml @@ -97,6 +97,7 @@ + diff --git a/src/MaterialDesign3.Demo.Wpf/FieldsLineUp.xaml.cs b/src/MaterialDesign3.Demo.Wpf/FieldsLineUp.xaml.cs index 84dfec9f58..094f7c70c6 100644 --- a/src/MaterialDesign3.Demo.Wpf/FieldsLineUp.xaml.cs +++ b/src/MaterialDesign3.Demo.Wpf/FieldsLineUp.xaml.cs @@ -52,6 +52,8 @@ public FieldsLineUp() control.Margin = new Thickness(2, 10, 2, 10); if (control is ComboBox comboBox) comboBox.SetBinding(ComboBox.IsEditableProperty, new Binding(nameof(CheckBox.IsChecked)) { ElementName = nameof(IsEditableCheckBox) }); + if (control is TextBoxBase tb) + tb.SetBinding(TextBoxBase.IsReadOnlyProperty, new Binding(nameof(CheckBox.IsChecked)) { ElementName = nameof(IsReadOnlyCheckBox) }); SetValue(control); } } diff --git a/src/MaterialDesignThemes.Wpf/Converters/FloatingHintInitialHorizontalOffsetConverter.cs b/src/MaterialDesignThemes.Wpf/Converters/FloatingHintInitialHorizontalOffsetConverter.cs index c9bf535f65..19981575c5 100644 --- a/src/MaterialDesignThemes.Wpf/Converters/FloatingHintInitialHorizontalOffsetConverter.cs +++ b/src/MaterialDesignThemes.Wpf/Converters/FloatingHintInitialHorizontalOffsetConverter.cs @@ -41,7 +41,7 @@ double GetLeftOffset() when prefixHintBehavior == PrefixSuffixHintBehavior.AlignWithText && isEditable => prefixWidth + prefixMargin.Right, PrefixSuffixVisibility.WhenFocusedOrNonEmpty - when prefixHintBehavior == PrefixSuffixHintBehavior.AlignWithPrefixSuffix && !isEditable => + when prefixHintBehavior == PrefixSuffixHintBehavior.AlignWithPrefixSuffix && !isEditable && prefixWidth > 0 => -(prefixWidth + prefixMargin.Right), PrefixSuffixVisibility.Always when prefixHintBehavior == PrefixSuffixHintBehavior.AlignWithPrefixSuffix => @@ -58,7 +58,7 @@ double GetRightOffset() when suffixHintBehavior == PrefixSuffixHintBehavior.AlignWithText && isEditable => -(suffixWidth + suffixMargin.Left), PrefixSuffixVisibility.WhenFocusedOrNonEmpty - when suffixHintBehavior == PrefixSuffixHintBehavior.AlignWithPrefixSuffix && !isEditable => + when suffixHintBehavior == PrefixSuffixHintBehavior.AlignWithPrefixSuffix && !isEditable && suffixWidth > 0 => suffixWidth + suffixMargin.Left, PrefixSuffixVisibility.Always when suffixHintBehavior == PrefixSuffixHintBehavior.AlignWithPrefixSuffix =>