Fixed and compiling

This commit is contained in:
Jordan Wages 2025-08-28 04:37:54 -05:00
commit 2faae1167b
2 changed files with 4 additions and 4 deletions

View file

@ -134,7 +134,7 @@
<Button Grid.Column="1" Command="{Binding ToggleFunctionsCommand}" Margin="0,0,6,0" MinHeight="40" MinWidth="40" <Button Grid.Column="1" Command="{Binding ToggleFunctionsCommand}" Margin="0,0,6,0" MinHeight="40" MinWidth="40"
AutomationProperties.Name="Toggle functions panel"> AutomationProperties.Name="Toggle functions panel">
<Button.Flyout> <Button.Flyout>
<Flyout x:Name="FunctionsFlyout" <Flyout
IsOpen="{Binding IsFunctionsPanelOpen, Mode=TwoWay}" IsOpen="{Binding IsFunctionsPanelOpen, Mode=TwoWay}"
Placement="BottomEdgeAlignedLeft" Placement="BottomEdgeAlignedLeft"
Opened="OnFunctionsFlyoutOpened" Opened="OnFunctionsFlyoutOpened"

View file

@ -95,12 +95,12 @@ public partial class MainView : UserControl
private void OnFunctionsItemTapped(object? sender, TappedEventArgs e) private void OnFunctionsItemTapped(object? sender, TappedEventArgs e)
{ {
if (sender is not IControl control) if (sender is not Control control)
return; return;
if (control.DataContext is not FunctionDefinitionItem item) if (control.DataContext is not FunctionDefinitionItem item)
{ {
// If attached to panel root, walk up from the source to a ListBoxItem and use its DataContext // If attached to panel root, walk up from the source to a ListBoxItem and use its DataContext
if (sender is IVisual root && e.Source is IVisual src) if (sender is ContentPresenter root && e.Source is ContentPresenter src)
{ {
var lbi = src.FindAncestorOfType<ListBoxItem>(); var lbi = src.FindAncestorOfType<ListBoxItem>();
if (lbi?.DataContext is not FunctionDefinitionItem rowItem) if (lbi?.DataContext is not FunctionDefinitionItem rowItem)
@ -126,7 +126,7 @@ public partial class MainView : UserControl
// Flyout content is rendered in a popup; find by name at TopLevel // Flyout content is rendered in a popup; find by name at TopLevel
var top = TopLevel.GetTopLevel(this); var top = TopLevel.GetTopLevel(this);
if (top is null) return; if (top is null) return;
var panel = top.FindDescendantOfType<Border>(b => b.Name == "FunctionsPanelRoot"); var panel = top.FindControl<Border>("FunctionsPanelRoot");
if (panel is null) return; if (panel is null) return;
// Attach a single tap handler to the flyout content root // Attach a single tap handler to the flyout content root