Moved HyperlinkText to SampleApps

This commit is contained in:
Clemens 2021-10-28 20:26:51 +02:00
parent 19d1b8f479
commit af238035cf
20 changed files with 35 additions and 70 deletions

View file

@ -74,9 +74,6 @@
<Compile Include="..\Shared\GnomonicProjection.cs"> <Compile Include="..\Shared\GnomonicProjection.cs">
<Link>GnomonicProjection.cs</Link> <Link>GnomonicProjection.cs</Link>
</Compile> </Compile>
<Compile Include="..\Shared\HyperlinkText.cs">
<Link>HyperlinkText.cs</Link>
</Compile>
<Compile Include="..\Shared\ImageFileCache.cs"> <Compile Include="..\Shared\ImageFileCache.cs">
<Link>ImageFileCache.cs</Link> <Link>ImageFileCache.cs</Link>
</Compile> </Compile>

View file

@ -20,7 +20,7 @@ using System.Windows.Controls;
using System.Windows.Documents; using System.Windows.Documents;
#endif #endif
namespace MapControl namespace SampleApplication
{ {
public static class HyperlinkText public static class HyperlinkText
{ {

View file

@ -15,7 +15,7 @@ using System.Windows;
using System.Windows.Media; using System.Windows.Media;
#endif #endif
namespace ViewModel namespace SampleApplication
{ {
public class MapLayers : INotifyPropertyChanged public class MapLayers : INotifyPropertyChanged
{ {

View file

@ -2,7 +2,7 @@
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
namespace ViewModel namespace SampleApplication
{ {
public class ViewModelBase : INotifyPropertyChanged public class ViewModelBase : INotifyPropertyChanged
{ {

View file

@ -1,8 +1,8 @@
<Application <Application
x:Class="UniversalApp.App" x:Class="SampleApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UniversalApp" xmlns:local="using:SampleApplication"
RequestedTheme="Light"> RequestedTheme="Light">
</Application> </Application>

View file

@ -5,7 +5,7 @@ using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation; using Windows.UI.Xaml.Navigation;
namespace UniversalApp namespace SampleApplication
{ {
sealed partial class App : Application sealed partial class App : Application
{ {

View file

@ -1,7 +1,8 @@
<Page <Page
x:Class="UniversalApp.MainPage" x:Class="SampleApplication.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SampleApplication"
xmlns:map="using:MapControl"> xmlns:map="using:MapControl">
<Page.Resources> <Page.Resources>
@ -141,7 +142,7 @@
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="#BFFFFFFF"> <Border HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="#BFFFFFFF">
<TextBlock Margin="2" FontSize="10" <TextBlock Margin="2" FontSize="10"
map:HyperlinkText.InlinesSource="{Binding MapLayers.CurrentMapLayer.Description}"/> local:HyperlinkText.InlinesSource="{Binding MapLayers.CurrentMapLayer.Description}"/>
</Border> </Border>
<Grid Grid.Row="1"> <Grid Grid.Row="1">

View file

@ -2,12 +2,11 @@
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using MapControl; using MapControl;
using ViewModel;
using Windows.UI.Xaml; using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Controls.Primitives;
namespace UniversalApp namespace SampleApplication
{ {
public sealed partial class MainPage : Page public sealed partial class MainPage : Page
{ {

View file

@ -48,6 +48,9 @@
<EnableGatekeeperAnalysis>false</EnableGatekeeperAnalysis> <EnableGatekeeperAnalysis>false</EnableGatekeeperAnalysis>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Shared\HyperlinkText.cs">
<Link>HyperlinkText.cs</Link>
</Compile>
<Compile Include="..\Shared\MapLayers.cs"> <Compile Include="..\Shared\MapLayers.cs">
<Link>MapLayers.cs</Link> <Link>MapLayers.cs</Link>
</Compile> </Compile>

View file

@ -1,8 +1,8 @@
<Application <Application
x:Class="WinUiApp.App" x:Class="SampleApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WinUiApp"> xmlns:local="using:SampleApplicationplication">
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>

View file

@ -1,51 +1,20 @@
using Microsoft.UI.Xaml; using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.UI.Xaml.Shapes;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure, namespace SampleApplication
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace WinUiApp
{ {
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : Application public partial class App : Application
{ {
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App() public App()
{ {
this.InitializeComponent(); InitializeComponent();
} }
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{ {
m_window = new MainWindow(); window = new MainWindow();
m_window.Activate(); window.Activate();
} }
private Window m_window; private Window window;
} }
} }

View file

@ -1,5 +1,5 @@
<Window <Window
x:Class="WinUiApp.MainWindow" x:Class="SampleApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:map="using:MapControl"> xmlns:map="using:MapControl">
@ -95,7 +95,7 @@
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<map:Map x:Name="map" ZoomLevel="11" MaxZoomLevel="21" MouseWheelZoomDelta="1" <map:Map x:Name="map" ZoomLevel="11" MaxZoomLevel="21" MouseWheelZoomDelta=".5"
Center="{Binding MapCenter}" Center="{Binding MapCenter}"
MapLayer="{Binding MapLayers.CurrentMapLayer}" MapLayer="{Binding MapLayers.CurrentMapLayer}"
ViewportChanged="MapViewportChanged"> ViewportChanged="MapViewportChanged">

View file

@ -5,9 +5,8 @@ using System;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using ViewModel;
namespace WinUiApp namespace SampleApplication
{ {
public sealed partial class MainWindow : Window public sealed partial class MainWindow : Window
{ {

View file

@ -3,7 +3,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows10.0.19041</TargetFramework> <TargetFramework>net5.0-windows10.0.19041</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion> <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>WinUiApp</RootNamespace> <RootNamespace>SampleApplication</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers> <RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
@ -25,8 +25,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Shared\MapLayers.cs" Link="MapLayers.cs" /> <Compile Include="..\Shared\*.cs" />
<Compile Include="..\Shared\MapViewModel.cs" Link="MapViewModel.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -1,4 +1,4 @@
<Application x:Class="WpfApplication.App" <Application x:Class="SampleApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml"> StartupUri="MainWindow.xaml">

View file

@ -1,6 +1,6 @@
using System.Windows; using System.Windows;
namespace WpfApplication namespace SampleApplication
{ {
public partial class App : Application public partial class App : Application
{ {

View file

@ -1,9 +1,8 @@
<Window x:Class="WpfApplication.MainWindow" <Window x:Class="SampleApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:map="clr-namespace:MapControl;assembly=MapControl.WPF" xmlns:map="clr-namespace:MapControl;assembly=MapControl.WPF"
xmlns:vm="clr-namespace:ViewModel" xmlns:local="clr-namespace:SampleApplication"
xmlns:local="clr-namespace:WpfApplication"
Title="XAML MapControl - WPF Sample Application" Height="600" Width="900" Title="XAML MapControl - WPF Sample Application" Height="600" Width="900"
Stylus.IsPressAndHoldEnabled="False"> Stylus.IsPressAndHoldEnabled="False">
<Window.Resources> <Window.Resources>
@ -113,7 +112,7 @@
</Window.Resources> </Window.Resources>
<Window.DataContext> <Window.DataContext>
<vm:MapViewModel/> <local:MapViewModel/>
</Window.DataContext> </Window.DataContext>
<Grid> <Grid>
@ -170,7 +169,7 @@
</map:Map> </map:Map>
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="#AFFFFFFF"> <Border HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="#AFFFFFFF">
<TextBlock Margin="4,2" FontSize="10" map:HyperlinkText.InlinesSource="{Binding MapLayer.Description, ElementName=map}"/> <TextBlock Margin="4,2" FontSize="10" local:HyperlinkText.InlinesSource="{Binding MapLayer.Description, ElementName=map}"/>
</Border> </Border>
<Grid Grid.Row="1"> <Grid Grid.Row="1">

View file

@ -7,9 +7,8 @@ using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using MapControl; using MapControl;
using MapControl.Caching; using MapControl.Caching;
using ViewModel;
namespace WpfApplication namespace SampleApplication
{ {
public partial class MainWindow : Window public partial class MainWindow : Window
{ {
@ -19,7 +18,7 @@ namespace WpfApplication
{ {
ImageLoader.HttpClient.DefaultRequestHeaders.Add("User-Agent", "XAML Map Control Test Application"); ImageLoader.HttpClient.DefaultRequestHeaders.Add("User-Agent", "XAML Map Control Test Application");
TileImageLoader.Cache = new ImageFileCache(TileImageLoader.DefaultCacheFolder); //TileImageLoader.Cache = new ImageFileCache(TileImageLoader.DefaultCacheFolder);
//TileImageLoader.Cache = new FileDbCache(TileImageLoader.DefaultCacheFolder); //TileImageLoader.Cache = new FileDbCache(TileImageLoader.DefaultCacheFolder);
//TileImageLoader.Cache = new SQLiteCache(TileImageLoader.DefaultCacheFolder); //TileImageLoader.Cache = new SQLiteCache(TileImageLoader.DefaultCacheFolder);
//TileImageLoader.Cache = null; //TileImageLoader.Cache = null;

View file

@ -2,7 +2,7 @@
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media; using System.Windows.Media;
namespace WpfApplication namespace SampleApplication
{ {
public class OutlinedText : FrameworkElement public class OutlinedText : FrameworkElement
{ {

View file

@ -3,7 +3,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFrameworks>net5.0-windows;net48</TargetFrameworks> <TargetFrameworks>net5.0-windows;net48</TargetFrameworks>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<RootNamespace>WpfApplication</RootNamespace> <RootNamespace>SampleApplication</RootNamespace>
<Product>XAML Map Control</Product> <Product>XAML Map Control</Product>
<Version>6.1.0</Version> <Version>6.1.0</Version>
<Description>XAML Map Control WPF Sample Application</Description> <Description>XAML Map Control WPF Sample Application</Description>