Skip to content

Commit

Permalink
Refactor realm placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Lemstra committed Feb 29, 2024
1 parent 1b96529 commit 7197019
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion App.Library/Templates/ConnectWithCredentialsTemplate.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
Padding="2,3,2,3" Height="Auto" MinHeight="24" Margin="5" Grid.ColumnSpan="1" Grid.Column="1" Grid.Row="2"
b:FocusBinding.IsFocused="true" />
<TextBlock IsHitTestVisible="False" TextWrapping="Wrap" Foreground="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"
Text="{Binding Realm}"
Text="{Binding RealmPlaceholder}"
TextAlignment="Left" Padding="5,4,2,3" Margin="5" Grid.Column="1" Grid.Row="2">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
Expand Down
9 changes: 8 additions & 1 deletion App.Library/ViewModels/ConnectWithCredentialsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ public ConnectWithCredentialsViewModel(MainViewModel owner, EapConfig eapConfig,

if (hint)
{
this.Realm = string.IsNullOrWhiteSpace(realm) ? Resources.UserNameWatermark : $"{Resources.ExampleRealm}@{realm}";
this.Realm = string.IsNullOrWhiteSpace(realm) ? Resources.UserNameWatermark : $"@{realm}";
this.RealmPlaceholder =$"{Resources.ExampleRealm}@{this.Realm}";
}
else
{
this.Realm = "";
this.RealmPlaceholder = "";
}
}

Expand Down Expand Up @@ -89,6 +91,11 @@ public string Realm
get;
}

public string RealmPlaceholder
{
get;
}

public bool PasswordRequired => this.eapConfig.NeedsLoginCredentials;

protected override async Task ConfigureAndConnectAsync(IList<string> messages)
Expand Down

0 comments on commit 7197019

Please sign in to comment.