Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit b03fd50

Browse files
committed
Fix the visibility converter
Yeah, this is silly... the CountToVisibilityConverter had its logic backwards because it was being used to show textblocks with "XXX required" messages in the publish control if those fields were not filled out... which is why we have PromptTextBox controls to use! Fix silliness.
1 parent 08a9d24 commit b03fd50

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

src/GitHub.UI/Converters/CountToVisibilityConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class CountToVisibilityConverter : ValueConverterMarkupExtension<CountToV
1515
{
1616
public override object Convert(object value, Type targetType, [AllowNull] object parameter, [AllowNull] CultureInfo culture)
1717
{
18-
return ((int)value == 0) ? Visibility.Visible : Visibility.Collapsed;
18+
return ((int)value > 0) ? Visibility.Visible : Visibility.Collapsed;
1919
}
2020
}
2121
}

src/GitHub.VisualStudio/UI/Views/Controls/RepositoryPublishControl.xaml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,36 +94,26 @@
9494
</ComboBox>
9595

9696
<Grid>
97-
<TextBox x:Name="nameText"
97+
<ui:PromptTextBox x:Name="nameText"
9898
Height="23"
9999
Margin="0"
100100
Background="{DynamicResource GitHubVsSearchBoxBackground}"
101101
Foreground="{DynamicResource GitHubVsWindowText}"
102102
MaxLength="{x:Static cache:Constants.MaxRepositoryNameLength}"
103-
Text="{Binding RepositoryName}" />
104-
105-
<TextBlock Margin="7,4,0,0"
106-
Foreground="{DynamicResource GitHubVsGrayText}"
107-
IsHitTestVisible="False"
108-
Text="{x:Static prop:Resources.RepoNameText}"
109-
Visibility="{Binding ElementName=nameText, Path=Text.Length, Converter={ui:CountToVisibilityConverter}}" />
103+
Text="{Binding RepositoryName}"
104+
PromptText="{x:Static prop:Resources.RepoNameText}" />
110105
</Grid>
111106

112107
<Grid>
113-
<TextBox x:Name="description"
108+
<ui:PromptTextBox x:Name="description"
114109
Height="52"
115110
Margin="0,8,0,0"
116111
AcceptsReturn="True"
117112
Background="{DynamicResource GitHubVsSearchBoxBackground}"
118113
Foreground="{DynamicResource GitHubVsWindowText}"
119114
Text="{Binding Description}"
120-
TextWrapping="WrapWithOverflow" />
121-
122-
<TextBlock Margin="7,12,0,0"
123-
Foreground="{DynamicResource GitHubVsGrayText}"
124-
IsHitTestVisible="False"
125-
Text="{x:Static prop:Resources.DescriptionOptional}"
126-
Visibility="{Binding ElementName=description, Path=Text.Length, Converter={ui:CountToVisibilityConverter}}" />
115+
TextWrapping="WrapWithOverflow"
116+
PromptText="{x:Static prop:Resources.DescriptionOptional}" />
127117
</Grid>
128118

129119
<CheckBox x:Name="makePrivate"

0 commit comments

Comments
 (0)