Dialog window in a class library
-
I want to put a window in a class library so i can use it in multiple places but I've noticed that I don't have the option of adding a WPF window to my project. If I right-click in the solution explorer, I can add a new item but I can only add a Windows Form (non WPF) or a "User Control (WPF)". Is there a way I can do this easily? FYI... I'm new to this whole WPF thing so I'm still trying to figure it all out. :confused:
-
I want to put a window in a class library so i can use it in multiple places but I've noticed that I don't have the option of adding a WPF window to my project. If I right-click in the solution explorer, I can add a new item but I can only add a Windows Form (non WPF) or a "User Control (WPF)". Is there a way I can do this easily? FYI... I'm new to this whole WPF thing so I'm still trying to figure it all out. :confused:
Add a User Control and change the code from
UserControl
toWindow
. It's no harder than that. There are two places to change - the XAML and the code behind; make sure you change both."WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
modified on Wednesday, April 28, 2010 3:50 PM
-
Add a User Control and change the code from
UserControl
toWindow
. It's no harder than that. There are two places to change - the XAML and the code behind; make sure you change both."WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
modified on Wednesday, April 28, 2010 3:50 PM
I thought about that... and I did change the code. I wasn't sure about the XAML stuff though. I've only ever really used MFC and just got into WPF a few weeks ago. I'm not sure I like all this XML stuff. :-p
-
I thought about that... and I did change the code. I wasn't sure about the XAML stuff though. I've only ever really used MFC and just got into WPF a few weeks ago. I'm not sure I like all this XML stuff. :-p
You get used to it, and it gets very addictive. It takes a bit of perserverance, but once you get it it's hard to go back.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
I thought about that... and I did change the code. I wasn't sure about the XAML stuff though. I've only ever really used MFC and just got into WPF a few weeks ago. I'm not sure I like all this XML stuff. :-p
USAFHokie80 wrote:
I'm not sure I like all this XML stuff.
Most real programmer (programmers with significant unmanaged coding experience) feel that way. If you want to experience REAL pain, try doing an entire WPF app without XAML. Only one word describes the experience, and that word starts with the letter "cluster".
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001