I would like to launch a message dialog at the click of the resize button..
I inserted the message dialog in any click, but how can I launch it in the resize window?
The code:
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private async void Button_Click(object sender, RoutedEventArgs e)
{
var messageDialog = new MessageDialog("This is a Message dialog");
await messageDialog.ShowAsync();
}
}
I approached a possible solution but, I just need the resize button click, is it possible?
The code:
Window.Current.CoreWindow.SizeChanged += (ss, ee) =>
{
var appView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
if (appView.IsFullScreen)
{
//show message
}
ee.Handled = true;
};
Thanks in advance!
You can subscribe to Page Size changed event for this
XAML
C#
Alternately handle it in c# Recommended
using this event
Window.Current.CoreWindow.SizeChanged += CoreWindow_SizeChanged;