added test bool to server gui
This commit is contained in:
@@ -10,5 +10,7 @@ namespace Server.Models
|
|||||||
class Information : ObservableObject
|
class Information : ObservableObject
|
||||||
{
|
{
|
||||||
public bool CanStartServer { get; set; }
|
public bool CanStartServer { get; set; }
|
||||||
|
|
||||||
|
public bool ServerOnline { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ namespace Server.ViewModels
|
|||||||
Debug.WriteLine("init mainviewmodel");
|
Debug.WriteLine("init mainviewmodel");
|
||||||
InformationModel = new Information();
|
InformationModel = new Information();
|
||||||
InformationModel.CanStartServer = true;
|
InformationModel.CanStartServer = true;
|
||||||
|
InformationModel.ServerOnline = false;
|
||||||
this.ServerStartCommand = new RelayCommand(() =>
|
this.ServerStartCommand = new RelayCommand(() =>
|
||||||
{
|
{
|
||||||
Debug.WriteLine("connect button clicked");
|
Debug.WriteLine("connect button clicked");
|
||||||
@@ -35,7 +36,7 @@ namespace Server.ViewModels
|
|||||||
|
|
||||||
Debug.WriteLine("can start server " + InformationModel.CanStartServer);
|
Debug.WriteLine("can start server " + InformationModel.CanStartServer);
|
||||||
serverCommunication.Start();
|
serverCommunication.Start();
|
||||||
|
InformationModel.ServerOnline = true;
|
||||||
InformationModel.CanStartServer = false;
|
InformationModel.CanStartServer = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="MainWindow" Height="450" Width="800">
|
Title="MainWindow" Height="450" Width="800">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Button Content="Start Server" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Command="{Binding ServerStartCommand}" IsEnabled="{Binding MainViewModel.InformationModel.CanStartServer}"/>
|
<Button Content="Start Server" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Command="{Binding ServerStartCommand}" IsEnabled="{Binding InformationModel.CanStartServer}"/>
|
||||||
<Label Content="{Binding MainViewModel.InformationModel.CanStartServer}" HorizontalAlignment="Left" Margin="97,7,0,0" VerticalAlignment="Top"/>
|
<Label Content="{Binding InformationModel.ServerOnline}" HorizontalAlignment="Left" Margin="169,10,0,0" VerticalAlignment="Top"/>
|
||||||
|
<Label Content="Server Online:" HorizontalAlignment="Left" Margin="80,7,0,0" VerticalAlignment="Top"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ namespace Server
|
|||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
|
|
||||||
InitializeComponent();
|
|
||||||
// use mainviewmodel for the bindings of our methods
|
// use mainviewmodel for the bindings of our methods
|
||||||
DataContext = new MainViewModel();
|
DataContext = new MainViewModel();
|
||||||
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user