Building custom controls from common wpf controls
-
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?
-
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?
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
-
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?
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
-
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?
-
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
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
-
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
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
-
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
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