Updated name, Fixed type conversion
This commit is contained in:
parent
cb589569a1
commit
d8e18e813d
3 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<application android:label="AvaloniaTest" android:icon="@drawable/Icon" />
|
||||
</manifest>
|
||||
<application android:label="Advanced Calculator" android:icon="@drawable/Icon" />
|
||||
</manifest>
|
|
@ -72,7 +72,6 @@
|
|||
<!-- History -->
|
||||
<Grid Grid.Row="0">
|
||||
<ListBox x:Name="HistoryList" ItemsSource="{Binding History}" SelectedIndex="{Binding SelectedHistoryIndex}"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
AutomationProperties.Name="History list">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="m:HistoryItem">
|
||||
|
|
|
@ -6,6 +6,7 @@ using Avalonia.Interactivity;
|
|||
using Avalonia.VisualTree;
|
||||
using AdvancedCalculator.ViewModels;
|
||||
using AdvancedCalculator.Models;
|
||||
using Avalonia.Controls.Presenters;
|
||||
|
||||
namespace AdvancedCalculator.Views;
|
||||
|
||||
|
@ -69,7 +70,7 @@ public partial class MainView : UserControl
|
|||
private void OnHistoryTapped(object? sender, TappedEventArgs e)
|
||||
{
|
||||
// Find the ListBoxItem the tap originated from
|
||||
var source = e.Source as IVisual;
|
||||
var source = e.Source as ContentPresenter;
|
||||
var container = source?.FindAncestorOfType<ListBoxItem>();
|
||||
if (container?.DataContext is not HistoryItem item)
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue