English 中文(简体)
如何打开一个窗口,把我的XAML档案装上它? (XAML和C#)
原标题:How to open a window then load my XAML file to it? (XAML and C#)
  • 时间:2011-04-12 00:23:16
  •  标签:
  • c#
  • wpf
  • xaml

I am new to WPF and C# and i need some help - sorry about the newbie question!

不管怎么说,我有一个控制小组窗口,作为我管理项目时装满的档案,然后在这个控制小组有一个子,在点击触发事件时。 在这次活动中,我试图装上一个新窗口,使其自己的XAML代码落后,我如何做到这一点? 我 go,但没有结果。

请逐字解释一下,我仍在getting。

感谢!

private void btnCustomers_clicked(object sender, RoutedEventArgs e)
    {
       //load in Customers.xaml file here - in a new window 
    }
最佳回答

您需要宣布另一窗口的类别实例,然后打电话Show()。 因此,如果你把其他窗口称作<代码>My SecondWindow,你将在本活动中写以下文字。

MySecondWindow otherWindow = new MySecondWindow();
otherWindow.Show();

A basic explination of how windows work can be found on the MSDN Site.

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签