private void UserControl_Loaded_1(object sender, RoutedEventArgs e) { var v = VisualTreeHelper.GetParent(this); while (true) { v = VisualTreeHelper.GetParent(v); if (v is MainWindow) break; } parent = (MainWindow)v; }
private void Viewer_Click(object sender, MouseButtonEventArgs e) { MainWindow viewer = new MainWindow(service); viewer.ShowDialog(); }
public static void Create(MainWindow m ) { System.IntPtr handle = (new WinInterop.WindowInteropHelper(m)).Handle; WinInterop.HwndSource.FromHwnd(handle).AddHook(new WinInterop.HwndSourceHook(WindowProc)); }
private void Viewer_Click(object sender, MouseButtonEventArgs e) { MainWindow viewer = new MainWindow(service); viewer.Owner = this; //viewer.Icon = new BitmapImage(new Uri(@"../../PNG/4.png",UriKind.Relative)); viewer.Show(); }