I am new to MVVM and Caliburn.Micro and experimenting around with it.
Currently I am looking for a possibility to programmatically generate and add Controls, in this case Buttons, in a MVVM compatible way.
Is there a good way to dynamically add/generate controls and provide them functionality?
Related
Is there a suitable grid control in Xamarin Android, table-like, for a business app that supports databindind with collections that help altering various columns/cells?
As far as I find out, there are alternatives only by inheriting an existing control like ListView and creating a custom control.
If a control as one I am searching for does not exist, what could be the best option left?
Many thanks in advance!!
Is there a suitable grid control in Xamarin Android, table-like, for a business app that supports databindind with collections that help altering various columns/cells?
You can refer to GridView, it displays items in a two-dimensional, scrollable grid.
And this tutorial will show how to create a Grid View.
I created a grid splitted to two columns in WPF.
Then i need to access this grid in WinForm ( need to insert objects that created in WinForm inside the two columns).
How do i access the grid from WinForm?
Note: I have the handle of the window from the WPF:
ActiveMapCoreView = new MapCoreView(**Handle**, strPath);
Thanks! (:
If you want to mix winforms and WPF, you can host the WPF control in a winform using ElementHost Class.
You can find an exemple here
You can mix WinForms and WPF using an ElementHost. This walkthrough guides you through the process. This question and this article are worth looking at too.
On a related note, if your UI is predominantly WPF/WinForms it may be easier, and more consistent, longer term to port everything across into that format.
I would like to use a custom font for a Label in my WinForms project without installing the font. I found this as a solution, however it does not work since the FontStyle I want to use is Thin, which is not included in the System.Drawing.FontStyle enumerator.
Since I read instead that it should be quite easy in WPF to use such a custom font, I thought that a possible solution is to create a custom label (ThinLabel) in WPF and to host it in Winforms. Can you please instruct me on which is the proper way to create a custom label in WPF for this purpose? I read that in WPF controls can be customized in several ways (Styles, Data Templates,..) but I've no idea of which should be taken for this purpose. Please consider I've never used WPF so far.
In Order to implement WPF UserControls in Winforms you need to use and ElementHost
So if you want to create an WPF Label like you said in WPF you create a DLL project with your label inside it and reference it in your winforms project, after building you should be able to see a the UserControl with the label in the toolbox if not use an ElementHost
We are using a third party Chart control which was developed using WPF and that doesn't support MVVM. Now we need to add few more functionality and that should support Add/Remove feature on demand. We need to create Wrapper Chart control with new features and that should support MVVM. This dll/Module will be used by a few other Modules/Projects.
Note :
For every new feature we created Handler and composed the existing chart control. So we were able to support add/remove feature on demand.
Question :
How to support MVVM, is it for each FeatureHandler should i create ViewModel which wrap FeatureHandler(View) and looks like MVVM? Need clarification on this part.....
What do you mean dosen't support MVVM? I sounds fairly unlikely that a chart control developed with WPF dosen't expose properties in form of dependency properties. Do you have link to this third party chart control?
Create own TextBox, Button etc control as own control using User control in C# Windows application, is this good idea?
I wanted make consistency for through out the application. Suppose if I want to change the Textbox border color then all forms textbox updated with this changes. It's just an example.
Please suggest me.
I don't recommend using UserControl just for consistency. If application skinning is what you are after, look into WPF. It makes it relatively simple to skin an application (or even a window, or smaller groups)
Here is an article on skinning with WPF: http://www.codeproject.com/Articles/19782/Creating-a-Skinned-User-Interface-in-WPF
Another alternative, staying within Windows Forms, is creating a class that inherits from TextBox, and using that class throughout the application. The Factory pattern would work well here. You could even adapt it to multiple skins.
It's not a bad idea to provide custom controls that match your "User Experience" (UX). It really just depends on what you are trying to accomplish with your program.