Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Dialog window in a class library

Dialog window in a class library

Scheduled Pinned Locked Moved WPF
csharpwpfquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    USAFHokie80
    wrote on last edited by
    #1

    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:

    P 1 Reply Last reply
    0
    • U USAFHokie80

      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:

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Add a User Control and change the code from UserControl to Window. 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

      U 1 Reply Last reply
      0
      • P Pete OHanlon

        Add a User Control and change the code from UserControl to Window. 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

        U Offline
        U Offline
        USAFHokie80
        wrote on last edited by
        #3

        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

        P realJSOPR 2 Replies Last reply
        0
        • U USAFHokie80

          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

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          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.

          My blog | My articles | MoXAML PowerToys | Onyx

          1 Reply Last reply
          0
          • U USAFHokie80

            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

            realJSOPR Offline
            realJSOPR Offline
            realJSOP
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups