[SOLVED] Error on ChildWindow
Posted: Sat Nov 24, 2018 11:23 am
see sample attached,
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace Application16
{
public partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
this.GotFocus += MainPage_GotFocus; // dosent work!
// Enter construction logic here...
Login(); // dosent work!
// Login(); work only from button click { private void Button_Click(object sender, RoutedEventArgs e)}
}
private void MainPage_GotFocus(object sender, RoutedEventArgs e)
{
Login();
}
private void Login()
{
ChildWindow cw = new ChildWindow();
cw.Content = "login form !!";
cw.ShowAndWait();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Login();
}
}
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace Application16
{
public partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
this.GotFocus += MainPage_GotFocus; // dosent work!
// Enter construction logic here...
Login(); // dosent work!
// Login(); work only from button click { private void Button_Click(object sender, RoutedEventArgs e)}
}
private void MainPage_GotFocus(object sender, RoutedEventArgs e)
{
Login();
}
private void Login()
{
ChildWindow cw = new ChildWindow();
cw.Content = "login form !!";
cw.ShowAndWait();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Login();
}
}
}