mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 14:51:44 +01:00
Fixed Server Name in Server List
This commit is contained in:
parent
f41b69cfd8
commit
b2ec0c1a53
@ -93,7 +93,7 @@ namespace Borepin.PageModel
|
||||
|
||||
NavigationParameters parameters = new NavigationParameters
|
||||
{
|
||||
{ "instance", viewmodel.Instance }
|
||||
{ "instance", viewmodel._Instance }
|
||||
};
|
||||
|
||||
INavigationResult result = await _NavigationService.NavigateAsync($"ServerPage", parameters);
|
||||
|
@ -16,8 +16,8 @@
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="1"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Instance.Address, StringFormat='{0}'}" Style="{StaticResource LabelStyle_Primary}"/>
|
||||
<Label Grid.Row="0" Grid.Column="2" Text="{Binding Instance.Username}" Style="{StaticResource LabelStyle_Second}" HorizontalTextAlignment="End" />
|
||||
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Address, StringFormat='{0}'}" Style="{StaticResource LabelStyle_Primary}"/>
|
||||
<Label Grid.Row="0" Grid.Column="2" Text="{Binding Username}" Style="{StaticResource LabelStyle_Second}" HorizontalTextAlignment="End" />
|
||||
<Button Grid.Row="0" Grid.Column="3" Margin="0, 3, 0, 3" Text="->" Command="{Binding Source={RelativeSource AncestorType={x:Type pagemodel:ServerListPageModel}}, Path=SelectInstanceCommand}" CommandParameter="{Binding .}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
<BoxView Grid.Row="1" Grid.ColumnSpan="5" BackgroundColor="{StaticResource FifthColor}"/>
|
||||
</Grid>
|
||||
|
@ -1,28 +1,45 @@
|
||||
using Borepin.Model;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
|
||||
namespace Borepin.ViewModel
|
||||
{
|
||||
public class ServerListItemViewModel : BindableBase
|
||||
{
|
||||
#region Private Properties
|
||||
public Connection _Instance { get; private set; }
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
public ServerListItemViewModel(Connection instance)
|
||||
{
|
||||
_Instance = instance;
|
||||
Address = instance.Address.ToString();
|
||||
}
|
||||
|
||||
private Connection _Instance;
|
||||
public Connection Instance
|
||||
{
|
||||
get => _Instance;
|
||||
set => SetProperty(ref _Instance, value);
|
||||
Address = ConvertUriToString(instance.Address);
|
||||
Username = instance.Username;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
private string _Address;
|
||||
public string Address
|
||||
{
|
||||
get => _Address;
|
||||
set => SetProperty(ref _Address, value);
|
||||
}
|
||||
|
||||
private string _Username;
|
||||
public string Username
|
||||
{
|
||||
get => _Username;
|
||||
set => SetProperty(ref _Username, value);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public string ConvertUriToString(Uri uri)
|
||||
{
|
||||
return uri.Host;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user