Hack Forums
[C#] C# WPF equivalent of such User Control - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] C# WPF equivalent of such User Control (/showthread.php?tid=5468370)



C# WPF equivalent of such User Control - ProBux - Nov 19, 2016

In my Windows Form version of my project, I re-use a user control many times to display song data on my form.

[Image: SogAUov.png]

My WPF remake looks sleeker, and I am now up to designing the remake of the charts tab (and the seen user controls) and I'd like to adapt the same format through some method, but I don't know what to use! If I have say, 100 of the same control, I'd like to prevent any lag, and keep my application fluent.

As you can see, there are several components in my Windows Form user control, three buttons, and multiple labels
[Image: TYUsylD.png]
What would I use to easily design something like this?

I'm writing this before I sleep, so if anything needs clarification, please point it out!

Thanks,
Trontor


* - Assault - Nov 19, 2016

... listview template + your own usercontrol works fine just fine. concept is not so different from winforms.


* - GuRuHaX - Nov 20, 2016

You can use Mahapps.Metro they have some cool features and controls : http://mahapps.com/

But if wanting to design them yourself you would have to create your own usercontrols as stated above
but i would have to say (for myself) that i don't find it "not so different" from winforms , its pure Xaml which uses triggers , binding and so on so nothing that is similar comparing to winforms.

Here is a simple example for creating a UserControl : http://www.codeproject.com/Articles/32825/How-to-Creating-a-WPF-User-Control-using-it-in-a-W

🤝


RE: C# WPF equivalent of such User Control - itcorp - Dec 18, 2017

(Nov 19, 2016 08:04 AM)ProBux Wrote:  In my Windows Form version of my project, I re-use a user control many times to display song data on my form.

[Image: SogAUov.png]

My WPF remake looks sleeker, and I am now up to designing the remake of the charts tab (and the seen user controls) and I'd like to adapt the same format through some method, but I don't know what to use! If I have say, 100 of the same control, I'd like to prevent any lag, and keep my application fluent.

As you can see, there are several components in my Windows Form user control, three buttons, and multiple labels
[Image: TYUsylD.png]
What would I use to easily design something like this?

I'm writing this before I sleep, so if anything needs clarification, please point it out!

Thanks,
Trontor

Actually there are several ways to  prevent lag,what you should do is to try to  simplify your visual tree...
control.SetValue(VirtualizingPanel.VirtualizationModeProperty, VirtualizationMode.Recycling);
control.SetValue(VirtualizingPanel.IsVirtualizingWhenGroupingProperty, false);
control.SetValue(ScrollViewer.IsDeferredScrollingEnabledProperty, true);
also try to avoid using of resource dictionary or dinamic resources and you will notice drastic changes


RE: C# WPF equivalent of such User Control - Ninja - Dec 18, 2017

(Dec 18, 2017 07:14 PM)itcorp Wrote:  Actually there are several ways to  prevent lag,what you should do is to try to  simplify your visual tree...
control.SetValue(VirtualizingPanel.VirtualizationModeProperty, VirtualizationMode.Recycling);
control.SetValue(VirtualizingPanel.IsVirtualizingWhenGroupingProperty, false);
control.SetValue(ScrollViewer.IsDeferredScrollingEnabledProperty, true);
also try to avoid using of resource dictionary or dinamic resources and you will notice drastic changes

This thread is over a year old. Why did you feel the need to dig it up?


RE: C# WPF equivalent of such User Control - itcorp - Dec 19, 2017

(Dec 18, 2017 08:54 PM)Ninja Wrote:  This thread is over a year old. Why did you feel the need to dig it up?

To be honest, I did not pay any attention to the age of thread...I see that he did not get the answer to the question how to speed up performance ,and I had a good intention to help ..So that's why i dig it up,next time, i'll pay attention to that.