Bind repository name and validators

This also gets the repository name warning bound to a validator instead
of reactive properties.
This commit is contained in:
Haacked 2015-03-19 09:58:43 -07:00
Родитель 1ef486b70e
Коммит 343cac7822
4 изменённых файлов: 14 добавлений и 23 удалений

Просмотреть файл

@ -184,12 +184,6 @@ namespace GitHub.ViewModels
private set;
}
public string RepositoryNameWarningText
{
get;
private set;
}
public ICommand Reset
{
get;
@ -202,12 +196,6 @@ namespace GitHub.ViewModels
private set;
}
public bool ShowRepositoryNameWarning
{
get;
private set;
}
public bool ShowUpgradePlanWarning
{
get;

Просмотреть файл

@ -22,8 +22,6 @@ namespace GitHub.ViewModels
/// dashes.
/// </summary>
string SafeRepositoryName { get; }
bool ShowRepositoryNameWarning { get; }
string RepositoryNameWarningText { get; }
ReactivePropertyValidator<string> RepositoryNameValidator { get; }
ReactivePropertyValidator<string> SafeRepositoryNameWarningValidator { get; }
ReactivePropertyValidator<string> BaseRepositoryPathValidator { get; }

Просмотреть файл

@ -91,15 +91,21 @@
<Label Grid.Column="0" Grid.Row="0" Target="{Binding ElementName=nameText}">Name</Label>
<ui:PromptTextBox x:Name="nameText" Grid.Column="1" Grid.Row="0" MaxLength="{x:Static GitHub:Constants.MaxRepositoryNameLength}"/>
<!-- StackPanel Grid.Column="1" Grid.Row="1">
<uirx:ValidationMessage x:Name="nameValidationMessage" ValidatesControl="{Binding ElementName=nameText}"/>
<uirx:ValidationMessage x:Name="safeRepositoryNameWarning" ValidatesControl="{Binding ElementName=nameText}" Icon="alert" Fill="#f39c12" Padding="2,0" />
</StackPanel -->
<StackPanel Grid.Column="1" Grid.Row="1">
<uirx:ValidationMessage
x:Name="nameValidationMessage"
ValidatesControl="{Binding ElementName=nameText}" />
<uirx:ValidationMessage
x:Name="safeRepositoryNameWarning"
ValidatesControl="{Binding ElementName=nameText}"
Icon="alert"
Fill="#f39c12"
Padding="2,0" />
</StackPanel>
<Label Grid.Column="0" Grid.Row="2" Target="{Binding ElementName=description}">Description</Label>
<ui:PromptTextBox x:Name="description" Grid.Column="1" Grid.Row="2"/>
<Label Grid.Column="0" Grid.Row="3" Target="{Binding ElementName=localPathText}">Local path</Label>
<Grid Grid.Column="1" Grid.Row="3">

Просмотреть файл

@ -38,10 +38,9 @@ namespace GitHub.VisualStudio.UI.Views.Controls
d(this.OneWayBind(ViewModel, vm => vm.GitIgnoreTemplates, v => v.ignoreTemplateList.ItemsSource));
d(this.OneWayBind(ViewModel, vm => vm.Licenses, v => v.licenseList.ItemsSource));
//d(this.Bind(ViewModel, vm => vm.RepositoryName, v => v.nameText.Text));
//d(this.OneWayBind(ViewModel, vm => vm.RepositoryNameValidator, v => v.nameValidationMessage.ReactiveValidator));
//d(this.OneWayBind(ViewModel, vm => vm.RepositoryNameWarningText, v => v.safeRepositoryNameWarning.Text));
//d(this.OneWayBind(ViewModel, vm => vm.ShowRepositoryNameWarning, v => v.safeRepositoryNameWarning.ShowError));
d(this.Bind(ViewModel, vm => vm.RepositoryName, v => v.nameText.Text));
d(this.OneWayBind(ViewModel, vm => vm.RepositoryNameValidator, v => v.nameValidationMessage.ReactiveValidator));
d(this.OneWayBind(ViewModel, vm => vm.SafeRepositoryNameWarningValidator, v => v.safeRepositoryNameWarning.ReactiveValidator));
//d(this.Bind(ViewModel, vm => vm.Description, v => v.description.Text));
//d(this.Bind(ViewModel, vm => vm.KeepPrivate, v => v.makePrivate.IsChecked));