Skip to content

Commit

Permalink
Added hint text to NullableBoolDisplay.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Aug 31, 2024
1 parent 3018489 commit f80643a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
10 changes: 10 additions & 0 deletions WpfDataUi/Controls/NullableBoolDisplay.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
<RadioButton x:Name="TrueRadioButton" Checked="TrueRadioButton_Checked">True</RadioButton>
<RadioButton x:Name="FalseRadioButton" Checked="FalseRadioButton_Checked">False</RadioButton>
<RadioButton x:Name="NullRadioButton" Checked="NullRadioButton_Checked">None</RadioButton>

<TextBlock x:Name="HintTextBlock"
Padding="8,1,8,0"
TextWrapping="Wrap"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Width="{Binding ElementName=TopRowGrid, Path=ActualWidth, Mode=OneWay}"
FontSize="10" Text="This is a property description. But what if it is longer?" />


</StackPanel>
</GroupBox>
</UserControl>
3 changes: 2 additions & 1 deletion WpfDataUi/Controls/NullableBoolDisplay.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ public void Refresh(bool forceRefreshEvenIfFocused = false)
{
bool wasSet = false;
wasSet = TrySetValueOnUi(valueOnInstance) == ApplyValueResult.Success;

}

HintTextBlock.Visibility = !string.IsNullOrEmpty(InstanceMember?.DetailText) ? Visibility.Visible : Visibility.Collapsed;
HintTextBlock.Text = InstanceMember?.DetailText;

GroupBox.Header = InstanceMember?.DisplayName ?? InstanceMember?.Name;

Expand Down
6 changes: 3 additions & 3 deletions WpfDataUi/Controls/TextBoxDisplay.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
HorizontalAlignment="Left"
VerticalAlignment="Top"
Width="{Binding ElementName=TopRowGrid, Path=ActualWidth, Mode=OneWay}"
FontSize="10">
This is a property description. But what if it is longer?
</TextBlock>
FontSize="10" Text="This is a property description. But what if it is longer?"/>


</StackPanel>
</UserControl>

0 comments on commit f80643a

Please sign in to comment.