Jetzt mit Pop-out Karte via button über den Thumbnails

This commit is contained in:
Daniel Schick 2025-05-09 09:58:16 +02:00
parent 9ebc723c76
commit d4677bbddf
6 changed files with 69 additions and 4 deletions

View File

@ -50,6 +50,7 @@
<None Remove="Resources\trafficlight_yellow.png" />
<None Remove="Resources\umbrella_closed.png" />
<None Remove="Resources\umbrella_open.png" />
<None Remove="Resources\window_size.png" />
<None Remove="Resources\worker2.png" />
</ItemGroup>
@ -112,6 +113,7 @@
<Resource Include="Resources\trafficlight_yellow.png" />
<Resource Include="Resources\umbrella_closed.png" />
<Resource Include="Resources\umbrella_open.png" />
<Resource Include="Resources\window_size.png" />
<Resource Include="Resources\worker2.png" />
</ItemGroup>

View File

@ -1549,6 +1549,16 @@ namespace BreCalClient.Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
public static byte[] window_size {
get {
object obj = ResourceManager.GetObject("window_size", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>

View File

@ -607,4 +607,7 @@
<data name="textPosition" xml:space="preserve">
<value>Position</value>
</data>
<data name="window_size" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>window_size.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

View File

@ -284,7 +284,14 @@
</Border>
<!-- TERMINAL -->
<Border Grid.Row="0" Grid.RowSpan="3" Grid.Column="7" BorderThickness="1, 0, 0, 0" BorderBrush="{Binding Source={x:Static sets:Settings.Default}, Path=BG_COLOR}" Padding="3,0,0,0">
<Grid x:Name="placeHolderMap" />
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="16" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid x:Name="buttonPanel" Grid.Row="0" />
<Grid x:Name="placeHolderMap" Grid.Row="1" />
</Grid>
</Border>
</Grid>
</Border>

View File

@ -6,6 +6,8 @@ using BreCalClient.misc.Model;
using log4net;
using Microsoft.Web.WebView2.Wpf;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
@ -521,11 +523,52 @@ namespace BreCalClient
if(this._webView == null)
{
_webView = new WebView2();
Button popOutButton = new()
{
Width = 16,
Height = 16,
Content = new Image
{
Source = new BitmapImage(new Uri("Resources/window_size.png", UriKind.Relative))
},
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top
};
popOutButton.Click += (o, e) =>
{
System.Diagnostics.Trace.WriteLine("Popout button clicked");
var pop = new Window
{
Title = "Detail map",
Width = 800,
Height = 600
};
this.placeHolderMap.Children.Remove(_webView);
pop.Content = _webView;
pop.Closing += (s, a) =>
{
pop.Content = null;
this.placeHolderMap.Children.Add(_webView);
popOutButton.IsEnabled = true;
};
pop.Show();
popOutButton.IsEnabled = false;
};
string trenzUri = $"https://aismap.trenz.de/Live/StaticDemo.aspx?site=bsmd&Zoom=13&api=usgPcOPJnvTWUPTVbfVs&apikey=demo-H6cE4SG0FG&imo={this.ShipcallControlModel?.Ship?.Imo}";
await Dispatcher.InvokeAsync(() => {
this.placeHolderMap.Children.Add(_webView);
buttonPanel.Children.Add(popOutButton);
placeHolderMap.Children.Add(_webView);
_webView.EnsureCoreWebView2Async(null);
_webView.Source = new Uri(trenzUri);
});
}