Skip to content

Commit

Permalink
Merge pull request #104 from TetsuOtter/102-add-close-button-to-selec…
Browse files Browse the repository at this point in the history
…t-marker-popup
  • Loading branch information
TetsuOtter authored Nov 24, 2023
2 parents 6b0f3da + 32e7662 commit f340489
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 49 deletions.
112 changes: 63 additions & 49 deletions TRViS/DTAC/SelectMarkerPopup.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,69 @@
x:DataType="vm:DTACMarkerViewModel"
VerticalOptions="Center"
HorizontalOptions="End"
Size="240,240">
<HorizontalStackLayout
Padding="8"
HorizontalOptions="Center">
<Frame
Margin="4"
Padding="16"
WidthRequest="80">
<ListView
SelectionMode="Single"
SeparatorVisibility="Default"
ios:ListView.SeparatorStyle="FullWidth"
ItemsSource="{Binding ColorList, Mode=OneTime}"
SelectedItem="{Binding SelectedMarkerInfo, Mode=TwoWay}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell
x:DataType="vm:MarkerInfo">
<ContentView>
<Frame
HeightRequest="32"
WidthRequest="32"
VerticalOptions="Center"
HorizontalOptions="Center"
BackgroundColor="{Binding Color}">
<Label
Text="{Binding Name}"
TextColor="Black"
Background="#AFFF"
Size="240,360">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<Button
Grid.Row="0"
Margin="0,8,8,0"
Text="Close"
HorizontalOptions="End"
Clicked="OnCloseButtonClicked"/>
<HorizontalStackLayout
Grid.Row="1"
Padding="8"
HorizontalOptions="Center">
<Frame
Margin="4"
Padding="16"
WidthRequest="80">
<ListView
SelectionMode="Single"
SeparatorVisibility="Default"
ios:ListView.SeparatorStyle="FullWidth"
ItemsSource="{Binding ColorList, Mode=OneTime}"
SelectedItem="{Binding SelectedMarkerInfo, Mode=TwoWay}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell
x:DataType="vm:MarkerInfo">
<ContentView>
<Frame
HeightRequest="32"
WidthRequest="32"
VerticalOptions="Center"
HorizontalOptions="Center"
VerticalOptions="Center"/>
</Frame>
</ContentView>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Frame>
BackgroundColor="{Binding Color}">
<Label
Text="{Binding Name}"
TextColor="Black"
Background="#AFFF"
HorizontalOptions="Center"
VerticalOptions="Center"/>
</Frame>
</ContentView>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Frame>

<Frame
Margin="4"
Padding="16"
WidthRequest="128">
<ListView
SelectionMode="Single"
SeparatorVisibility="Default"
ios:ListView.SeparatorStyle="FullWidth"
ItemsSource="{Binding TextList, Mode=OneTime}"
SelectedItem="{Binding SelectedText, Mode=TwoWay}"/>
</Frame>
</HorizontalStackLayout>
<Frame
Margin="4"
Padding="16"
WidthRequest="128">
<ListView
SelectionMode="Single"
SeparatorVisibility="Default"
ios:ListView.SeparatorStyle="FullWidth"
ItemsSource="{Binding TextList, Mode=OneTime}"
SelectedItem="{Binding SelectedText, Mode=TwoWay}"/>
</Frame>
</HorizontalStackLayout>
</Grid>
</xct:Popup>
9 changes: 9 additions & 0 deletions TRViS/DTAC/SelectMarkerPopup.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,13 @@ public SelectMarkerPopup(DTACMarkerViewModel viewModel)

logger.Trace("Created");
}

async void OnCloseButtonClicked(object sender, EventArgs e)
{
logger.Trace("Closing...");

await CloseAsync();

logger.Trace("Closed");
}
}

0 comments on commit f340489

Please sign in to comment.