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. C#
  4. Building custom controls from common wpf controls

Building custom controls from common wpf controls

Scheduled Pinned Locked Moved C#
csharpwpfquestionjavadesign
7 Posts 4 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.
  • D Offline
    D Offline
    Dwayne Barsotta
    wrote on last edited by
    #1

    So I'm learning C# WPF coming from Java. Those who know Java, know it can get interesting creating complicated widows applications as it's all done in Java code (I've never seen it done like wpf work xaml). I'm not sure if this is something I want to take yet, but it is a question in the back of my mind. Our company IT guy says you can make a custom dll of ui elements in xaml and code, then compile as a dll. I asked because I want sure if you could only write dlls with C# code and not xaml, he did admit in the several years in C C# he's never actually done this. But, is it possible to write the dll, using common already available controls and maybe extending the classes idk yet. But using common wpf controls changing the view of those controls. For example, say I wanted to change the look of the openfiledialog but keep all the functionality (maybe add to it) is there a way to capture the functionality, and build a GUI for it?

    L M B 3 Replies Last reply
    0
    • D Dwayne Barsotta

      So I'm learning C# WPF coming from Java. Those who know Java, know it can get interesting creating complicated widows applications as it's all done in Java code (I've never seen it done like wpf work xaml). I'm not sure if this is something I want to take yet, but it is a question in the back of my mind. Our company IT guy says you can make a custom dll of ui elements in xaml and code, then compile as a dll. I asked because I want sure if you could only write dlls with C# code and not xaml, he did admit in the several years in C C# he's never actually done this. But, is it possible to write the dll, using common already available controls and maybe extending the classes idk yet. But using common wpf controls changing the view of those controls. For example, say I wanted to change the look of the openfiledialog but keep all the functionality (maybe add to it) is there a way to capture the functionality, and build a GUI for it?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The "OpenFileDialog" is part of the "Windows common controls", and is NOT a "WPF control" you can style (using WPF "styles"). A dll can contain all kinds of "classes"; it's simply a matter of including the right "references" to .NET "system" libraries when building it. A dll can contain both WPF "Windows" and Windows "Forms"; user controls; and custom classes and controls. XAML is simply "presentation" (like HTML) that gets compiled and incorporated at run time. Whatever you do in XAML, can pretty well be constructed on the fly in code. XAML does not require any special treatment (exe vs dll).

      "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

      B 1 Reply Last reply
      0
      • D Dwayne Barsotta

        So I'm learning C# WPF coming from Java. Those who know Java, know it can get interesting creating complicated widows applications as it's all done in Java code (I've never seen it done like wpf work xaml). I'm not sure if this is something I want to take yet, but it is a question in the back of my mind. Our company IT guy says you can make a custom dll of ui elements in xaml and code, then compile as a dll. I asked because I want sure if you could only write dlls with C# code and not xaml, he did admit in the several years in C C# he's never actually done this. But, is it possible to write the dll, using common already available controls and maybe extending the classes idk yet. But using common wpf controls changing the view of those controls. For example, say I wanted to change the look of the openfiledialog but keep all the functionality (maybe add to it) is there a way to capture the functionality, and build a GUI for it?

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        Dwayne Barsotta wrote:

        you can make a custom dll of ui elements in xaml and code, then compile as a dll

        We have many WPF applications but they all use the same login DLL (or we sometimes include the project) which includes datasource, viemodel, view and code. So yes your IT guy is correct.

        Never underestimate the power of human stupidity RAH

        1 Reply Last reply
        0
        • D Dwayne Barsotta

          So I'm learning C# WPF coming from Java. Those who know Java, know it can get interesting creating complicated widows applications as it's all done in Java code (I've never seen it done like wpf work xaml). I'm not sure if this is something I want to take yet, but it is a question in the back of my mind. Our company IT guy says you can make a custom dll of ui elements in xaml and code, then compile as a dll. I asked because I want sure if you could only write dlls with C# code and not xaml, he did admit in the several years in C C# he's never actually done this. But, is it possible to write the dll, using common already available controls and maybe extending the classes idk yet. But using common wpf controls changing the view of those controls. For example, say I wanted to change the look of the openfiledialog but keep all the functionality (maybe add to it) is there a way to capture the functionality, and build a GUI for it?

          B Offline
          B Offline
          BillWoodruff
          wrote on last edited by
          #4

          Start here: [^] For possible issues with mixing and matching WinForms and WPF UserControls: [^]

          1 Reply Last reply
          0
          • L Lost User

            The "OpenFileDialog" is part of the "Windows common controls", and is NOT a "WPF control" you can style (using WPF "styles"). A dll can contain all kinds of "classes"; it's simply a matter of including the right "references" to .NET "system" libraries when building it. A dll can contain both WPF "Windows" and Windows "Forms"; user controls; and custom classes and controls. XAML is simply "presentation" (like HTML) that gets compiled and incorporated at run time. Whatever you do in XAML, can pretty well be constructed on the fly in code. XAML does not require any special treatment (exe vs dll).

            "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

            B Offline
            B Offline
            BillWoodruff
            wrote on last edited by
            #5

            Gerry Schmitz wrote:

            A dll can contain both WPF "Windows" and Windows "Forms"; user controls; and custom classes and controls.

            Have you ever done this yourself ? Seen it done ? Evidence ?

            «... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12

            L 1 Reply Last reply
            0
            • B BillWoodruff

              Gerry Schmitz wrote:

              A dll can contain both WPF "Windows" and Windows "Forms"; user controls; and custom classes and controls.

              Have you ever done this yourself ? Seen it done ? Evidence ?

              «... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Yes; I CREATE AND USE Dll's in my apps "containing WPF AND Windows Forms; etc.". e.g. customer required custom "settings" functions. New functions (including WPF for data entry; Windows forms for the "windows charting control" and "report (rdlc) viewing)" were added as a SEPARATE DLL. A "class library", by default, does not have references to WPF, XAML or Windows Forms "system" dll's; you add them explicitly. Then you add the Windows, etc. The fact that this is beyond your comprehension, does not negate the fact that it can and is being done. Better stick to bit-fiddling. (I also use DLL's for my Entity Framework "repositories" / DAL / whatever; or an XML pickup).

              "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

              B 1 Reply Last reply
              0
              • L Lost User

                Yes; I CREATE AND USE Dll's in my apps "containing WPF AND Windows Forms; etc.". e.g. customer required custom "settings" functions. New functions (including WPF for data entry; Windows forms for the "windows charting control" and "report (rdlc) viewing)" were added as a SEPARATE DLL. A "class library", by default, does not have references to WPF, XAML or Windows Forms "system" dll's; you add them explicitly. Then you add the Windows, etc. The fact that this is beyond your comprehension, does not negate the fact that it can and is being done. Better stick to bit-fiddling. (I also use DLL's for my Entity Framework "repositories" / DAL / whatever; or an XML pickup).

                "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

                B Offline
                B Offline
                BillWoodruff
                wrote on last edited by
                #7

                Upvoted. I am delighted to read a post from you with on-topic content :) Seriously, I think it would be very valuable for CodeProject to have an article on this. thanks, Bill

                «... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12

                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