mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Avalonia sample application namespace
This commit is contained in:
parent
8d0f618f2a
commit
d9ef169d56
|
|
@ -1,6 +1,6 @@
|
|||
<Application xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="AvaloniaApp.App"
|
||||
x:Class="SampleApplication.App"
|
||||
RequestedThemeVariant="Default">
|
||||
<Application.Styles>
|
||||
<FluentTheme />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace AvaloniaApp
|
||||
namespace SampleApplication
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
|
|
@ -17,7 +17,7 @@ namespace AvaloniaApp
|
|||
{
|
||||
desktop.MainWindow = new MainWindow
|
||||
{
|
||||
//DataContext = new MainViewModel()
|
||||
DataContext = new MapViewModel()
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>SampleApplication</RootNamespace>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<DefineConstants>AVALONIA</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
|
@ -12,6 +13,10 @@
|
|||
</AvaloniaResource>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Shared\MapViewModel.cs" Link="MapViewModel.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="..\Shared\etna.kml" Link="etna.kml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
xmlns:md="clr-namespace:Markdown.Avalonia;assembly=Markdown.Avalonia"
|
||||
xmlns:map="clr-namespace:MapControl;assembly=MapControl.Avalonia"
|
||||
xmlns:tools="clr-namespace:MapControl.UiTools;assembly=MapUiTools.Avalonia"
|
||||
xmlns:local="clr-namespace:AvaloniaApp"
|
||||
x:Class="AvaloniaApp.MainWindow"
|
||||
xmlns:local="clr-namespace:SampleApplication"
|
||||
x:Class="SampleApplication.MainWindow"
|
||||
Title="MainWindow">
|
||||
<Grid>
|
||||
<map:Map x:Name="map"
|
||||
|
|
@ -12,6 +12,26 @@
|
|||
Center="53.5,8.2"
|
||||
DoubleTapped="OnMapDoubleTapped">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding Pushpins}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<map:MapPanel/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.Styles>
|
||||
<Style Selector="ContentPresenter">
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
||||
<Setter Property="map:MapPanel.Location" Value="{Binding Location}"/>
|
||||
</Style>
|
||||
</ItemsControl.Styles>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<map:Pushpin Content="{Binding Name}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<map:MapPath Location="53.5,8.2" Stroke="Blue" StrokeThickness="3" Fill="#1F007F00">
|
||||
<map:MapPath.Data>
|
||||
<EllipseGeometry RadiusX="1852" RadiusY="1852"/>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ using MapControl.UiTools;
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace AvaloniaApp
|
||||
namespace SampleApplication
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using Avalonia;
|
||||
using System;
|
||||
|
||||
namespace AvaloniaApp
|
||||
namespace SampleApplication
|
||||
{
|
||||
class Program
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue