From d4677bbddfe116e3a1094231c8cf6cb4429ae9e3 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Fri, 9 May 2025 09:58:16 +0200 Subject: [PATCH] =?UTF-8?q?Jetzt=20mit=20Pop-out=20Karte=20via=20button=20?= =?UTF-8?q?=C3=BCber=20den=20Thumbnails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BreCalClient/BreCalClient.csproj | 2 + .../Resources/Resources.Designer.cs | 10 ++++ src/BreCalClient/Resources/Resources.resx | 3 ++ src/BreCalClient/Resources/window_size.png | Bin 0 -> 696 bytes src/BreCalClient/ShipcallControl.xaml | 9 +++- src/BreCalClient/ShipcallControl.xaml.cs | 49 ++++++++++++++++-- 6 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 src/BreCalClient/Resources/window_size.png diff --git a/src/BreCalClient/BreCalClient.csproj b/src/BreCalClient/BreCalClient.csproj index cccc2b9..45843d9 100644 --- a/src/BreCalClient/BreCalClient.csproj +++ b/src/BreCalClient/BreCalClient.csproj @@ -50,6 +50,7 @@ + @@ -112,6 +113,7 @@ + diff --git a/src/BreCalClient/Resources/Resources.Designer.cs b/src/BreCalClient/Resources/Resources.Designer.cs index da41c58..500e9ca 100644 --- a/src/BreCalClient/Resources/Resources.Designer.cs +++ b/src/BreCalClient/Resources/Resources.Designer.cs @@ -1549,6 +1549,16 @@ namespace BreCalClient.Resources { } } + /// + /// Looks up a localized resource of type System.Byte[]. + /// + public static byte[] window_size { + get { + object obj = ResourceManager.GetObject("window_size", resourceCulture); + return ((byte[])(obj)); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// diff --git a/src/BreCalClient/Resources/Resources.resx b/src/BreCalClient/Resources/Resources.resx index c89a9be..98af698 100644 --- a/src/BreCalClient/Resources/Resources.resx +++ b/src/BreCalClient/Resources/Resources.resx @@ -607,4 +607,7 @@ Position + + window_size.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/src/BreCalClient/Resources/window_size.png b/src/BreCalClient/Resources/window_size.png new file mode 100644 index 0000000000000000000000000000000000000000..5f3ced73affddca6b96a17832b0ac24fb181c933 GIT binary patch literal 696 zcmV;p0!RIcP)uwd5ckkp#8%86t#Ql3T1$|7YkBg+C#1OrMbAtHPm7$jto8GSv>etL}~ zEnAv`if8Ah^#B+~ZU!cpDd%s$K!H^Y>u};gKn-YJjw+;sCkQS?0CH7C1k6Y&=fjup zbe(&E`pAOmlbBFZhM7^ym9GN>jL9M{M8cnfs2LbMfB%I8mmcwH$e|&y=Sn|qjZ>ID zaU4H}hY-Mv2N*42K=0j`tXy2joZ2e(wk;+2A}DFj_rW2CONncb->|HHD&7kK4xp5B zI#1oApT)6+5FL>N74rc!PIf zDx^G-n{oN^J5Jtwg~f9Ep1!C3)V+d(_U>c0bMppv_uS*`!;jqQSW)aJN+~I7hMA4{ zr8~~ix}=V6s}|6G{B)r~^p0Jt7tt{DZE-FjSEE<}5JsTtT-U&|d6S9ZFA)`^rM?;* zJbC?@181&tzyC8yB8_vWv9WnRvuY}7uCGQhT+s*j`vztp2q?^+GM>)1X38rnsi>@C z``QNP)K($CCJ`G=4aI~)3?7k!KsBhDP{r0Yjfgm^$B!*2)Ph!1BX~C=;#;8RAD{8v zf4}ojV#M?|AP3-|0000hbVXQnLvL_-a%pF1bO1wdaCvfRXJ~XFsUR{iFgPtTFflP8 eNlrsgQd1yDZDL3ejv-F~0000 - + + + + + + + + diff --git a/src/BreCalClient/ShipcallControl.xaml.cs b/src/BreCalClient/ShipcallControl.xaml.cs index 27f68bf..ce0559a 100644 --- a/src/BreCalClient/ShipcallControl.xaml.cs +++ b/src/BreCalClient/ShipcallControl.xaml.cs @@ -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,12 +523,53 @@ 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); - _webView.EnsureCoreWebView2Async(null); + + buttonPanel.Children.Add(popOutButton); + placeHolderMap.Children.Add(_webView); + + _webView.EnsureCoreWebView2Async(null); _webView.Source = new Uri(trenzUri); - }); + + }); } }