Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ protected FlightWidgetViewModel(NavId id, IExtensionService ext)
Disposable.AddAction(() => Sections.ClearWithItemsDispose());

SectionsView = Sections.ToNotifyCollectionChangedSlim().DisposeItWith(Disposable);

Layout
.Register(
nameof(IsExpanded),
value => IsExpanded = value,
() => IsExpanded,
this.ObservePropertyChanged(x => x.IsExpanded).Skip(1)
)
.DisposeItWith(Disposable);

Layout.LoadWhenRootAttached(RootTracking).AddTo(ref DisposableBag);
}

public MaterialIconKind? Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<drones:FlightModePageViewModel />
</Design.DataContext>
<Panel>
<geoMap:MapView DataContext="{CompiledBinding Map}" />
<geoMap:MapView x:Name="PART_Map" DataContext="{CompiledBinding Map}" />
<ItemsControl ItemsSource="{Binding WidgetsView}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
Expand All @@ -43,6 +43,7 @@
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Margin="8"
GestureSurface="{Binding #PART_Map}"
TouchpadRotationSensitivity="1"
/>
</Panel>
Expand Down
16 changes: 13 additions & 3 deletions src/Asv.Drones/Shell/Pages/FlightMode/FlightModePageViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections.Generic;
using Asv.Avalonia;
using Asv.Avalonia.GeoMap;
using Asv.Common;
Expand Down Expand Up @@ -73,9 +72,20 @@ protected override void AfterLoadExtensions()
nameof(Map.CenterMap),
x => Map.CenterMap.Value = x,
() => Map.CenterMap.Value,
Map.CenterMap
Map.CenterMap.Skip(1)
);
Layout.Register(
nameof(Map.Zoom),
x => Map.Zoom.Value = x,
() => Map.Zoom.Value,
Map.Zoom.Skip(1)
);
Layout.Register(
nameof(Map.Rotation),
x => Map.Rotation.Value = x,
() => Map.Rotation.Value,
Map.Rotation.Skip(1)
);
Layout.Register(nameof(Map.Zoom), x => Map.Zoom.Value = x, () => Map.Zoom.Value, Map.Zoom);
Layout.LoadWhenRootAttached(RootTracking).AddTo(ref DisposableBag);
}
}