commit ce4167e69580d92e3f80e3ca55e438828d8dd49a parent f08c32a6832ec37a5e3538cb75ce97b6b3949b1f Author: Mikolaj Lenczewski <33129490+EnderRifter@users.noreply.github.com> Date: Sun, 18 Aug 2019 22:43:01 +0200 Added misc bugfixes and fixed small overlooked error with System Details view Diffstat:
4 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/StarSim/StarSimGui/StarSimGui.csproj b/StarSim/StarSimGui/StarSimGui.csproj @@ -23,6 +23,7 @@ <SubType>Designer</SubType> </AvaloniaResource> <AvaloniaResource Include="Assets\*" /> + <Folder Include="Properties\PublishProfiles\" /> </ItemGroup> <ItemGroup> diff --git a/StarSim/StarSimGui/ViewModels/Database ViewModels/ReadSystemsViewModel.cs b/StarSim/StarSimGui/ViewModels/Database ViewModels/ReadSystemsViewModel.cs @@ -124,10 +124,19 @@ namespace StarSimGui.ViewModels.Database_ViewModels this.RaisePropertyChanged(); this.RaisePropertyChanged(nameof(IsSelectedSystemNull)); + this.RaisePropertyChanged(nameof(SelectedSystemBodies)); } } /// <summary> + /// The bodies in the currently selected system. + /// </summary> + public IObservableCollection<BodyToSystemJoin> SelectedSystemBodies + { + get { return new ObservableCollectionExtended<BodyToSystemJoin>(SelectedSystem?.BodyToSystemJoins); } + } + + /// <summary> /// The systems held in the database. /// </summary> public IObservableCollection<StarSimLib.Models.System> Systems diff --git a/StarSim/StarSimGui/Views/Database Views/ReadSystems.xaml b/StarSim/StarSimGui/Views/Database Views/ReadSystems.xaml @@ -14,18 +14,17 @@ <Border BorderBrush="Gray" BorderThickness="2" CornerRadius="2" Margin="2"> <Grid ColumnDefinitions="*,*,*,*" RowDefinitions="*,*,*,*"> - <ListBox Items="{Binding Bodies}" SelectedItem="{Binding SelectedBody, Mode=OneWayToSource}" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Grid.RowSpan="2" Margin="2"> + <ListBox Items="{Binding Bodies}" SelectedItem="{Binding SelectedBody, Mode=TwoWay}" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Grid.RowSpan="2" Margin="2"> </ListBox> - <ListBox Items="{Binding Systems}" SelectedItem="{Binding SelectedSystem, Mode=OneWayToSource}" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="0" Grid.RowSpan="2" Margin="2"> + <ListBox Items="{Binding Systems}" SelectedItem="{Binding SelectedSystem, Mode=TwoWay}" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="0" Grid.RowSpan="2" Margin="2"> </ListBox> <Border BorderBrush="Gray" BorderThickness="2" CornerRadius="2" Margin="2" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" Grid.RowSpan="2"> - <StackPanel DataContext="{Binding SelectedBody}" IsVisible="{Binding !$parent.DataContext.IsSelectedBodyNull}"> - <TextBlock>Selected Body Details:</TextBlock> - </StackPanel> </Border> <Border BorderBrush="Gray" BorderThickness="2" CornerRadius="2" Margin="2" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="2" Grid.RowSpan="2"> - <StackPanel DataContext="{Binding SelectedSystem}" IsVisible="{Binding !$parent.DataContext.IsSelectedSystemNull}"> + <StackPanel IsVisible="{Binding !IsSelectedSystemNull}"> <TextBlock>Selected System Details:</TextBlock> + <ListBox Items="{Binding SelectedSystemBodies}"> + </ListBox> </StackPanel> </Border> </Grid> diff --git a/StarSim/StarSimGui/Views/Database Views/ReadUsers.xaml b/StarSim/StarSimGui/Views/Database Views/ReadUsers.xaml @@ -14,9 +14,9 @@ <Border BorderBrush="Gray" BorderThickness="2" CornerRadius="2" Margin="2"> <Grid ColumnDefinitions="*,*,*,*" RowDefinitions="*,*,*,*"> - <ListBox Items="{Binding Users}" SelectedItem="{Binding SelectedUser, Mode=OneWayToSource}" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Grid.RowSpan="2" Margin="2"> + <ListBox Items="{Binding Users}" SelectedItem="{Binding SelectedUser, Mode=TwoWay}" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Grid.RowSpan="2" Margin="2"> </ListBox> - <ListBox Items="{Binding PublishedSystems}" SelectedItem="{Binding SelectedPublishedSystem, Mode=OneWayToSource}" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="0" Grid.RowSpan="2" Margin="2"> + <ListBox Items="{Binding PublishedSystems}" SelectedItem="{Binding SelectedPublishedSystem, Mode=TwoWay}" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="0" Grid.RowSpan="2" Margin="2"> </ListBox> <Border BorderBrush="Gray" BorderThickness="2" CornerRadius="2" Margin="2" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" Grid.RowSpan="2"> <StackPanel DataContext="{Binding SelectedUser}" IsVisible="{Binding !$parent.DataContext.IsSelectedUserNull}">