mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 14:51:44 +01:00
Changed ServerPage Display Host and Port
This commit is contained in:
parent
3212904bd0
commit
67722db0bd
@ -6,7 +6,7 @@
|
||||
<FlyoutPage.Flyout>
|
||||
<ContentPage Title="FabAccess" BackgroundColor="{StaticResource SecondColor}">
|
||||
<StackLayout>
|
||||
<StackLayout Margin="0,50,0,0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
|
||||
<StackLayout Margin="0,50,0,0" VerticalOptions="FillAndExpand">
|
||||
<Button Text="Machines" Command="{Binding NavigateCommand}" CommandParameter="MachineListPage" VerticalOptions="Start" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}"/>
|
||||
<Button Text="Servers" Command="{Binding NavigateCommand}" CommandParameter="ServerListPage" VerticalOptions="Start" BackgroundColor="{StaticResource SecondColor}" TextColor="{StaticResource FirstColor}"/>
|
||||
</StackLayout>
|
||||
|
@ -11,7 +11,7 @@
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
<ContentPage.Content>
|
||||
<StackLayout Padding="20" VerticalOptions="FillAndExpand">
|
||||
<StackLayout Padding="20">
|
||||
<StackLayout IsVisible="{Binding IsBusy}">
|
||||
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
|
||||
</StackLayout>
|
||||
|
@ -14,12 +14,18 @@
|
||||
<StackLayout IsVisible="{Binding IsBusy}">
|
||||
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
|
||||
</StackLayout>
|
||||
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
|
||||
<Label Text="{Binding Connection_Item.Address}"/>
|
||||
<Button IsVisible="{Binding InstanceIsActiveConnection, Converter={StaticResource InvertBoolConverter}}" Text="Connect" Command="{Binding ConnectCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
<Button IsVisible="{Binding InstanceIsActiveConnection}" Text="Disconnect" Command="{Binding DisconnectCommand}" Style="{StaticResource Style_Button_Admin}"/>
|
||||
<Button Text="Delete" Command="{Binding DeleteCommand}" Style="{StaticResource Style_Button_Admin}"/>
|
||||
</StackLayout>
|
||||
<Grid IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}" VerticalOptions="FillAndExpand">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="50"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackLayout Grid.Row="0">
|
||||
<Label Text="{Binding DisplayAddress}" HorizontalTextAlignment="Center" Margin="0,0,0,10" Style="{StaticResource LabelStyle_Title}"/>
|
||||
<Button IsVisible="{Binding InstanceIsActiveConnection, Converter={StaticResource InvertBoolConverter}}" Text="Connect" Command="{Binding ConnectCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||
<Button IsVisible="{Binding InstanceIsActiveConnection}" Text="Disconnect" Command="{Binding DisconnectCommand}" Style="{StaticResource Style_Button_Admin}"/>
|
||||
</StackLayout>
|
||||
<Button Grid.Row="1" Text="Delete" Command="{Binding DeleteCommand}" Style="{StaticResource Style_Button_Admin}" VerticalOptions="End"/>
|
||||
</Grid>
|
||||
</StackLayout>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
@ -7,6 +7,7 @@ using Prism.Navigation;
|
||||
using Prism.Services;
|
||||
using Prism.Services.Dialogs;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
@ -46,6 +47,11 @@ namespace Borepin.PageModel
|
||||
InstanceIsActiveConnection = false;
|
||||
}
|
||||
|
||||
if(_Connection_Item != null && _Connection_Item.Address != null)
|
||||
{
|
||||
DisplayAddress = string.Format(CultureInfo.InvariantCulture, "{0}:{1}", _Connection_Item.Address.Host, _Connection_Item.Address.Port);
|
||||
}
|
||||
|
||||
IsBusy = false;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
@ -59,6 +65,13 @@ namespace Borepin.PageModel
|
||||
set => SetProperty(ref _Connection_Item, value);
|
||||
}
|
||||
|
||||
private string _DisplayAddress;
|
||||
public string DisplayAddress
|
||||
{
|
||||
get => _DisplayAddress;
|
||||
set => SetProperty(ref _DisplayAddress, value);
|
||||
}
|
||||
|
||||
private bool _InstanceIsActiveConnection;
|
||||
public bool InstanceIsActiveConnection
|
||||
{
|
||||
@ -164,13 +177,13 @@ namespace Borepin.PageModel
|
||||
|
||||
}
|
||||
|
||||
public override void OnNavigatedTo(INavigationParameters parameters)
|
||||
public override async void OnNavigatedTo(INavigationParameters parameters)
|
||||
{
|
||||
if(Connection_Item == null)
|
||||
{
|
||||
Connection_Item = parameters["instance"] as Connection;
|
||||
|
||||
LoadData();
|
||||
await LoadData().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
Loading…
x
Reference in New Issue
Block a user