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 0000000..5f3ced7 Binary files /dev/null and b/src/BreCalClient/Resources/window_size.png differ diff --git a/src/BreCalClient/ShipcallControl.xaml b/src/BreCalClient/ShipcallControl.xaml index 064a71e..921636a 100644 --- a/src/BreCalClient/ShipcallControl.xaml +++ b/src/BreCalClient/ShipcallControl.xaml @@ -284,7 +284,14 @@ - + + + + + + + + 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); - }); + + }); } }